Fixed a bug introduced in my last commit which caused to make the button

2007-07-26  Denis Washington <denisw@svn.gnome.org>

	* data/appearance.glade:
	Fixed a bug introduced in my last commit which caused to make the
	button box appear above the cursors list in the theme details window.

	* appearance-style.c: (cursor_theme_sort_func), (prepare_list):
	Make "Default Pointer" always appear as first item in the list.

svn path=/trunk/; revision=7891
This commit is contained in:
Denis Washington 2007-07-26 17:10:12 +00:00 committed by Denis Washington
parent 78b4743519
commit e7c179fa94
3 changed files with 42 additions and 2 deletions

View file

@ -1,3 +1,12 @@
2007-07-26 Denis Washington <denisw@svn.gnome.org>
* data/appearance.glade:
Fixed a bug introduced in my last commit which caused to make the
button box appear above the cursors list in the theme details window.
* appearance-style.c: (cursor_theme_sort_func), (prepare_list):
Make "Default Pointer" always appear as first item in the list.
2007-07-26 Denis Washington <denisw@svn.gnome.org>
* data/appearance.glade:

View file

@ -129,6 +129,29 @@ conv_from_widget_cb (GConfPropertyEditor *peditor, const GConfValue *value)
return new_value;
}
static gint
cursor_theme_sort_func (GtkTreeModel *model,
GtkTreeIter *a,
GtkTreeIter *b,
gpointer user_data)
{
const gchar *a_label = NULL;
const gchar *b_label = NULL;
const gchar *default_label;
gtk_tree_model_get (model, a, COL_LABEL, &a_label, -1);
gtk_tree_model_get (model, b, COL_LABEL, &b_label, -1);
default_label = _("Default Pointer");
if (!strcmp (a_label, default_label))
return -1;
else if (!strcmp (b_label, default_label))
return 1;
else
return strcmp (a_label, b_label);
}
static void
update_color_buttons_from_string (const gchar *color_scheme, AppearanceData *data)
{
@ -831,6 +854,11 @@ prepare_list (AppearanceData *data, GtkWidget *list, ThemeType type, GCallback c
gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (sort_model),
COL_LABEL, GTK_SORT_ASCENDING);
if (type == THEME_TYPE_CURSOR)
gtk_tree_sortable_set_sort_func (GTK_TREE_SORTABLE (sort_model), COL_LABEL,
(GtkTreeIterCompareFunc) cursor_theme_sort_func,
NULL, NULL);
gtk_tree_view_set_model (GTK_TREE_VIEW (list), GTK_TREE_MODEL (sort_model));
renderer = gtk_cell_renderer_pixbuf_new ();

View file

@ -2334,6 +2334,9 @@ Text only</property>
</widget>
</child>
</widget>
<packing>
<property name="position">1</property>
</packing>
</child>
<child>
<widget class="GtkHBox" id="cursor_size_hbox">
@ -2416,10 +2419,10 @@ Text only</property>
<property name="position">2</property>
</packing>
</child>
</widget>
</widget>
<packing>
<property name="expand">False</property>
<property name="position">1</property>
<property name="position">2</property>
</packing>
</child>
</widget>