fix: Move QAction import from QtWidgets to QtGui for PyQt6 compatibility
This commit is contained in:
parent
b2856639dd
commit
a9b53093e1
|
|
@ -8,11 +8,11 @@ Provides system tray icon with menu for controlling the application.
|
|||
import sys
|
||||
from typing import Callable, Optional
|
||||
from PyQt6.QtWidgets import (
|
||||
QSystemTrayIcon, QMenu, QAction, QWidget, QApplication,
|
||||
QSystemTrayIcon, QMenu, QWidget, QApplication,
|
||||
QMessageBox, QInputDialog
|
||||
)
|
||||
from PyQt6.QtCore import pyqtSignal, QObject
|
||||
from PyQt6.QtGui import QIcon, QAction as QActionGui
|
||||
from PyQt6.QtGui import QIcon, QAction
|
||||
|
||||
|
||||
class TrayIcon(QObject):
|
||||
|
|
@ -77,33 +77,33 @@ class TrayIcon(QObject):
|
|||
def _build_menu(self):
|
||||
"""Build the context menu."""
|
||||
# Toggle Overlay
|
||||
toggle_action = QActionGui("Toggle Overlay (Ctrl+Shift+B)", self)
|
||||
toggle_action = QAction("Toggle Overlay (Ctrl+Shift+B)", self)
|
||||
toggle_action.triggered.connect(self.toggle_overlay.emit)
|
||||
self.menu.addAction(toggle_action)
|
||||
|
||||
self.menu.addSeparator()
|
||||
|
||||
# Dashboard
|
||||
dashboard_action = QActionGui("Open Dashboard", self)
|
||||
dashboard_action = QAction("Open Dashboard", self)
|
||||
dashboard_action.triggered.connect(self.show_dashboard.emit)
|
||||
self.menu.addAction(dashboard_action)
|
||||
|
||||
# Settings
|
||||
settings_action = QActionGui("Settings...", self)
|
||||
settings_action = QAction("Settings...", self)
|
||||
settings_action.triggered.connect(self.show_settings.emit)
|
||||
self.menu.addAction(settings_action)
|
||||
|
||||
self.menu.addSeparator()
|
||||
|
||||
# Status
|
||||
self.status_action = QActionGui("Status: Running", self)
|
||||
self.status_action = QAction("Status: Running", self)
|
||||
self.status_action.setEnabled(False)
|
||||
self.menu.addAction(self.status_action)
|
||||
|
||||
self.menu.addSeparator()
|
||||
|
||||
# Quit
|
||||
quit_action = QActionGui("Quit", self)
|
||||
quit_action = QAction("Quit", self)
|
||||
quit_action.triggered.connect(self.quit_requested.emit)
|
||||
self.menu.addAction(quit_action)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue