Tweak to notifications
This commit is contained in:
parent
074b4dc643
commit
59d2430e2f
@ -260,8 +260,8 @@ class AlpacaWindow(Adw.ApplicationWindow):
|
|||||||
)
|
)
|
||||||
overlay.add_toast(toast)
|
overlay.add_toast(toast)
|
||||||
|
|
||||||
def show_notification(self, title:str, body:str, only_when_focus:bool, icon:Gio.ThemedIcon=None):
|
def show_notification(self, title:str, body:str, only_when_unfocus:bool, icon:Gio.ThemedIcon=None):
|
||||||
if only_when_focus==False or self.is_active()==False:
|
if not only_when_unfocus or (only_when_unfocus and self.is_active()==False):
|
||||||
notification = Gio.Notification.new(title)
|
notification = Gio.Notification.new(title)
|
||||||
notification.set_body(body)
|
notification.set_body(body)
|
||||||
if icon: notification.set_icon(icon)
|
if icon: notification.set_icon(icon)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user