Correct function decleration

2007-01-08  Thomas Wood  <thos@gnome.org>

	* gtkrc-utils.h: Correct function decleration
	* gnome-theme-details.c: (update_color_scheme_tab), (color_select),
	(toggle_color_scheme_key):
	* theme-properties.glade:

	Add custom colour scheme saving UI

svn path=/trunk/; revision=7094
This commit is contained in:
Thomas Wood 2007-01-08 11:23:37 +00:00 committed by Thomas Wood
parent 15acc88cbc
commit e5d3aa030a
4 changed files with 122 additions and 6 deletions

View file

@ -1,3 +1,12 @@
2007-01-08 Thomas Wood <thos@gnome.org>
* gtkrc-utils.h: Correct function decleration
* gnome-theme-details.c: (update_color_scheme_tab), (color_select),
(toggle_color_scheme_key):
* theme-properties.glade:
Add custom colour scheme saving UI
2007-01-07 Thomas Wood <thos@gnome.org>
* Makefile.am:

View file

@ -49,6 +49,7 @@ static void load_theme_names (GtkTreeView *tree_view,
static char *path_to_theme_id (const char *path);
static void update_color_buttons_from_string (gchar *color_scheme);
void toggle_color_scheme_key (GtkWidget *checkbutton, gpointer *data);
static char *
path_to_theme_id (const char *path)
@ -227,11 +228,21 @@ update_color_scheme_tab ()
enable_colors = (fg && bg && base && text && fg_s && bg_s);
gtk_widget_set_sensitive (WID ("enable_custom_colors_checkbutton"), enable_colors);
gtk_widget_set_sensitive (WID ("color_scheme_table"), enable_colors);
if (enable_colors)
{
gboolean enable_color_schemes;
enable_color_schemes = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (WID ("enable_custom_colors_checkbutton")));
gtk_widget_set_sensitive (WID ("color_scheme_table"), enable_color_schemes);
gtk_widget_set_sensitive (WID ("saved_color_schemes_hbox"), enable_color_schemes);
gtk_widget_hide (WID ("color_scheme_message_hbox"));
}
else
{
gtk_widget_show (WID ("color_scheme_message_hbox"));
gtk_widget_set_sensitive (WID ("color_scheme_table"), FALSE);
gtk_widget_set_sensitive (WID ("saved_color_schemes_hbox"), FALSE);
}
g_free (filename);
g_free (theme_name);
@ -537,6 +548,17 @@ color_select (GtkWidget *colorbutton, GladeXML *dialog)
g_object_unref (G_OBJECT (client));
free_all (fg, bg, text, base, selected_fg, selected_bg, new_scheme, NULL);
GtkTreeModel *model;
GtkTreeIter tmp, iter;
model = gtk_combo_box_get_model (GTK_COMBO_BOX (WID ("color_scheme_combobox")));
for (gtk_tree_model_get_iter_first(GTK_TREE_MODEL (model), &tmp);gtk_tree_model_iter_next(model, &tmp);)
{
iter = tmp;
}
gtk_combo_box_set_active_iter (GTK_COMBO_BOX (WID ("color_scheme_combobox")), &iter);
}
void
@ -545,15 +567,14 @@ toggle_color_scheme_key (GtkWidget *checkbutton, gpointer *data)
GConfClient *client = NULL;
gboolean use_custom_colors;
GladeXML *dialog;
GtkWidget *widget;
GtkSettings *settings;
gchar *color_scheme = NULL;
dialog = gnome_theme_manager_get_theme_dialog ();
use_custom_colors = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (checkbutton));
widget = WID ("color_scheme_table");
gtk_widget_set_sensitive (widget, use_custom_colors);
gtk_widget_set_sensitive (WID ("color_scheme_table"), use_custom_colors);
gtk_widget_set_sensitive (WID ("saved_color_schemes_hbox"), use_custom_colors);
if (!use_custom_colors)
{

View file

@ -1,5 +1,5 @@
void gtkrc_get_details (gchar *filename, GSList *engines, GSList *symbolic_colors);
void gtkrc_get_details (gchar *filename, GSList **engines, GSList **symbolic_colors);
gchar * gtkrc_find_named (gchar *name);

View file

@ -1157,6 +1157,7 @@
<child>
<widget class="GtkLabel" id="label70">
<property name="width_request">245</property>
<property name="visible">True</property>
<property name="label" translatable="yes">The current controls theme does not support color schemes</property>
<property name="use_underline">False</property>
@ -1200,12 +1201,97 @@
<property name="draw_indicator">True</property>
</widget>
<packing>
<property name="padding">0</property>
<property name="padding">6</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
<child>
<widget class="GtkHBox" id="hbox34">
<property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">6</property>
<child>
<widget class="GtkLabel" id="label71">
<property name="visible">True</property>
<property name="label" translatable="yes">S_aved schemes:</property>
<property name="use_underline">True</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="ellipsize">PANGO_ELLIPSIZE_NONE</property>
<property name="width_chars">-1</property>
<property name="single_line_mode">False</property>
<property name="angle">0</property>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
<child>
<widget class="GtkComboBox" id="color_scheme_combobox">
<property name="visible">True</property>
<property name="items" translatable="yes">Foo
Custom</property>
<property name="add_tearoffs">False</property>
<property name="focus_on_click">True</property>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">True</property>
<property name="fill">True</property>
</packing>
</child>
<child>
<widget class="GtkButton" id="button1">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="label">gtk-save</property>
<property name="use_stock">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
<child>
<widget class="GtkButton" id="button2">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="label">gtk-delete</property>
<property name="use_stock">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">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="padding">6</property>
<property name="expand">False</property>
<property name="fill">True</property>
</packing>
</child>
<child>
<widget class="GtkTable" id="color_scheme_table">
<property name="border_width">12</property>