Merge pull request #646 from deltragon/xayatanalabel
trayicon: set XAyatanaLabel attribute for "Show next break time in tray icon"
This commit is contained in:
commit
628abe298a
|
@ -49,6 +49,12 @@ SNI_NODE_INFO = Gio.DBusNodeInfo.new_for_xml("""
|
|||
<property name="Status" type="s" access="read"/>
|
||||
<signal name="NewIcon"/>
|
||||
<signal name="NewTooltip"/>
|
||||
|
||||
<property name="XAyatanaLabel" type="s" access="read"/>
|
||||
<signal name="XAyatanaNewLabel">
|
||||
<arg type="s" name="label" direction="out" />
|
||||
<arg type="s" name="guide" direction="out" />
|
||||
</signal>
|
||||
</interface>
|
||||
</node>""").interfaces[0]
|
||||
|
||||
|
@ -346,6 +352,7 @@ class StatusNotifierItemService(DBusService):
|
|||
IconName = 'io.github.slgobinath.SafeEyes-enabled'
|
||||
IconThemePath = ''
|
||||
ToolTip = ('', [], 'Safe Eyes', '')
|
||||
XAyatanaLabel = ""
|
||||
ItemIsMenu = True
|
||||
Menu = None
|
||||
|
||||
|
@ -398,6 +405,14 @@ class StatusNotifierItemService(DBusService):
|
|||
'NewTooltip'
|
||||
)
|
||||
|
||||
def set_xayatanalabel(self, label):
|
||||
self.XAyatanaLabel = label
|
||||
|
||||
self.emit_signal(
|
||||
"XAyatanaNewLabel",
|
||||
(label, "")
|
||||
)
|
||||
|
||||
class TrayIcon:
|
||||
"""
|
||||
Create and show the tray icon along with the tray menu.
|
||||
|
@ -611,6 +626,7 @@ class TrayIcon:
|
|||
description = ''
|
||||
|
||||
self.sni_service.set_tooltip('Safe Eyes', description)
|
||||
self.sni_service.set_xayatanalabel(description)
|
||||
|
||||
def quit_safe_eyes(self):
|
||||
"""
|
||||
|
|
Loading…
Reference in New Issue