]> Nutra Git (v1) - gamesguru/feather.git/commitdiff
clean up. comment some debug logs.
authorgg <chown_tee@proton.me>
Wed, 14 Jan 2026 08:35:13 +0000 (03:35 -0500)
committergg <chown_tee@proton.me>
Wed, 14 Jan 2026 10:24:08 +0000 (05:24 -0500)
src/MainWindow.cpp
src/components.cpp

index db5a2300e6311631782160568d7f73f543de24f5..426e2258c157e6fcbed738d6fea9aa312d595ab3 100644 (file)
@@ -162,11 +162,14 @@ void MainWindow::initStatusBar() {
     m_statusLabelBalance = new ClickableLabel(this);
     m_statusLabelBalance->setText("Balance: 0 XMR");
     m_statusLabelBalance->setTextInteractionFlags(Qt::TextSelectableByMouse);
-    m_statusLabelBalance->setCursor(Qt::PointingHandCursor);
     m_statusLabelBalance->setContextMenuPolicy(Qt::ActionsContextMenu);
     this->statusBar()->addPermanentWidget(m_statusLabelBalance);
 
-    connect(m_statusLabelBalance, &ClickableLabel::clicked, this, &MainWindow::showBalanceDialog);
+    connect(m_statusLabelBalance, &ClickableLabel::clicked, this, [this](){
+        QMenu menu;
+        menu.addActions(m_statusLabelBalance->actions());
+        menu.exec(QCursor::pos());
+    });
 
     QAction *copyBalanceAction = new QAction(tr("Copy amount"), this);
     connect(copyBalanceAction, &QAction::triggered, this, [this](){
@@ -1656,7 +1659,7 @@ void MainWindow::changeEvent(QEvent* event)
 
 // In changeEvent:
     if (event->type() == QEvent::WindowStateChange) {
-        qDebug() << "changeEvent: WindowStateChange. State:" << this->windowState() << " isMinimized:" << this->isMinimized();
+        // qDebug() << "changeEvent: WindowStateChange. State:" << this->windowState() << " isMinimized:" << this->isMinimized();
         if (this->isMinimized()) {
             if (conf()->get(Config::lockOnMinimize).toBool()) {
                 this->lockWallet();
@@ -1664,32 +1667,25 @@ void MainWindow::changeEvent(QEvent* event)
 
             bool showTray = conf()->get(Config::showTrayIcon).toBool();
             bool minimizeToTray = conf()->get(Config::minimizeToTray).toBool();
-
-            qInfo() << "WindowStateChange: minimized. Tray=" << showTray << " MinToTray=" << minimizeToTray;
-
-            if (showTray && minimizeToTray) {
+            if (showTray && minimizeToTray)
                 this->hide();
-            }
         }
     } else if (event->type() == QEvent::ActivationChange) {
-        qDebug() << "changeEvent: ActivationChange. Active:" << this->isActiveWindow();
-        QTimer::singleShot(350, this, [this](){
+        // qDebug() << "changeEvent: ActivationChange. Active:" << this->isActiveWindow();
+        // Workaround for some window managers (e.g. GNOME) where isExposed() or isMinimized()
+        // state doesn't update immediately upon minimization animation start.
+        QTimer::singleShot(350, this, [this]() {
             auto handle = this->windowHandle();
             if (handle && !handle->isExposed()) {
-            qDebug() << "ActivationChange (delayed): Window not exposed -> Hiding to tray";
-                if (conf()->get(Config::lockOnMinimize).toBool()) {
+                if (conf()->get(Config::lockOnMinimize).toBool())
                     this->lockWallet();
-                }
 
                 bool showTray = conf()->get(Config::showTrayIcon).toBool();
                 bool minimizeToTray = conf()->get(Config::minimizeToTray).toBool();
-                if (showTray && minimizeToTray) {
-                    // Hide all widgets and dialogs, not just MainWindow
-                    // TODO: Implement better logic here
-                    for (const auto &widget : QApplication::topLevelWidgets()) {
+                // TODO: Implement better logic here to hide all widgets and dialogs
+                if (showTray && minimizeToTray)
+                    for (const auto &widget : QApplication::topLevelWidgets())
                         widget->hide();
-                    }
-                }
             }
         });
     }
index e6663ce345992ea41d12986b4f8795fa6a63e30a..439494316f38c4eeaae83c71eaefe3c0457edd49 100644 (file)
@@ -75,7 +75,10 @@ ClickableLabel::ClickableLabel(QWidget* parent, Qt::WindowFlags f)
 ClickableLabel::~ClickableLabel() = default;
 
 void ClickableLabel::mousePressEvent(QMouseEvent* event) {
-    emit clicked();
+    if (event->button() == Qt::LeftButton) {
+        emit clicked();
+    }
+    QLabel::mousePressEvent(event);
 }
 
 WindowModalDialog::WindowModalDialog(QWidget *parent)