diff options
author | Till Kamppeter <till.kamppeter@gmail.com> | 2016-07-22 09:33:00 +0200 |
---|---|---|
committer | Didier Raboud <odyx@debian.org> | 2017-10-02 09:44:49 +0200 |
commit | ef8132d31f351dca8ec5a9b95eb104737bc7e6ab (patch) | |
tree | 81a6173cb7b40a4e76f32e8a0dcbe70ff52607b4 | |
parent | 6e3cf3b9e43048f0df5efb6d2ca7aaaf707e5f27 (diff) |
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.
Patch-Name: hp-systray-make-menu-title-visible-in-sni-qt-indicator.patch
-rw-r--r-- | ui5/systemtray.py | 25 |
1 files changed, 4 insertions, 21 deletions
diff --git a/ui5/systemtray.py b/ui5/systemtray.py index 5b69d2be9..8888dec6d 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: |