Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

trayicon: set XAyatanaLabel attribute for "Show next break time in tray icon" #646

Merged
merged 1 commit into from
Sep 23, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions safeeyes/plugins/trayicon/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,12 @@
<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]

Expand Down Expand Up @@ -346,6 +352,7 @@ class StatusNotifierItemService(DBusService):
IconName = 'io.github.slgobinath.SafeEyes-enabled'
IconThemePath = ''
ToolTip = ('', [], 'Safe Eyes', '')
XAyatanaLabel = ""
ItemIsMenu = True
Menu = None

Expand Down Expand Up @@ -398,6 +405,14 @@ def set_tooltip(self, title, description):
'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.
Expand Down Expand Up @@ -611,6 +626,7 @@ def update_tooltip(self):
description = ''

self.sni_service.set_tooltip('Safe Eyes', description)
self.sni_service.set_xayatanalabel(description)

def quit_safe_eyes(self):
"""
Expand Down
Loading