mirror of
https://github.com/ZoiteChat/zoitechat.git
synced 2026-03-17 11:10:18 +00:00
Added a reload-capable GTK3 theme apply API (fe_apply_gtk3_theme_with_reload) and kept fe_apply_gtk3_theme as the default fast-path wrapper (force_reload = FALSE).
Updated the same-theme early return so it is bypassed when reload is requested, while preserving the existing provider reset/replacement flow, gtk_style_context_reset_widgets, and top-level reapply behavior. Wired setup import/apply flow to force a reload on the next apply after successful archive import, ensuring same-name imported themes are reloaded from disk; the flag is cleared after apply and when switching back to system theme.
This commit is contained in:
@@ -596,7 +596,7 @@ static char *gtk3_theme_provider_name = NULL;
|
||||
static gboolean gtk3_theme_provider_dark = FALSE;
|
||||
|
||||
gboolean
|
||||
fe_apply_gtk3_theme (const char *theme_name, GError **error)
|
||||
fe_apply_gtk3_theme_with_reload (const char *theme_name, gboolean force_reload, GError **error)
|
||||
{
|
||||
GdkScreen *screen = gdk_screen_get_default ();
|
||||
char *theme_dir = NULL;
|
||||
@@ -628,7 +628,8 @@ fe_apply_gtk3_theme (const char *theme_name, GError **error)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
if (gtk3_theme_provider_name
|
||||
if (!force_reload
|
||||
&& gtk3_theme_provider_name
|
||||
&& g_strcmp0 (gtk3_theme_provider_name, theme_name) == 0
|
||||
&& gtk3_theme_provider_dark == dark)
|
||||
{
|
||||
@@ -694,6 +695,14 @@ fe_apply_gtk3_theme (const char *theme_name, GError **error)
|
||||
}
|
||||
|
||||
|
||||
gboolean
|
||||
fe_apply_gtk3_theme (const char *theme_name, GError **error)
|
||||
{
|
||||
return fe_apply_gtk3_theme_with_reload (theme_name, FALSE, error);
|
||||
}
|
||||
|
||||
|
||||
|
||||
static void
|
||||
fe_set_gtk_prefer_dark_theme (gboolean dark)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user