mirror of
https://github.com/ZoiteChat/zoitechat.git
synced 2026-03-14 09:40:20 +00:00
Added a GTK3 theme directory resolver that supports versioned theme folders (gtk-3.x) and selects the best match for the running GTK minor version, instead of assuming only gtk-3.0. This improves compatibility with real-world GTK3 themes that split selectors/styles by GTK minor versions.
Updated theme application to load CSS/resources from the resolved gtk-3.x folder and updated the error path/message when a valid gtk-3.x/gtk.css layout is missing. Exposed the resolver in the GTK frontend header so other GTK UI code can validate theme layouts consistently. Updated the Preferences GTK3 theme picker to validate themes via the resolver (so themes with e.g. gtk-3.24/gtk.css now appear as valid). Updated archive import validation to recognize gtk-3.x directories (not just gtk-3.0) and adjusted user-facing validation messages accordingly.
This commit is contained in:
@@ -1928,13 +1928,12 @@ setup_gtk3_theme_populate (setup_theme_ui *ui)
|
||||
while ((name = g_dir_read_name (dir)))
|
||||
{
|
||||
char *theme_path;
|
||||
char *gtk_css_path;
|
||||
char *gtk3_dir = NULL;
|
||||
|
||||
theme_path = g_build_filename (themes_dir, name, NULL);
|
||||
gtk_css_path = g_build_filename (theme_path, "gtk-3.0", "gtk.css", NULL);
|
||||
|
||||
if (g_file_test (theme_path, G_FILE_TEST_IS_DIR)
|
||||
&& g_file_test (gtk_css_path, G_FILE_TEST_IS_REGULAR))
|
||||
&& fe_resolve_gtk3_theme_dir (theme_path, >k3_dir, NULL))
|
||||
{
|
||||
gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (ui->gtk3_combo), name);
|
||||
g_ptr_array_add (ui->gtk3_theme_paths, theme_path);
|
||||
@@ -1942,7 +1941,7 @@ setup_gtk3_theme_populate (setup_theme_ui *ui)
|
||||
theme_path = NULL;
|
||||
}
|
||||
|
||||
g_free (gtk_css_path);
|
||||
g_free (gtk3_dir);
|
||||
g_free (theme_path);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user