Browse Source

also show with left click

Thomas Buck 2 years ago
parent
commit
1ac4581a90
3 changed files with 8 additions and 3 deletions
  1. 1
    1
      linux/PKGBUILD
  2. 6
    1
      linux/caselights
  3. 1
    1
      linux/de.xythobuz.caselights.desktop

+ 1
- 1
linux/PKGBUILD View File

1
 # Maintainer: Thomas Buck <thomas@xythobuz.de>
1
 # Maintainer: Thomas Buck <thomas@xythobuz.de>
2
 pkgname=CaseLights
2
 pkgname=CaseLights
3
 pkgver=0.2
3
 pkgver=0.2
4
-pkgrel=1
4
+pkgrel=2
5
 pkgdesc="RGB LED and UV strip controls"
5
 pkgdesc="RGB LED and UV strip controls"
6
 arch=('any')
6
 arch=('any')
7
 license=('unknown')
7
 license=('unknown')

+ 6
- 1
linux/caselights View File

14
 import serial, serial.tools, serial.tools.list_ports
14
 import serial, serial.tools, serial.tools.list_ports
15
 from PyQt5 import QtWidgets, QtGui, QtCore
15
 from PyQt5 import QtWidgets, QtGui, QtCore
16
 from PyQt5.QtWidgets import QSystemTrayIcon, QAction, QMenu
16
 from PyQt5.QtWidgets import QSystemTrayIcon, QAction, QMenu
17
-from PyQt5.QtGui import QIcon, QPixmap
17
+from PyQt5.QtGui import QIcon, QPixmap, QCursor
18
 from PyQt5.QtCore import QCoreApplication, QSettings
18
 from PyQt5.QtCore import QCoreApplication, QSettings
19
 
19
 
20
 class CaseLights():
20
 class CaseLights():
124
         trayIcon = QSystemTrayIcon(icon)
124
         trayIcon = QSystemTrayIcon(icon)
125
         trayIcon.setToolTip(self.name + " " + self.version)
125
         trayIcon.setToolTip(self.name + " " + self.version)
126
         trayIcon.setContextMenu(self.menu)
126
         trayIcon.setContextMenu(self.menu)
127
+        trayIcon.activated.connect(self.showHide)
127
         trayIcon.setVisible(True)
128
         trayIcon.setVisible(True)
128
 
129
 
129
         sys.exit(app.exec_())
130
         sys.exit(app.exec_())
130
 
131
 
132
+    def showHide(self, activationReason):
133
+        if activationReason == QSystemTrayIcon.Trigger:
134
+            self.menu.popup(QCursor.pos())
135
+
131
     def exit(self):
136
     def exit(self):
132
         if self.serial is not None:
137
         if self.serial is not None:
133
             if self.serial.is_open:
138
             if self.serial.is_open:

+ 1
- 1
linux/de.xythobuz.caselights.desktop View File

1
 [Desktop Entry]
1
 [Desktop Entry]
2
 Type=Application
2
 Type=Application
3
-Version=1.0
3
+Version=0.2
4
 Name=CaseLights
4
 Name=CaseLights
5
 Comment=RGB LED and UV strip controls
5
 Comment=RGB LED and UV strip controls
6
 Path=/usr/bin
6
 Path=/usr/bin

Loading…
Cancel
Save