[Xfce4-commits] r26946 - xfce-mcs-plugins/branches/xfce-plugins-stephan/dialogs/appearance-settings

Stephan Arts stephan at xfce.org
Mon May 12 00:06:19 CEST 2008


Author: stephan
Date: 2008-05-11 22:06:19 +0000 (Sun, 11 May 2008)
New Revision: 26946

Modified:
   xfce-mcs-plugins/branches/xfce-plugins-stephan/dialogs/appearance-settings/main.c
Log:
read xfconf-settings for antialias and hinting support at startup
add antialias toggle button


Modified: xfce-mcs-plugins/branches/xfce-plugins-stephan/dialogs/appearance-settings/main.c
===================================================================
--- xfce-mcs-plugins/branches/xfce-plugins-stephan/dialogs/appearance-settings/main.c	2008-05-11 11:00:47 UTC (rev 26945)
+++ xfce-mcs-plugins/branches/xfce-plugins-stephan/dialogs/appearance-settings/main.c	2008-05-11 22:06:19 UTC (rev 26946)
@@ -65,6 +65,19 @@
 }
 
 void
+cb_antialias_check_button_toggled (GtkToggleButton *toggle, XfconfChannel *channel)
+{
+    if (gtk_toggle_button_get_active(toggle))
+    {
+        xfconf_channel_set_int (channel, "/Xft/Antialias", 1);
+    }
+    else
+    {
+        xfconf_channel_set_int (channel, "/Xft/Antialias", 0);
+    }
+}
+
+void
 cb_hinting_style_combo_changed (GtkComboBox *combo, XfconfChannel *channel)
 {
     switch (gtk_combo_box_get_active(combo))
@@ -84,6 +97,7 @@
     }
 }
 
+
 void
 cb_hinting_check_toggled (GtkToggleButton *toggle, XfconfChannel *channel)
 {
@@ -208,22 +222,38 @@
         {
             case 1:
                 gtk_widget_set_sensitive(hinting_style_combo, TRUE);
+                gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(hinting_check), TRUE);
                 break;
             case 0:
-            default:
                 gtk_widget_set_sensitive(hinting_style_combo, FALSE);
+                gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(hinting_check), FALSE);
+            case -1:
+                gtk_toggle_button_set_inconsistent (GTK_TOGGLE_BUTTON(hinting_check), TRUE);
                 break;
         }
 
     }
+    {
+        gint antialias = xfconf_channel_get_int (xsettings_channel, "/Xft/Antialias", -1);
+        switch (antialias)
+        {
+            case 1:
+                gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(antialias_check_button), TRUE);
+                break;
+            case 0:
+                gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(antialias_check_button), FALSE);
+            case -1:
+                gtk_toggle_button_set_inconsistent (GTK_TOGGLE_BUTTON(antialias_check_button), TRUE);
+                break;
+        }
 
+    }
+
     g_signal_connect (G_OBJECT(toolbar_style_combo), "changed", G_CALLBACK(cb_toolbar_style_combo_changed), xsettings_channel);
     g_signal_connect (G_OBJECT(hinting_style_combo), "changed", G_CALLBACK(cb_hinting_style_combo_changed), xsettings_channel);
-    if (hinting_check)
-    {
-        g_signal_connect (G_OBJECT(hinting_check), "toggled", G_CALLBACK(cb_hinting_check_toggled), xsettings_channel);
-        g_signal_connect (G_OBJECT(hinting_check), "toggled", G_CALLBACK(cb_hinting_check_toggled_ui), hinting_style_combo);
-    }
+    g_signal_connect (G_OBJECT(hinting_check), "toggled", G_CALLBACK(cb_hinting_check_toggled), xsettings_channel);
+    g_signal_connect (G_OBJECT(hinting_check), "toggled", G_CALLBACK(cb_hinting_check_toggled_ui), hinting_style_combo);
+    g_signal_connect (G_OBJECT(antialias_check_button), "toggled", G_CALLBACK(cb_antialias_check_button_toggled), xsettings_channel);
 
 
     GtkWidget *dialog = glade_xml_get_widget (gxml, "appearance-settings-dialog");



More information about the Xfce4-commits mailing list