Browse Source

also show with left click

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

+ 6
- 1
linux/caselights View File

@@ -14,7 +14,7 @@ import colorsys
14 14
 import serial, serial.tools, serial.tools.list_ports
15 15
 from PyQt5 import QtWidgets, QtGui, QtCore
16 16
 from PyQt5.QtWidgets import QSystemTrayIcon, QAction, QMenu
17
-from PyQt5.QtGui import QIcon, QPixmap
17
+from PyQt5.QtGui import QIcon, QPixmap, QCursor
18 18
 from PyQt5.QtCore import QCoreApplication, QSettings
19 19
 
20 20
 class CaseLights():
@@ -124,10 +124,15 @@ class CaseLights():
124 124
         trayIcon = QSystemTrayIcon(icon)
125 125
         trayIcon.setToolTip(self.name + " " + self.version)
126 126
         trayIcon.setContextMenu(self.menu)
127
+        trayIcon.activated.connect(self.showHide)
127 128
         trayIcon.setVisible(True)
128 129
 
129 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 136
     def exit(self):
132 137
         if self.serial is not None:
133 138
             if self.serial.is_open:

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

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

Loading…
Cancel
Save