Generate thumbnails for the custom theme.
2003-01-05 Seth Nickell <snickell@stanford.edu> * gnome-theme-manager.c: (add_custom_row_to_meta_theme), (remove_custom_row_from_meta_theme): * theme-thumbnail.c: (theme_thumbnail_invalidate_cache): * theme-thumbnail.h: Generate thumbnails for the custom theme.
This commit is contained in:
parent
a50a9ea95d
commit
fff1f909c8
4 changed files with 40 additions and 8 deletions
|
@ -1,3 +1,12 @@
|
|||
2003-01-05 Seth Nickell <snickell@stanford.edu>
|
||||
|
||||
* gnome-theme-manager.c: (add_custom_row_to_meta_theme),
|
||||
(remove_custom_row_from_meta_theme):
|
||||
* theme-thumbnail.c: (theme_thumbnail_invalidate_cache):
|
||||
* theme-thumbnail.h:
|
||||
|
||||
Generate thumbnails for the custom theme.
|
||||
|
||||
Thu Jan 2 08:57:54 2003 Jonathan Blandford <jrb@gnome.org>
|
||||
|
||||
* gnome-theme-manager.c: correctly merge disk updates and the
|
||||
|
|
|
@ -620,6 +620,7 @@ add_custom_row_to_meta_theme (const gchar *current_gtk_theme,
|
|||
GtkTreeIter iter;
|
||||
gboolean valid;
|
||||
gchar *blurb;
|
||||
GdkPixbuf *pixbuf;
|
||||
|
||||
dialog = gnome_theme_manager_get_theme_dialog ();
|
||||
tree_view = WID ("meta_theme_treeview");
|
||||
|
@ -628,6 +629,7 @@ add_custom_row_to_meta_theme (const gchar *current_gtk_theme,
|
|||
custom_meta_theme_info.gtk_theme_name = g_strdup (current_gtk_theme);
|
||||
custom_meta_theme_info.metacity_theme_name = g_strdup (current_window_theme);
|
||||
custom_meta_theme_info.icon_theme_name = g_strdup (current_icon_theme);
|
||||
custom_meta_theme_info.name = g_strdup (_("Custom Theme\n"));
|
||||
|
||||
for (valid = gtk_tree_model_get_iter_first (model, &iter);
|
||||
valid;
|
||||
|
@ -653,11 +655,20 @@ add_custom_row_to_meta_theme (const gchar *current_gtk_theme,
|
|||
blurb = g_strdup_printf ("<span size=\"larger\" weight=\"bold\">%s</span>\n%s",
|
||||
_("Custom theme"), _("You can save this theme by pressing the Save Theme button."));
|
||||
|
||||
printf ("Thumbnailing\n");
|
||||
|
||||
/* Invalidate the cache because the custom theme has potentially changed */
|
||||
/* Commented out because it does odd things */
|
||||
/*theme_thumbnail_invalidate_cache (&custom_meta_theme_info);*/
|
||||
|
||||
pixbuf = generate_theme_thumbnail (&custom_meta_theme_info);
|
||||
|
||||
gtk_list_store_set (GTK_LIST_STORE (model), &iter,
|
||||
META_THEME_PIXBUF_COLUMN, pixbuf,
|
||||
META_THEME_NAME_COLUMN, blurb,
|
||||
META_THEME_FLAG_COLUMN, THEME_FLAG_CUSTOM,
|
||||
META_THEME_PIXBUF_COLUMN, default_image,
|
||||
-1);
|
||||
|
||||
gtk_widget_set_sensitive (WID ("meta_theme_save_button"), TRUE);
|
||||
path = gtk_tree_model_get_path (model, &iter);
|
||||
gtk_tree_view_set_cursor (GTK_TREE_VIEW (tree_view), path, NULL, FALSE);
|
||||
|
@ -697,12 +708,14 @@ remove_custom_row_from_meta_theme (GtkTreeModel *model)
|
|||
g_free (custom_meta_theme_info.gtk_theme_name);
|
||||
g_free (custom_meta_theme_info.metacity_theme_name);
|
||||
g_free (custom_meta_theme_info.icon_theme_name);
|
||||
g_free (custom_meta_theme_info.name);
|
||||
|
||||
gtk_widget_set_sensitive (WID ("meta_theme_save_button"), FALSE);
|
||||
|
||||
custom_meta_theme_info.gtk_theme_name = NULL;
|
||||
custom_meta_theme_info.metacity_theme_name = NULL;
|
||||
custom_meta_theme_info.icon_theme_name = NULL;
|
||||
custom_meta_theme_info.name = NULL;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -438,6 +438,15 @@ message_from_child (GIOChannel *source,
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
void
|
||||
theme_thumbnail_invalidate_cache (GnomeThemeMetaInfo *meta_theme_info)
|
||||
{
|
||||
gboolean success;
|
||||
|
||||
success = g_hash_table_remove (theme_hash, meta_theme_info->name);
|
||||
printf ("Success is %d\n", success);
|
||||
}
|
||||
|
||||
GdkPixbuf *
|
||||
generate_theme_thumbnail (GnomeThemeMetaInfo *meta_theme_info)
|
||||
{
|
||||
|
|
|
@ -9,13 +9,14 @@ typedef void (* ThemeThumbnailFunc) (GdkPixbuf *pixbuf,
|
|||
gpointer data);
|
||||
|
||||
|
||||
GdkPixbuf *generate_theme_thumbnail (GnomeThemeMetaInfo *meta_theme_info);
|
||||
void generate_theme_thumbnail_async (GnomeThemeMetaInfo *meta_theme_info,
|
||||
ThemeThumbnailFunc func,
|
||||
gpointer data,
|
||||
GDestroyNotify destroy);
|
||||
void theme_thumbnail_factory_init (int argc,
|
||||
char *argv[]);
|
||||
GdkPixbuf *generate_theme_thumbnail (GnomeThemeMetaInfo *meta_theme_info);
|
||||
void generate_theme_thumbnail_async (GnomeThemeMetaInfo *meta_theme_info,
|
||||
ThemeThumbnailFunc func,
|
||||
gpointer data,
|
||||
GDestroyNotify destroy);
|
||||
void theme_thumbnail_invalidate_cache (GnomeThemeMetaInfo *meta_theme_info);
|
||||
void theme_thumbnail_factory_init (int argc,
|
||||
char *argv[]);
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue