mirror of
https://github.com/ZoiteChat/zoitechat.git
synced 2026-03-18 19:50:18 +00:00
-Added the standard type attribute to the GTK file info query so file type checks no longer trigger GLib-GIO warnings.
-Replaced GtkStyle application in the channel tree view with explicit base/text/font modifications to avoid style attach/detach issues on teardown. -Updated user list styling to apply the font directly instead of setting a shared GtkStyle instance. -Switched color button updates to use background modifications instead of creating per-button styles, reducing detach warnings on shutdown.
This commit is contained in:
@@ -117,7 +117,11 @@ cv_tree_init (chanview *cv)
|
|||||||
view = gtk_tree_view_new_with_model (GTK_TREE_MODEL (cv->store));
|
view = gtk_tree_view_new_with_model (GTK_TREE_MODEL (cv->store));
|
||||||
gtk_widget_set_name (view, "zoitechat-tree");
|
gtk_widget_set_name (view, "zoitechat-tree");
|
||||||
if (cv->style)
|
if (cv->style)
|
||||||
gtk_widget_set_style (view, cv->style);
|
{
|
||||||
|
gtk_widget_modify_base (view, GTK_STATE_NORMAL, &cv->style->base[GTK_STATE_NORMAL]);
|
||||||
|
gtk_widget_modify_text (view, GTK_STATE_NORMAL, &cv->style->text[GTK_STATE_NORMAL]);
|
||||||
|
gtk_widget_modify_font (view, cv->style->font_desc);
|
||||||
|
}
|
||||||
/*gtk_widget_modify_base (view, GTK_STATE_NORMAL, &colors[COL_BG]);*/
|
/*gtk_widget_modify_base (view, GTK_STATE_NORMAL, &colors[COL_BG]);*/
|
||||||
gtk_widget_set_can_focus (view, FALSE);
|
gtk_widget_set_can_focus (view, FALSE);
|
||||||
gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (view), FALSE);
|
gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (view), FALSE);
|
||||||
|
|||||||
@@ -95,7 +95,7 @@ gtkutil_check_file (char *filename, struct file_req *freq)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
GFileInfo *fi = g_file_query_info (file, G_FILE_ATTRIBUTE_ACCESS_CAN_WRITE, G_FILE_QUERY_INFO_NONE, NULL, NULL);
|
GFileInfo *fi = g_file_query_info (file, G_FILE_ATTRIBUTE_ACCESS_CAN_WRITE "," G_FILE_ATTRIBUTE_STANDARD_TYPE, G_FILE_QUERY_INFO_NONE, NULL, NULL);
|
||||||
|
|
||||||
if (fi != NULL)
|
if (fi != NULL)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -2587,7 +2587,7 @@ mg_create_userlist (session_gui *gui, GtkWidget *box)
|
|||||||
|
|
||||||
if (prefs.hex_gui_ulist_style)
|
if (prefs.hex_gui_ulist_style)
|
||||||
{
|
{
|
||||||
gtk_widget_set_style (ulist, input_style);
|
gtk_widget_modify_font (ulist, input_style->font_desc);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@@ -1454,8 +1454,6 @@ setup_color_ok_cb (GtkWidget *button, GtkWidget *dialog)
|
|||||||
GtkColorSelectionDialog *cdialog = GTK_COLOR_SELECTION_DIALOG (dialog);
|
GtkColorSelectionDialog *cdialog = GTK_COLOR_SELECTION_DIALOG (dialog);
|
||||||
GdkColor *col;
|
GdkColor *col;
|
||||||
GdkColor old_color;
|
GdkColor old_color;
|
||||||
GtkStyle *style;
|
|
||||||
|
|
||||||
col = g_object_get_data (G_OBJECT (button), "c");
|
col = g_object_get_data (G_OBJECT (button), "c");
|
||||||
old_color = *col;
|
old_color = *col;
|
||||||
|
|
||||||
@@ -1473,10 +1471,7 @@ setup_color_ok_cb (GtkWidget *button, GtkWidget *dialog)
|
|||||||
|
|
||||||
gdk_colormap_alloc_color (gtk_widget_get_colormap (button), col, TRUE, TRUE);
|
gdk_colormap_alloc_color (gtk_widget_get_colormap (button), col, TRUE, TRUE);
|
||||||
|
|
||||||
style = gtk_style_new ();
|
gtk_widget_modify_bg (button, GTK_STATE_NORMAL, col);
|
||||||
style->bg[0] = *col;
|
|
||||||
gtk_widget_set_style (button, style);
|
|
||||||
g_object_unref (style);
|
|
||||||
|
|
||||||
/* is this line correct?? */
|
/* is this line correct?? */
|
||||||
gdk_colormap_free_colors (gtk_widget_get_colormap (button), &old_color, 1);
|
gdk_colormap_free_colors (gtk_widget_get_colormap (button), &old_color, 1);
|
||||||
@@ -1528,7 +1523,6 @@ static void
|
|||||||
setup_create_color_button (GtkWidget *table, int num, int row, int col)
|
setup_create_color_button (GtkWidget *table, int num, int row, int col)
|
||||||
{
|
{
|
||||||
GtkWidget *but;
|
GtkWidget *but;
|
||||||
GtkStyle *style;
|
|
||||||
char buf[64];
|
char buf[64];
|
||||||
|
|
||||||
if (num > 31)
|
if (num > 31)
|
||||||
@@ -1544,10 +1538,7 @@ setup_create_color_button (GtkWidget *table, int num, int row, int col)
|
|||||||
GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 0);
|
GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 0);
|
||||||
g_signal_connect (G_OBJECT (but), "clicked",
|
g_signal_connect (G_OBJECT (but), "clicked",
|
||||||
G_CALLBACK (setup_color_cb), GINT_TO_POINTER (num));
|
G_CALLBACK (setup_color_cb), GINT_TO_POINTER (num));
|
||||||
style = gtk_style_new ();
|
gtk_widget_modify_bg (but, GTK_STATE_NORMAL, &colors[num]);
|
||||||
style->bg[GTK_STATE_NORMAL] = colors[num];
|
|
||||||
gtk_widget_set_style (but, style);
|
|
||||||
g_object_unref (style);
|
|
||||||
|
|
||||||
/* Track all color selector widgets (used for dark mode UI behavior). */
|
/* Track all color selector widgets (used for dark mode UI behavior). */
|
||||||
color_selector_widgets = g_slist_prepend (color_selector_widgets, but);
|
color_selector_widgets = g_slist_prepend (color_selector_widgets, but);
|
||||||
@@ -2372,7 +2363,7 @@ setup_apply_to_sess (session_gui *gui)
|
|||||||
chanview_apply_theme ((chanview *) gui->chanview);
|
chanview_apply_theme ((chanview *) gui->chanview);
|
||||||
|
|
||||||
if (prefs.hex_gui_ulist_style)
|
if (prefs.hex_gui_ulist_style)
|
||||||
gtk_widget_set_style (gui->user_tree, input_style);
|
gtk_widget_modify_font (gui->user_tree, input_style->font_desc);
|
||||||
|
|
||||||
if (prefs.hex_gui_ulist_style || prefs.hex_gui_dark_mode)
|
if (prefs.hex_gui_ulist_style || prefs.hex_gui_dark_mode)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user