* move message_log_widget to game

* move files

* update headers

* fix cmakelists

* oracle fixes

* split implementation out to cpp

* fix recursive import

* fix main file

* format
This commit is contained in:
ebbit1q 2025-09-20 14:35:52 +02:00 committed by GitHub
parent f484c98152
commit 17dcaf9afa
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
337 changed files with 728 additions and 721 deletions

View file

@ -0,0 +1,49 @@
#include "tab.h"
#include "../interface/widgets/cards/card_info_display_widget.h"
#include "tab_supervisor.h"
#include <QApplication>
#include <QCloseEvent>
#include <QDebug>
#include <QScreen>
Tab::Tab(TabSupervisor *_tabSupervisor)
: QMainWindow(_tabSupervisor), tabSupervisor(_tabSupervisor), contentsChanged(false), infoPopup(0)
{
setAttribute(Qt::WA_DeleteOnClose);
}
void Tab::showCardInfoPopup(const QPoint &pos, const CardRef &cardRef)
{
if (infoPopup) {
infoPopup->deleteLater();
}
currentCard = cardRef;
infoPopup = new CardInfoDisplayWidget(currentCard, nullptr,
Qt::Widget | Qt::FramelessWindowHint | Qt::X11BypassWindowManagerHint |
Qt::WindowStaysOnTopHint);
infoPopup->setAttribute(Qt::WA_TransparentForMouseEvents);
auto screenRect = qApp->primaryScreen()->geometry();
infoPopup->move(qMax(screenRect.left(), qMin(pos.x() - infoPopup->width() / 2,
screenRect.left() + screenRect.width() - infoPopup->width())),
qMax(screenRect.top(), qMin(pos.y() - infoPopup->height() / 2,
screenRect.top() + screenRect.height() - infoPopup->height())));
infoPopup->show();
}
void Tab::deleteCardInfoPopup(const QString &cardName)
{
if (infoPopup) {
if (currentCard.name == cardName || cardName == "_") {
infoPopup->deleteLater();
infoPopup = 0;
}
}
}
bool Tab::closeRequest()
{
return close();
}