Partially support color scheme.
authorHong Jen Yee (PCMan) <pcman.tw@gmail.com>
Wed, 4 Aug 2010 11:23:11 +0000 (19:23 +0800)
committerHong Jen Yee (PCMan) <pcman.tw@gmail.com>
Wed, 4 Aug 2010 11:23:11 +0000 (19:23 +0800)
data/ui/lxappearance.glade
src/color-scheme.c
src/color-scheme.h
src/icon-theme.c
src/lxappearance2.c
src/lxappearance2.h

index 31e36a9..7ca6841 100644 (file)
                 <property name="spacing">6</property>
                 <child>
                   <object class="GtkScrolledWindow" id="scrolledwindow2">
+                    <property name="width_request">150</property>
                     <property name="visible">True</property>
                     <property name="can_focus">True</property>
                     <property name="hscrollbar_policy">automatic</property>
               </packing>
             </child>
             <child>
-              <object class="GtkVBox" id="vbox5">
+              <object class="GtkVBox" id="color_page">
+                <property name="visible">True</property>
+                <property name="border_width">12</property>
+                <property name="spacing">6</property>
                 <child>
-                  <placeholder/>
+                  <object class="GtkTable" id="table1">
+                    <property name="visible">True</property>
+                    <property name="n_rows">5</property>
+                    <property name="n_columns">3</property>
+                    <property name="column_spacing">12</property>
+                    <property name="row_spacing">6</property>
+                    <child>
+                      <object class="GtkLabel" id="label3">
+                        <property name="visible">True</property>
+                        <property name="xalign">0</property>
+                        <property name="label" translatable="yes">Normal windows:</property>
+                      </object>
+                      <packing>
+                        <property name="top_attach">1</property>
+                        <property name="bottom_attach">2</property>
+                        <property name="x_options">GTK_FILL</property>
+                        <property name="y_options">GTK_FILL</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <object class="GtkLabel" id="label8">
+                        <property name="visible">True</property>
+                        <property name="xalign">0</property>
+                        <property name="label" translatable="yes">Text windows:</property>
+                      </object>
+                      <packing>
+                        <property name="top_attach">2</property>
+                        <property name="bottom_attach">3</property>
+                        <property name="x_options">GTK_FILL</property>
+                        <property name="y_options">GTK_FILL</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <object class="GtkLabel" id="label15">
+                        <property name="visible">True</property>
+                        <property name="xalign">0</property>
+                        <property name="label" translatable="yes">Selected items:</property>
+                      </object>
+                      <packing>
+                        <property name="top_attach">3</property>
+                        <property name="bottom_attach">4</property>
+                        <property name="x_options">GTK_FILL</property>
+                        <property name="y_options">GTK_FILL</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <object class="GtkLabel" id="label17">
+                        <property name="visible">True</property>
+                        <property name="xalign">0</property>
+                        <property name="label" translatable="yes">Tooltips:</property>
+                      </object>
+                      <packing>
+                        <property name="top_attach">4</property>
+                        <property name="bottom_attach">5</property>
+                        <property name="x_options">GTK_FILL</property>
+                        <property name="y_options">GTK_FILL</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <object class="GtkLabel" id="label20">
+                        <property name="visible">True</property>
+                        <property name="label" translatable="yes">Background</property>
+                      </object>
+                      <packing>
+                        <property name="left_attach">1</property>
+                        <property name="right_attach">2</property>
+                        <property name="x_options">GTK_FILL</property>
+                        <property name="y_options">GTK_FILL</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <object class="GtkLabel" id="label21">
+                        <property name="visible">True</property>
+                        <property name="label" translatable="yes">Foreground</property>
+                      </object>
+                      <packing>
+                        <property name="left_attach">2</property>
+                        <property name="right_attach">3</property>
+                        <property name="x_options">GTK_FILL</property>
+                        <property name="y_options">GTK_FILL</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <object class="GtkColorButton" id="bg_color">
+                        <property name="visible">True</property>
+                        <property name="can_focus">True</property>
+                        <property name="receives_default">True</property>
+                        <property name="color">#000000000000</property>
+                      </object>
+                      <packing>
+                        <property name="left_attach">1</property>
+                        <property name="right_attach">2</property>
+                        <property name="top_attach">1</property>
+                        <property name="bottom_attach">2</property>
+                        <property name="y_options">GTK_FILL</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <object class="GtkColorButton" id="fg_color">
+                        <property name="visible">True</property>
+                        <property name="can_focus">True</property>
+                        <property name="receives_default">True</property>
+                        <property name="color">#000000000000</property>
+                      </object>
+                      <packing>
+                        <property name="left_attach">2</property>
+                        <property name="right_attach">3</property>
+                        <property name="top_attach">1</property>
+                        <property name="bottom_attach">2</property>
+                        <property name="y_options">GTK_FILL</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <object class="GtkColorButton" id="base_color">
+                        <property name="visible">True</property>
+                        <property name="can_focus">True</property>
+                        <property name="receives_default">True</property>
+                        <property name="color">#000000000000</property>
+                      </object>
+                      <packing>
+                        <property name="left_attach">1</property>
+                        <property name="right_attach">2</property>
+                        <property name="top_attach">2</property>
+                        <property name="bottom_attach">3</property>
+                        <property name="y_options">GTK_FILL</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <object class="GtkColorButton" id="text_color">
+                        <property name="visible">True</property>
+                        <property name="can_focus">True</property>
+                        <property name="receives_default">True</property>
+                        <property name="color">#000000000000</property>
+                      </object>
+                      <packing>
+                        <property name="left_attach">2</property>
+                        <property name="right_attach">3</property>
+                        <property name="top_attach">2</property>
+                        <property name="bottom_attach">3</property>
+                        <property name="y_options">GTK_FILL</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <object class="GtkColorButton" id="selected_bg_color">
+                        <property name="visible">True</property>
+                        <property name="can_focus">True</property>
+                        <property name="receives_default">True</property>
+                        <property name="color">#000000000000</property>
+                      </object>
+                      <packing>
+                        <property name="left_attach">1</property>
+                        <property name="right_attach">2</property>
+                        <property name="top_attach">3</property>
+                        <property name="bottom_attach">4</property>
+                        <property name="y_options">GTK_FILL</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <object class="GtkColorButton" id="selected_fg_color">
+                        <property name="visible">True</property>
+                        <property name="can_focus">True</property>
+                        <property name="receives_default">True</property>
+                        <property name="color">#000000000000</property>
+                      </object>
+                      <packing>
+                        <property name="left_attach">2</property>
+                        <property name="right_attach">3</property>
+                        <property name="top_attach">3</property>
+                        <property name="bottom_attach">4</property>
+                        <property name="y_options">GTK_FILL</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <object class="GtkColorButton" id="tooltip_bg_color">
+                        <property name="visible">True</property>
+                        <property name="can_focus">True</property>
+                        <property name="receives_default">True</property>
+                        <property name="color">#000000000000</property>
+                      </object>
+                      <packing>
+                        <property name="left_attach">1</property>
+                        <property name="right_attach">2</property>
+                        <property name="top_attach">4</property>
+                        <property name="bottom_attach">5</property>
+                        <property name="y_options">GTK_FILL</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <object class="GtkColorButton" id="tooltip_fg_color">
+                        <property name="visible">True</property>
+                        <property name="can_focus">True</property>
+                        <property name="receives_default">True</property>
+                        <property name="color">#000000000000</property>
+                      </object>
+                      <packing>
+                        <property name="left_attach">2</property>
+                        <property name="right_attach">3</property>
+                        <property name="top_attach">4</property>
+                        <property name="bottom_attach">5</property>
+                        <property name="y_options">GTK_FILL</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <placeholder/>
+                    </child>
+                  </object>
+                  <packing>
+                    <property name="expand">False</property>
+                    <property name="position">0</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkHBox" id="hbox9">
+                    <property name="visible">True</property>
+                    <child>
+                      <placeholder/>
+                    </child>
+                    <child>
+                      <object class="GtkButton" id="default_color_scheme">
+                        <property name="label" translatable="yes">Restore default color scheme</property>
+                        <property name="visible">True</property>
+                        <property name="can_focus">True</property>
+                        <property name="receives_default">True</property>
+                      </object>
+                      <packing>
+                        <property name="expand">False</property>
+                        <property name="pack_type">end</property>
+                        <property name="position">1</property>
+                      </packing>
+                    </child>
+                  </object>
+                  <packing>
+                    <property name="expand">False</property>
+                    <property name="position">1</property>
+                  </packing>
                 </child>
               </object>
               <packing>
                     <property name="spacing">6</property>
                     <child>
                       <object class="GtkScrolledWindow" id="scrolledwindow1">
+                        <property name="width_request">150</property>
                         <property name="visible">True</property>
                         <property name="can_focus">True</property>
                         <property name="hscrollbar_policy">automatic</property>
                     <property name="spacing">6</property>
                     <child>
                       <object class="GtkScrolledWindow" id="scrolledwindow4">
+                        <property name="width_request">150</property>
                         <property name="visible">True</property>
                         <property name="can_focus">True</property>
                         <property name="hscrollbar_policy">automatic</property>
                   </packing>
                 </child>
                 <child>
-                  <object class="GtkFrame" id="frame3">
-                    <property name="label_xalign">0</property>
-                    <property name="shadow_type">none</property>
-                    <child>
-                      <object class="GtkAlignment" id="alignment1">
-                        <property name="visible">True</property>
-                        <property name="left_padding">12</property>
-                        <child>
-                          <object class="GtkVBox" id="vbox12">
-                            <property name="visible">True</property>
-                            <property name="spacing">6</property>
-                            <child>
-                              <object class="GtkCheckButton" id="custom_icon_size">
-                                <property name="label" translatable="yes">Use customized icon sizes</property>
-                                <property name="visible">True</property>
-                                <property name="can_focus">True</property>
-                                <property name="receives_default">False</property>
-                                <property name="draw_indicator">True</property>
-                              </object>
-                              <packing>
-                                <property name="position">0</property>
-                              </packing>
-                            </child>
-                            <child>
-                              <object class="GtkTable" id="table1">
-                                <property name="visible">True</property>
-                                <property name="n_rows">6</property>
-                                <property name="n_columns">2</property>
-                                <property name="column_spacing">12</property>
-                                <property name="row_spacing">6</property>
-                                <child>
-                                  <object class="GtkLabel" id="label8">
-                                    <property name="visible">True</property>
-                                    <property name="xalign">0</property>
-                                    <property name="label" translatable="yes">Menu:</property>
-                                  </object>
-                                  <packing>
-                                    <property name="x_options">GTK_FILL</property>
-                                    <property name="y_options">GTK_FILL</property>
-                                  </packing>
-                                </child>
-                                <child>
-                                  <object class="GtkLabel" id="label15">
-                                    <property name="visible">True</property>
-                                    <property name="xalign">0</property>
-                                    <property name="label" translatable="yes">Button:</property>
-                                  </object>
-                                  <packing>
-                                    <property name="top_attach">1</property>
-                                    <property name="bottom_attach">2</property>
-                                    <property name="x_options">GTK_FILL</property>
-                                    <property name="y_options">GTK_FILL</property>
-                                  </packing>
-                                </child>
-                                <child>
-                                  <object class="GtkLabel" id="label17">
-                                    <property name="visible">True</property>
-                                    <property name="xalign">0</property>
-                                    <property name="label" translatable="yes">Dialog:</property>
-                                  </object>
-                                  <packing>
-                                    <property name="top_attach">2</property>
-                                    <property name="bottom_attach">3</property>
-                                    <property name="x_options">GTK_FILL</property>
-                                    <property name="y_options">GTK_FILL</property>
-                                  </packing>
-                                </child>
-                                <child>
-                                  <object class="GtkHBox" id="hbox9">
-                                    <property name="visible">True</property>
-                                    <property name="spacing">6</property>
-                                    <child>
-                                      <object class="GtkSpinButton" id="gtk-menu-size">
-                                        <property name="visible">True</property>
-                                        <property name="can_focus">True</property>
-                                        <property name="invisible_char">&#x25CF;</property>
-                                        <property name="snap_to_ticks">True</property>
-                                        <property name="numeric">True</property>
-                                      </object>
-                                      <packing>
-                                        <property name="expand">False</property>
-                                        <property name="position">0</property>
-                                      </packing>
-                                    </child>
-                                    <child>
-                                      <object class="GtkLabel" id="label23">
-                                        <property name="visible">True</property>
-                                        <property name="label" translatable="yes">x</property>
-                                      </object>
-                                      <packing>
-                                        <property name="expand">False</property>
-                                        <property name="position">1</property>
-                                      </packing>
-                                    </child>
-                                    <child>
-                                      <object class="GtkSpinButton" id="gtk-menu-size1">
-                                        <property name="visible">True</property>
-                                        <property name="can_focus">True</property>
-                                        <property name="invisible_char">&#x25CF;</property>
-                                        <property name="snap_to_ticks">True</property>
-                                        <property name="numeric">True</property>
-                                      </object>
-                                      <packing>
-                                        <property name="expand">False</property>
-                                        <property name="position">2</property>
-                                      </packing>
-                                    </child>
-                                  </object>
-                                  <packing>
-                                    <property name="left_attach">1</property>
-                                    <property name="right_attach">2</property>
-                                    <property name="x_options">GTK_FILL</property>
-                                    <property name="y_options">GTK_FILL</property>
-                                  </packing>
-                                </child>
-                                <child>
-                                  <object class="GtkLabel" id="label20">
-                                    <property name="visible">True</property>
-                                    <property name="xalign">0</property>
-                                    <property name="label" translatable="yes">Small Toolbar:</property>
-                                  </object>
-                                  <packing>
-                                    <property name="top_attach">3</property>
-                                    <property name="bottom_attach">4</property>
-                                    <property name="x_options">GTK_FILL</property>
-                                    <property name="y_options">GTK_FILL</property>
-                                  </packing>
-                                </child>
-                                <child>
-                                  <object class="GtkLabel" id="label21">
-                                    <property name="visible">True</property>
-                                    <property name="xalign">0</property>
-                                    <property name="label" translatable="yes">Large Toolbar:</property>
-                                  </object>
-                                  <packing>
-                                    <property name="top_attach">4</property>
-                                    <property name="bottom_attach">5</property>
-                                    <property name="x_options">GTK_FILL</property>
-                                    <property name="y_options">GTK_FILL</property>
-                                  </packing>
-                                </child>
-                                <child>
-                                  <object class="GtkLabel" id="label22">
-                                    <property name="visible">True</property>
-                                    <property name="xalign">0</property>
-                                    <property name="label" translatable="yes">Drag Icon:</property>
-                                  </object>
-                                  <packing>
-                                    <property name="top_attach">5</property>
-                                    <property name="bottom_attach">6</property>
-                                    <property name="x_options">GTK_FILL</property>
-                                    <property name="y_options">GTK_FILL</property>
-                                  </packing>
-                                </child>
-                                <child>
-                                  <placeholder/>
-                                </child>
-                                <child>
-                                  <placeholder/>
-                                </child>
-                                <child>
-                                  <placeholder/>
-                                </child>
-                                <child>
-                                  <placeholder/>
-                                </child>
-                                <child>
-                                  <placeholder/>
-                                </child>
-                              </object>
-                              <packing>
-                                <property name="position">1</property>
-                              </packing>
-                            </child>
-                          </object>
-                        </child>
-                      </object>
-                    </child>
-                    <child type="label">
-                      <object class="GtkLabel" id="label3">
-                        <property name="visible">True</property>
-                        <property name="label" translatable="yes">&lt;b&gt;Icon Sizes&lt;/b&gt;</property>
-                        <property name="use_markup">True</property>
-                      </object>
-                    </child>
-                  </object>
-                  <packing>
-                    <property name="expand">False</property>
-                    <property name="position">1</property>
-                  </packing>
-                </child>
-                <child>
                   <object class="GtkFrame" id="sound_effect">
                     <property name="label_xalign">0</property>
                     <property name="shadow_type">none</property>
                   <packing>
                     <property name="expand">False</property>
                     <property name="fill">False</property>
-                    <property name="position">2</property>
+                    <property name="position">1</property>
                   </packing>
                 </child>
               </object>
index a1fe404..27ada9e 100644 (file)
 #include "color-scheme.h"
 #include <string.h>
 
-void color_scheme_init()
+/* http://live.gnome.org/GnomeArt/Tutorials/GtkThemes/SymbolicColors/#Default_colors_in_GNOME */
+static const char* gnome_color_names[] = {
+    "fg_color", /* The base for the foreground colors. */
+    "bg_color", /* Color to generate the background colors from. */
+    "base_color", /* The base color. */
+    "text_color", /* The text color in input widgets. */
+    "selected_bg_color", /* Color for the background of selected text. */
+    "selected_fg_color", /* Color of selected text. */
+    "tooltip_bg_color", /* Background color of tooltips. */
+    "tooltip_fg_color", /* Text color for text in tooltips. */
+};
+
+static char* hash_to_color_scheme_str(GHashTable* hash)
+{
+    GHashTableIter it;
+    char* key, *val;
+    GString* ret = g_string_sized_new(100);
+    g_hash_table_iter_init (&it, hash);
+    while(g_hash_table_iter_next(&it, (gpointer*)&key, (gpointer*)&val))
+        g_string_append_printf(ret, "%s:%s\n", key, val);
+    return g_string_free(ret, FALSE);
+}
+
+static void on_color_set(GtkColorButton* btn, const char* color_name)
+{
+    GdkColor clr;
+    char* color_str;
+    gtk_color_button_get_color(btn, &clr);
+    color_str = gdk_color_to_string(&clr);
+
+    g_hash_table_replace(app.color_scheme_hash, g_strdup(color_name), color_str);
+    g_free(app.color_scheme);
+    app.color_scheme = hash_to_color_scheme_str(app.color_scheme_hash);
+
+    g_object_set(gtk_settings_get_default(), "gtk-color-scheme", app.color_scheme, NULL);
+
+    lxappearance_changed();
+}
+
+static void on_reset_color_schemes()
+{
+    /* FIXME: How to correctly do this? */
+
+    /* this resets gtk color schemes to default. */
+    g_free(app.color_scheme);
+    app.color_scheme = NULL;
+
+    g_object_set(gtk_settings_get_default(), "gtk-color-scheme", "", NULL);
+    color_scheme_update();
+
+    lxappearance_changed();
+}
+
+void color_scheme_init(GtkBuilder* b)
 {
+    int i;
+    GtkWidget* btn = GTK_WIDGET(gtk_builder_get_object(b, "default_color_scheme"));
+    g_signal_connect(btn, "clicked", G_CALLBACK(on_reset_color_schemes), NULL);
+    /* FIXME: there is no good way to restore default colors yet. */
+    gtk_widget_hide(btn);
+
+    app.color_page = GTK_WIDGET(gtk_builder_get_object(b, "color_page"));
+
+    app.color_scheme_hash = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, g_free);
+
+    for(i = 0; i < 8; ++i)
+        app.color_btns[i] = GTK_WIDGET(gtk_builder_get_object(b, gnome_color_names[i]));;
+
     color_scheme_update();
+
+    for(i = 0; i < 8; ++i)
+        g_signal_connect(app.color_btns[i], "color-set", G_CALLBACK(on_color_set), gnome_color_names[i]);
 }
 
 static gboolean gtkrc_supports_colors(const char* gtkrc_file, gboolean* support)
 {
     char* content;
     gboolean support_colors = FALSE;
+    g_debug("check: %s", gtkrc_file);
     if(g_file_get_contents(gtkrc_file, &content, NULL, NULL))
     {
         /* FIXME: check included gtkrc files, too. */
@@ -37,8 +107,9 @@ static gboolean gtkrc_supports_colors(const char* gtkrc_file, gboolean* support)
             support_colors = TRUE;
         g_free(content);
     }
+    else
+        return FALSE;
     *support = support_colors;
-
     return TRUE;
 }
 
@@ -64,14 +135,50 @@ void color_scheme_update()
     g_free(app.color_scheme);
     if(supported)
     {
+        char** pairs, **pair;
+        int i;
+
         g_object_get(gtk_settings_get_default(), "gtk-color-scheme", &app.color_scheme, NULL);
         g_debug("color-scheme: %s", app.color_scheme);
-        //gtk_widget_set_sensitive(, TRUE);
+        gtk_widget_set_sensitive(app.color_page, TRUE);
+
+        g_hash_table_remove_all(app.color_scheme_hash);
+
+        /* split color scheme string into key/value pairs */
+        pairs = g_strsplit_set(app.color_scheme, "\n;", -1);
+        for(pair = pairs; *pair; ++pair)
+        {
+            char* name = strtok(*pair, ": \t");
+            if(name)
+            {
+                char* val = strtok(NULL, " \t");
+                if(val)
+                    g_hash_table_replace(app.color_scheme_hash, g_strdup(name), g_strdup(val));
+            }
+        }
+        g_strfreev(pairs);
+
+        /* set the color to buttons */
+        for(i = 0; i < 8; ++i)
+        {
+            GtkWidget* btn = app.color_btns[i];
+            const char* color_str = (const char*)g_hash_table_lookup(app.color_scheme_hash, gnome_color_names[i]);
+            g_debug("%s ='%s'", gnome_color_names[i], color_str);
+            if(color_str)
+            {
+                GdkColor clr;
+                if(gdk_color_parse(color_str, &clr))
+                    gtk_color_button_set_color(GTK_COLOR_BUTTON(btn), &clr);
+                gtk_widget_set_sensitive(btn, TRUE);
+            }
+            else
+                gtk_widget_set_sensitive(btn, FALSE);
+        }
     }
     else
     {
         app.color_scheme = NULL;
-        //gtk_widget_set_sensitive(, FALSE);
+        gtk_widget_set_sensitive(app.color_page, FALSE);
         g_debug("color-scheme is not supported by this theme");
     }
 }
index 81e3701..08b2df0 100644 (file)
@@ -23,7 +23,7 @@
 
 G_BEGIN_DECLS
 
-void color_scheme_init();
+void color_scheme_init(GtkBuilder* b);
 void color_scheme_update();
 
 G_END_DECLS
index 7625d43..f3b9ebd 100644 (file)
@@ -128,20 +128,6 @@ static void load_icon_themes()
     g_key_file_free(kf);
 }
 
-static void icon_sizes_init(GtkBuilder* b)
-{
-    const char* names[] = {
-        "gtk-menu",
-        "gtk-button",
-        "gtk-small-toolbar",
-        "gtk-large-toolbar",
-        "gtk-dnd",
-        "gtk-dialog"
-    };
-    char* sizes_str;
-    g_object_get(gtk_settings_get_default(), "gtk-icon-sizes", &sizes_str, NULL);
-    g_debug("%s", sizes_str);
-}
 
 static void on_icon_theme_sel_changed(GtkTreeSelection* tree_sel, gpointer user_data)
 {
@@ -315,8 +301,4 @@ void icon_theme_init(GtkBuilder* b)
         gtk_tree_model_get(app.cursor_theme_store, &cursor_theme_sel_it, 1, &theme, -1);
         gtk_widget_set_sensitive(app.cursor_theme_remove_btn, theme->is_removable);
     }
-
-    /* load "gtk-icon-sizes" */
-    /* icon_sizes_init(b); */
-
 }
index 42ed5e9..db86013 100644 (file)
@@ -35,6 +35,7 @@
 #include <string.h>
 
 #include "widget-theme.h"
+#include "color-scheme.h"
 #include "icon-theme.h"
 #include "cursor-theme.h"
 #include "other.h"
@@ -200,6 +201,9 @@ static void lxappearance_save_lxsession()
     g_key_file_set_string( kf, "GTK", "sNet/ThemeName", app.widget_theme );
     g_key_file_set_string( kf, "GTK", "sGtk/FontName", app.default_font );
 
+    if(app.color_scheme)
+        g_key_file_set_string( kf, "GTK", "sGtk/ColorScheme", app.color_scheme );
+
     g_key_file_set_string( kf, "GTK", "sNet/IconThemeName", app.icon_theme );
 
     g_key_file_set_string( kf, "GTK", "sGtk/CursorThemeName", app.cursor_theme );
@@ -330,6 +334,7 @@ int main(int argc, char** argv)
     app.dlg = GTK_WIDGET(gtk_builder_get_object(b, "dlg"));
 
     widget_theme_init(b);
+    color_scheme_init(b);
     icon_theme_init(b);
     cursor_theme_init(b);
     other_init(b);
index 2a32a3e..2e26964 100644 (file)
@@ -34,6 +34,10 @@ struct _LXAppearance
     GtkListStore* widget_theme_store;
     GtkWidget* default_font_btn;
 
+    GtkWidget* color_page;
+    GHashTable* color_scheme_hash;
+    GtkWidget* color_btns[8]; /* FIXME: this value might be changed in the future */
+
     GtkWidget* icon_theme_view;
     GtkListStore* icon_theme_store;
     GtkWidget* icon_theme_remove_btn;
@@ -55,7 +59,6 @@ struct _LXAppearance
     char* cursor_theme;
     int cursor_theme_size;
     char* color_scheme;
-    char* icon_sizes;
     int toolbar_style;
     int toolbar_icon_size;