Fix css reload not updating notification event_box

This commit is contained in:
Erik Reider
2021-12-23 18:16:56 +01:00
parent 1424a988c5
commit afefe58cba
3 changed files with 17 additions and 2 deletions

View File

@@ -24,7 +24,9 @@ namespace SwayNotificatonCenter {
public signal void subscribe (uint count, bool dnd); public signal void subscribe (uint count, bool dnd);
public bool reload_css () throws Error { public bool reload_css () throws Error {
return Functions.load_css (style_path); bool result = Functions.load_css (style_path);
if (result) controlCenter.reload_notifications_style ();
return result;
} }
public void reload_config () throws Error { public void reload_config () throws Error {

View File

@@ -297,5 +297,13 @@ namespace SwayNotificatonCenter {
public bool get_visibility () { public bool get_visibility () {
return this.visible; return this.visible;
} }
/** Forces each notification EventBox to reload its style_context #27 */
public void reload_notifications_style () {
foreach (var c in list_box.get_children ()) {
Notification noti = (Notification) c;
if (noti != null) noti.reload_style_context ();
}
}
} }
} }

View File

@@ -383,5 +383,10 @@ namespace SwayNotificatonCenter {
timeout_id = 0; timeout_id = 0;
} }
} }
/** Forces the EventBox to reload its style_context #27 */
public void reload_style_context () {
event_box.get_style_context ().changed ();
}
} }
} }