Tool tip support for SystemTray... very nice
This commit is contained in:
parent
f207d4cc21
commit
cd1327e1e2
|
@ -2656,7 +2656,7 @@ class ErrorElement(Element):
|
||||||
# Tray CLASS #
|
# Tray CLASS #
|
||||||
# ------------------------------------------------------------------------- #
|
# ------------------------------------------------------------------------- #
|
||||||
class SystemTray:
|
class SystemTray:
|
||||||
def __init__(self, title, filename=None, menu=None, data=None, data_base64=None):
|
def __init__(self, title, filename=None, menu=None, data=None, data_base64=None, tooltip=None):
|
||||||
'''
|
'''
|
||||||
SystemTray - create an icon in the system tray
|
SystemTray - create an icon in the system tray
|
||||||
:param title:
|
:param title:
|
||||||
|
@ -2670,6 +2670,7 @@ class SystemTray:
|
||||||
self.TrayIcon = None
|
self.TrayIcon = None
|
||||||
self.Shown = False
|
self.Shown = False
|
||||||
self.MenuItemChosen = None
|
self.MenuItemChosen = None
|
||||||
|
self.Tooltip = tooltip
|
||||||
|
|
||||||
global _my_windows
|
global _my_windows
|
||||||
|
|
||||||
|
@ -2700,6 +2701,9 @@ class SystemTray:
|
||||||
qmenu.setTitle(self.Menu[0])
|
qmenu.setTitle(self.Menu[0])
|
||||||
AddTrayMenuItem(qmenu, self.Menu[1], self)
|
AddTrayMenuItem(qmenu, self.Menu[1], self)
|
||||||
|
|
||||||
|
if self.Tooltip is not None:
|
||||||
|
self.TrayIcon.setToolTip(str(self.Tooltip))
|
||||||
|
|
||||||
self.TrayIcon.setContextMenu(qmenu)
|
self.TrayIcon.setContextMenu(qmenu)
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue