when a hidden theme is selected, and therefore becomes visible, create a
2008-08-22 Jens Granseuer <jensgr@gmx.net> * appearance-style.c: (conv_to_widget_cb), (create_thumbnail), (prepare_list): when a hidden theme is selected, and therefore becomes visible, create a thumbnail for it (bug #547301) svn path=/trunk/; revision=8879
This commit is contained in:
parent
a431229943
commit
d9ec606ca0
2 changed files with 38 additions and 0 deletions
|
@ -1,3 +1,9 @@
|
|||
2008-08-22 Jens Granseuer <jensgr@gmx.net>
|
||||
|
||||
* appearance-style.c: (conv_to_widget_cb), (create_thumbnail),
|
||||
(prepare_list): when a hidden theme is selected, and therefore
|
||||
becomes visible, create a thumbnail for it (bug #547301)
|
||||
|
||||
2008-08-14 Jens Granseuer <jensgr@gmx.net>
|
||||
|
||||
* data/appearance.glade: remove help button as long as we don't have
|
||||
|
|
|
@ -34,6 +34,7 @@ typedef void (* ThumbnailGenFunc) (void *type,
|
|||
GDestroyNotify *destroy);
|
||||
|
||||
static void update_message_area (AppearanceData *data);
|
||||
static void create_thumbnail (const gchar *name, GdkPixbuf *default_thumb, AppearanceData *data);
|
||||
|
||||
static const gchar *symbolic_names[NUM_SYMBOLIC_COLORS] = {
|
||||
"fg_color", "bg_color",
|
||||
|
@ -97,6 +98,7 @@ conv_to_widget_cb (GConfPropertyEditor *peditor, const GConfValue *value)
|
|||
GtkListStore *list_store;
|
||||
GtkTreeIter iter, sort_iter;
|
||||
GdkPixbuf *thumbnail;
|
||||
AppearanceData *data = g_object_get_data (G_OBJECT (peditor), "app_data");
|
||||
|
||||
list_store = GTK_LIST_STORE (gtk_tree_model_sort_get_model (GTK_TREE_MODEL_SORT (store)));
|
||||
|
||||
|
@ -110,6 +112,8 @@ conv_to_widget_cb (GConfPropertyEditor *peditor, const GConfValue *value)
|
|||
gtk_tree_model_sort_convert_child_iter_to_iter (GTK_TREE_MODEL_SORT (store),
|
||||
&sort_iter, &iter);
|
||||
path = gtk_tree_model_get_string_from_iter (store, &sort_iter);
|
||||
|
||||
create_thumbnail (curr_value, thumbnail, data);
|
||||
}
|
||||
|
||||
new_value = gconf_value_new (GCONF_VALUE_STRING);
|
||||
|
@ -753,6 +757,33 @@ icon_theme_thumbnail_cb (GdkPixbuf *pixbuf,
|
|||
update_thumbnail_in_treeview ("icon_themes_list", theme_name, pixbuf, data);
|
||||
}
|
||||
|
||||
static void
|
||||
create_thumbnail (const gchar *name, GdkPixbuf *default_thumb, AppearanceData *data)
|
||||
{
|
||||
if (default_thumb == data->icon_theme_icon) {
|
||||
GnomeThemeIconInfo *info;
|
||||
info = gnome_theme_icon_info_find (name);
|
||||
if (info != NULL) {
|
||||
generate_icon_theme_thumbnail_async (info,
|
||||
(ThemeThumbnailFunc) icon_theme_thumbnail_cb, data, NULL);
|
||||
}
|
||||
} else if (default_thumb == data->gtk_theme_icon) {
|
||||
GnomeThemeInfo *info;
|
||||
info = gnome_theme_info_find (name);
|
||||
if (info != NULL && info->has_gtk) {
|
||||
generate_gtk_theme_thumbnail_async (info,
|
||||
(ThemeThumbnailFunc) gtk_theme_thumbnail_cb, data, NULL);
|
||||
}
|
||||
} else if (default_thumb == data->window_theme_icon) {
|
||||
GnomeThemeInfo *info;
|
||||
info = gnome_theme_info_find (name);
|
||||
if (info != NULL && info->has_metacity) {
|
||||
generate_metacity_theme_thumbnail_async (info,
|
||||
(ThemeThumbnailFunc) metacity_theme_thumbnail_cb, data, NULL);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
changed_on_disk_cb (GnomeThemeCommonInfo *theme,
|
||||
GnomeThemeChangeType change_type,
|
||||
|
@ -929,6 +960,7 @@ prepare_list (AppearanceData *data, GtkWidget *list, ThemeType type, GCallback c
|
|||
"conv-from-widget-cb", conv_from_widget_cb,
|
||||
"data", thumbnail,
|
||||
NULL);
|
||||
g_object_set_data (peditor, "app_data", data);
|
||||
g_signal_connect (peditor, "value-changed", callback, data);
|
||||
|
||||
/* init the delete buttons */
|
||||
|
|
Loading…
Add table
Reference in a new issue