summaryrefslogtreecommitdiff
path: root/debian/patches/0013-Simplified-the-construction-of-the-title-line-of-the.patch
blob: c3416ee061b1525771d54ff449739697fe733f2e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
From: Till Kamppeter <till.kamppeter@gmail.com>
Date: Fri, 22 Jul 2016 09:33:00 +0200
Subject: Simplified the construction of the title line of the hp-systray
 applet menu,
 so that the applet-to-indicator converter sni-qt also imports this title
 line (at least the text of it).

Thanks to Aurelien Gateau for this patch.
---
 ui5/systemtray.py | 25 ++++---------------------
 1 file changed, 4 insertions(+), 21 deletions(-)

diff --git a/ui5/systemtray.py b/ui5/systemtray.py
index 5b69d2b..8888dec 100644
--- a/ui5/systemtray.py
+++ b/ui5/systemtray.py
@@ -442,30 +442,13 @@ class SystemTrayApp(QApplication):
     def setMenu(self):
         self.menu = QMenu()
 
-        title = QWidgetAction(self.menu)
+        title = QAction(self.menu)
         #title.setDisabled(True)
 
-        hbox = QFrame(self.menu)
-        layout = QHBoxLayout(hbox)
-        # layout.setMargin(3)
-        layout.setContentsMargins(3, 3, 3, 3)
-        layout.setSpacing(5)
-        pix_label = QLabel(hbox)
 
-        layout.insertWidget(-1, pix_label, 0)
-
-        icon_size = self.menu.style().pixelMetric(QStyle.PM_SmallIconSize)
-        pix_label.setPixmap(self.prop_icon.pixmap(icon_size))
-
-        label = QLabel(hbox)
-        layout.insertWidget(-1, label, 20)
-        title.setDefaultWidget(hbox)
-
-        label.setText(self.__tr("HPLIP Status Service"))
-
-        f = label.font()
-        f.setBold(True)
-        label.setFont(f)
+        title.setText(self.__tr("HPLIP Status Service"))
+        title.setIcon(self.prop_icon)
+        title.setIconVisibleInMenu(True)
         self.menu.insertAction(None, title)
 
         if devices: