Code sync
[external/hplip.git] / packaging / hp-systray-make-menu-title-visible-in-sni-qt-indicator.dpatch
1 #! /bin/sh /usr/share/dpatch/dpatch-run
2 ## hp-systray-make-menu-title-visible-in-sni-qt-indicator.patch.dpatch by  <till.kamppeter@gmail.com>
3 ##
4 ## All lines beginning with `## DP:' are a description of the patch.
5 ## DP: No description.
6
7 @DPATCH@
8 diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' hplip-3.11.7~/ui4/systemtray.py hplip-3.11.7/ui4/systemtray.py
9 --- hplip-3.11.7~/ui4/systemtray.py     2011-09-27 16:29:05.930588497 +0200
10 +++ hplip-3.11.7/ui4/systemtray.py      2011-09-27 16:34:42.891888674 +0200
11 @@ -348,29 +348,11 @@
12      def setMenu(self):
13          self.menu = QMenu()
14  
15 -        title = QWidgetAction(self.menu)
16 +        title = QAction(self.menu)
17          #title.setDisabled(True)
18 -
19 -        hbox = QFrame(self.menu)
20 -        layout = QHBoxLayout(hbox)
21 -        layout.setMargin(3)
22 -        layout.setSpacing(5)
23 -        pix_label = QLabel(hbox)
24 -
25 -        layout.insertWidget(-1, pix_label, 0)
26 -
27 -        icon_size = self.menu.style().pixelMetric(QStyle.PM_SmallIconSize)
28 -        pix_label.setPixmap(self.prop_icon.pixmap(icon_size))
29 -
30 -        label = QLabel(hbox)
31 -        layout.insertWidget(-1, label, 20)
32 -        title.setDefaultWidget(hbox)
33 -
34 -        label.setText(self.__tr("HPLIP Status Service"))
35 -
36 -        f = label.font()
37 -        f.setBold(True)
38 -        label.setFont(f)
39 +        title.setText(self.__tr("HPLIP Status Service"))
40 +        title.setIcon(self.prop_icon)
41 +        title.setIconVisibleInMenu(True)
42          self.menu.insertAction(None, title)
43  
44          if devices: