diff options
author | Jonathan Blandford <jrb@gnome.org> | 2002-11-16 05:56:46 +0000 |
---|---|---|
committer | Jonathan Blandford <jrb@src.gnome.org> | 2002-11-16 05:56:46 +0000 |
commit | 9264122f1176192bee7d6c4ea127c5f2dfd06287 (patch) | |
tree | 9fea96ba203b6a618553ea79574e55b3c8626025 | |
parent | b6e4035202b4598e2b6cb7b174d65d3513ce9b08 (diff) | |
download | gnome-control-center-9264122f1176192bee7d6c4ea127c5f2dfd06287.tar.gz |
actually set the theme.
Sat Nov 16 00:55:58 2002 Jonathan Blandford <jrb@gnome.org>
* gnome-theme-manager.c (meta_theme_selection_changed): actually
set the theme.
-rw-r--r-- | capplets/theme-switcher/ChangeLog | 5 | ||||
-rw-r--r-- | capplets/theme-switcher/gnome-theme-manager.c | 86 | ||||
-rw-r--r-- | capplets/theme-switcher/theme-properties.glade | 198 |
3 files changed, 208 insertions, 81 deletions
diff --git a/capplets/theme-switcher/ChangeLog b/capplets/theme-switcher/ChangeLog index 93084bc22..ac2e2771f 100644 --- a/capplets/theme-switcher/ChangeLog +++ b/capplets/theme-switcher/ChangeLog @@ -1,3 +1,8 @@ +Sat Nov 16 00:55:58 2002 Jonathan Blandford <jrb@gnome.org> + + * gnome-theme-manager.c (meta_theme_selection_changed): actually + set the theme. + Thu Nov 14 19:30:02 2002 Jonathan Blandford <jrb@gnome.org> * theme-thumbnail.c (setup_theme_thumbnail_factory): add G_IO_HUP diff --git a/capplets/theme-switcher/gnome-theme-manager.c b/capplets/theme-switcher/gnome-theme-manager.c index 86acdd3ba..9c4c4c4cc 100644 --- a/capplets/theme-switcher/gnome-theme-manager.c +++ b/capplets/theme-switcher/gnome-theme-manager.c @@ -39,6 +39,15 @@ static void read_themes (GladeXML *dialog); enum { + META_THEME_NAME_COLUMN, + META_THEME_ID_COLUMN, + META_PIXBUF_COLUMN, + META_DEFAULT_THEME_COLUMN, + META_xN_COLUMNS +}; + +enum +{ THEME_NAME_COLUMN, THEME_ID_COLUMN, PIXBUF_COLUMN, @@ -118,11 +127,13 @@ load_meta_themes (GtkTreeView *tree_view, gtk_tree_path_free (path); current_theme_found = TRUE; } - blurb = g_strdup_printf ("<span size=\"larger\" weight=\"bold\">%s</span>\n\n%s", meta_theme_info->name, meta_theme_info->comment); + blurb = g_strdup_printf ("<span size=\"larger\" weight=\"bold\">%s</span>\n\n%s", + meta_theme_info->readable_name, meta_theme_info->comment); pixbuf = generate_theme_thumbnail (meta_theme_info); gtk_list_store_set (GTK_LIST_STORE (model), &iter, PIXBUF_COLUMN, pixbuf, THEME_NAME_COLUMN, blurb, + THEME_ID_COLUMN, meta_theme_info->name, DEFAULT_THEME_COLUMN, is_default, -1); g_free (blurb); @@ -151,6 +162,7 @@ load_meta_themes (GtkTreeView *tree_view, gtk_list_store_prepend (GTK_LIST_STORE (model), &iter); gtk_list_store_set (GTK_LIST_STORE (model), &iter, THEME_NAME_COLUMN, current_theme, + THEME_ID_COLUMN, current_theme, DEFAULT_THEME_COLUMN, is_default, -1); @@ -223,6 +235,7 @@ load_theme_names (GtkTreeView *tree_view, } gtk_list_store_set (GTK_LIST_STORE (model), &iter, THEME_NAME_COLUMN, name, + THEME_ID_COLUMN, name, DEFAULT_THEME_COLUMN, is_default, -1); @@ -250,6 +263,7 @@ load_theme_names (GtkTreeView *tree_view, gtk_list_store_prepend (GTK_LIST_STORE (model), &iter); gtk_list_store_set (GTK_LIST_STORE (model), &iter, THEME_NAME_COLUMN, current_theme, + THEME_ID_COLUMN, current_theme, DEFAULT_THEME_COLUMN, is_default, -1); @@ -295,7 +309,7 @@ update_gconf_key_from_selection (GtkTreeSelection *selection, if (gtk_tree_selection_get_selected (selection, &model, &iter)) { gtk_tree_model_get (model, &iter, - THEME_NAME_COLUMN, &new_key, + THEME_ID_COLUMN, &new_key, -1); } else @@ -327,74 +341,30 @@ static void meta_theme_setup_info (GnomeThemeMetaInfo *meta_theme_info, GladeXML *dialog) { - return; + GtkWidget *notebook; + + notebook = WID ("meta_theme_notebook"); + + if (meta_theme_info == NULL) { - gtk_widget_hide (WID ("meta_theme_extras_vbox")); - gtk_widget_hide (WID ("meta_theme_description_label")); - gtk_image_set_from_pixbuf (GTK_IMAGE (WID ("meta_theme_image")), NULL); + gtk_notebook_set_current_page (GTK_NOTEBOOK (notebook), 0); } else { - if (meta_theme_info->icon_file) - { - gtk_image_set_from_file (GTK_IMAGE (WID ("meta_theme_image")), meta_theme_info->icon_file); - } - else - { - gtk_image_set_from_pixbuf (GTK_IMAGE (WID ("meta_theme_image")), NULL); - } - if (meta_theme_info->comment) - { - gchar *real_comment; - - real_comment = g_strconcat ("<span size=\"larger\" weight=\"bold\">", - meta_theme_info->comment, - "</span>", NULL); - gtk_label_set_markup (GTK_LABEL (WID ("meta_theme_description_label")), - real_comment); - g_free (real_comment); - gtk_widget_show (WID ("meta_theme_description_label")); - } - else - { - gtk_widget_hide (WID ("meta_theme_description_label")); - } - if (meta_theme_info->application_font != NULL) { - gtk_widget_show (WID ("meta_theme_extras_vbox")); if (meta_theme_info->background_image != NULL) - { - gtk_label_set_text (GTK_LABEL (WID ("meta_theme_info_label")), - _("This theme suggests a matching font and a background:")); - gtk_widget_show (WID ("meta_theme_background_button")); - gtk_widget_show (WID ("meta_theme_font_button")); - } + gtk_notebook_set_current_page (GTK_NOTEBOOK (notebook), 3); else - { - gtk_label_set_text (GTK_LABEL (WID ("meta_theme_info_label")), - _("This theme suggests a matching font:")); - gtk_widget_hide (WID ("meta_theme_background_button")); - gtk_widget_show (WID ("meta_theme_font_button")); - } + gtk_notebook_set_current_page (GTK_NOTEBOOK (notebook), 1); } else { if (meta_theme_info->background_image != NULL) - { - gtk_widget_show (WID ("meta_theme_extras_vbox")); - gtk_label_set_text (GTK_LABEL (WID ("meta_theme_info_label")), - _("This theme suggests a matching background:")); - gtk_widget_show (WID ("meta_theme_background_button")); - gtk_widget_hide (WID ("meta_theme_font_button")); - } + gtk_notebook_set_current_page (GTK_NOTEBOOK (notebook), 2); else - { - gtk_widget_hide (WID ("meta_theme_extras_vbox")); - gtk_widget_hide (WID ("meta_theme_background_button")); - gtk_widget_hide (WID ("meta_theme_font_button")); - } + gtk_notebook_set_current_page (GTK_NOTEBOOK (notebook), 0); } } } @@ -446,7 +416,7 @@ meta_theme_selection_changed (GtkTreeSelection *selection, if (gtk_tree_selection_get_selected (selection, &model, &iter)) { gtk_tree_model_get (model, &iter, - THEME_NAME_COLUMN, &meta_theme_name, + THEME_ID_COLUMN, &meta_theme_name, -1); } else @@ -486,7 +456,7 @@ window_theme_selection_changed (GtkTreeSelection *selection, if (gtk_tree_selection_get_selected (selection, &model, &iter)) { gtk_tree_model_get (model, &iter, - THEME_NAME_COLUMN, &window_theme_name, + THEME_ID_COLUMN, &window_theme_name, -1); } else diff --git a/capplets/theme-switcher/theme-properties.glade b/capplets/theme-switcher/theme-properties.glade index 217e7a1ad..57096bb49 100644 --- a/capplets/theme-switcher/theme-properties.glade +++ b/capplets/theme-switcher/theme-properties.glade @@ -155,10 +155,10 @@ </child> <child> - <widget class="GtkVBox" id="vbox12"> + <widget class="GtkVBox" id="meta_theme_property_vbox"> <property name="visible">True</property> <property name="homogeneous">False</property> - <property name="spacing">0</property> + <property name="spacing">3</property> <child> <widget class="GtkHSeparator" id="hseparator1"> @@ -173,9 +173,9 @@ <child> <widget class="GtkNotebook" id="meta_theme_notebook"> - <property name="can_focus">True</property> - <property name="show_tabs">True</property> - <property name="show_border">True</property> + <property name="visible">True</property> + <property name="show_tabs">False</property> + <property name="show_border">False</property> <property name="tab_pos">GTK_POS_TOP</property> <property name="scrollable">False</property> <property name="tab_hborder">2</property> @@ -183,9 +183,9 @@ <property name="enable_popup">False</property> <child> - <widget class="GtkLabel" id="label24"> + <widget class="GtkLabel" id="label28"> <property name="visible">True</property> - <property name="label" translatable="yes">label24</property> + <property name="label" translatable="yes"></property> <property name="use_underline">False</property> <property name="use_markup">False</property> <property name="justify">GTK_JUSTIFY_LEFT</property> @@ -203,9 +203,9 @@ </child> <child> - <widget class="GtkLabel" id="label19"> + <widget class="GtkLabel" id="label27"> <property name="visible">True</property> - <property name="label" translatable="yes">label19</property> + <property name="label" translatable="yes">label27</property> <property name="use_underline">False</property> <property name="use_markup">False</property> <property name="justify">GTK_JUSTIFY_LEFT</property> @@ -222,9 +222,60 @@ </child> <child> - <widget class="GtkLabel" id="label23"> + <widget class="GtkVBox" id="vbox12"> <property name="visible">True</property> - <property name="label" translatable="yes">label23</property> + <property name="homogeneous">False</property> + <property name="spacing">3</property> + + <child> + <widget class="GtkLabel" id="label24"> + <property name="visible">True</property> + <property name="label" translatable="yes">This theme suggests a matching font:</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + + <child> + <widget class="GtkCheckButton" id="checkbutton1"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">Use _Font</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="active">False</property> + <property name="inconsistent">False</property> + <property name="draw_indicator">True</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + </widget> + <packing> + <property name="tab_expand">False</property> + <property name="tab_fill">True</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="label19"> + <property name="visible">True</property> + <property name="label" translatable="yes">label19</property> <property name="use_underline">False</property> <property name="use_markup">False</property> <property name="justify">GTK_JUSTIFY_LEFT</property> @@ -236,6 +287,57 @@ <property name="ypad">0</property> </widget> <packing> + <property name="type">tab</property> + </packing> + </child> + + <child> + <widget class="GtkVBox" id="vbox13"> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">3</property> + + <child> + <widget class="GtkLabel" id="label25"> + <property name="visible">True</property> + <property name="label" translatable="yes">This theme suggests a matching +background:</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + + <child> + <widget class="GtkCheckButton" id="checkbutton2"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">Use _background</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="active">False</property> + <property name="inconsistent">False</property> + <property name="draw_indicator">True</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + </widget> + <packing> <property name="tab_expand">False</property> <property name="tab_fill">True</property> </packing> @@ -250,7 +352,7 @@ <property name="justify">GTK_JUSTIFY_LEFT</property> <property name="wrap">False</property> <property name="selectable">False</property> - <property name="xalign">0.5</property> + <property name="xalign">0</property> <property name="yalign">0.5</property> <property name="xpad">0</property> <property name="ypad">0</property> @@ -261,18 +363,68 @@ </child> <child> - <widget class="GtkLabel" id="label22"> + <widget class="GtkVBox" id="vbox14"> <property name="visible">True</property> - <property name="label" translatable="yes">label22</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> + <property name="homogeneous">False</property> + <property name="spacing">3</property> + + <child> + <widget class="GtkLabel" id="label26"> + <property name="visible">True</property> + <property name="label" translatable="yes">This theme suggests a matching +font and background</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + + <child> + <widget class="GtkCheckButton" id="checkbutton3"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">Use _Font </property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="active">False</property> + <property name="inconsistent">False</property> + <property name="draw_indicator">True</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + + <child> + <widget class="GtkCheckButton" id="checkbutton4"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">Use _Background</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="active">False</property> + <property name="inconsistent">False</property> + <property name="draw_indicator">True</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> </widget> <packing> <property name="tab_expand">False</property> |