mirror of
https://github.com/ZoiteChat/zoitechat.git
synced 2026-03-14 09:40:20 +00:00
Updated fe_apply_theme_for_mode() to immediately reapply fe_apply_theme_to_toplevel() across all currently-open GTK toplevel windows (gtk_window_list_toplevels()), so mode switches update existing windows without reopening them.
Added/kept lifecycle call sites for main and detached/channel windows, with comments explaining that .zoitechat-dark / .zoitechat-light classes are required for GTK CSS selectors. This includes top/tab windows and server list/edit windows. Wired dialog/toplevel creation paths in src/fe-gtk/ to call fe_apply_theme_to_toplevel() (without duplicating platform logic), including common prompt/message dialogs and feature-specific dialogs (join, notify, setup, ignore/ban, etc.), each with the requested brief comment near the new call site.
This commit is contained in:
@@ -1759,6 +1759,9 @@ setup_theme_show_message (GtkMessageType message_type, const char *primary)
|
||||
|
||||
dialog = gtk_message_dialog_new (GTK_WINDOW (setup_window), GTK_DIALOG_MODAL,
|
||||
message_type, GTK_BUTTONS_CLOSE, "%s", primary);
|
||||
/* Window classes are required for GTK CSS selectors like
|
||||
* .zoitechat-dark / .zoitechat-light. */
|
||||
fe_apply_theme_to_toplevel (dialog);
|
||||
gtk_dialog_run (GTK_DIALOG (dialog));
|
||||
gtk_widget_destroy (dialog);
|
||||
}
|
||||
@@ -1849,6 +1852,9 @@ setup_theme_apply_cb (GtkWidget *button, gpointer user_data)
|
||||
dialog = gtk_message_dialog_new (GTK_WINDOW (setup_window), GTK_DIALOG_MODAL,
|
||||
GTK_MESSAGE_WARNING, GTK_BUTTONS_OK_CANCEL,
|
||||
"%s", _("Applying a theme will overwrite your current colors and event settings.\nContinue?"));
|
||||
/* Window classes are required for GTK CSS selectors like
|
||||
* .zoitechat-dark / .zoitechat-light. */
|
||||
fe_apply_theme_to_toplevel (dialog);
|
||||
response = gtk_dialog_run (GTK_DIALOG (dialog));
|
||||
gtk_widget_destroy (dialog);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user