summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin Rodriguez <ffdragon@soc.pidgin.im>2008-08-10 02:36:00 +0000
committerJustin Rodriguez <ffdragon@soc.pidgin.im>2008-08-10 02:36:00 +0000
commitdc44bd038106ae1225de37783c4a4578c603fa85 (patch)
tree748638cb8870562b56704577ce330b80a20f6602
parent5111b86866ba12d43f8e10f5fed965e80429fb47 (diff)
downloadpidgin-dc44bd038106ae1225de37783c4a4578c603fa85.tar.gz
fixes initialize icon theme bug by pre-loading the theme
-rw-r--r--libpurple/theme-loader.c2
-rw-r--r--pidgin/gtkblist.c4
-rw-r--r--pidgin/gtkprefs.c5
-rw-r--r--pidgin/pidginstock.c38
4 files changed, 32 insertions, 17 deletions
diff --git a/libpurple/theme-loader.c b/libpurple/theme-loader.c
index 4c8ea3a5ac..f79994a29b 100644
--- a/libpurple/theme-loader.c
+++ b/libpurple/theme-loader.c
@@ -180,7 +180,7 @@ purple_theme_loader_set_type_string(PurpleThemeLoader *loader, const gchar *type
}
gpointer
-purple_theme_loader_build (PurpleThemeLoader *loader, const gchar *dir)
+purple_theme_loader_build(PurpleThemeLoader *loader, const gchar *dir)
{
return PURPLE_THEME_LOADER_GET_CLASS(loader)->purple_theme_loader_build(dir);
}
diff --git a/pidgin/gtkblist.c b/pidgin/gtkblist.c
index ad8068e48c..11225eb09d 100644
--- a/pidgin/gtkblist.c
+++ b/pidgin/gtkblist.c
@@ -50,7 +50,6 @@
#include "gtkdebug.h"
#include "gtkdialogs.h"
#include "gtkft.h"
-#include "gtkicon-theme.h"
#include "gtklog.h"
#include "gtkmenutray.h"
#include "gtkpounce.h"
@@ -5304,7 +5303,6 @@ pidgin_blist_build_layout(PurpleBuddyList *list)
g_signal_connect(G_OBJECT(rend), "editing-canceled", G_CALLBACK(gtk_blist_renderer_editing_cancelled_cb), list);
#endif
g_signal_connect(G_OBJECT(rend), "edited", G_CALLBACK(gtk_blist_renderer_edited_cb), list);
- g_object_set(rend, "ypad", 0, "yalign", 0.5, NULL);
#if GTK_CHECK_VERSION(2,6,0)
g_object_set(rend, "ellipsize", PANGO_ELLIPSIZE_END, NULL);
#endif
@@ -5392,8 +5390,6 @@ static void pidgin_blist_show(PurpleBuddyList *list)
priv->current_theme = PIDGIN_BLIST_THEME(purple_theme_manager_find_theme(purple_prefs_get_string(PIDGIN_PREFS_ROOT "/blist/theme"), "blist"));
- pidgin_stock_load_status_icon_theme(PIDGIN_STATUS_ICON_THEME(purple_theme_manager_find_theme(purple_prefs_get_string(PIDGIN_PREFS_ROOT "/icon/status/theme"), "status-icon")));
-
gtkblist->empty_avatar = gdk_pixbuf_new(GDK_COLORSPACE_RGB, TRUE, 8, 32, 32);
gdk_pixbuf_fill(gtkblist->empty_avatar, 0x00000000);
diff --git a/pidgin/gtkprefs.c b/pidgin/gtkprefs.c
index a6deacc160..24bebae3d5 100644
--- a/pidgin/gtkprefs.c
+++ b/pidgin/gtkprefs.c
@@ -706,6 +706,9 @@ prefs_build_theme_combo_box(GtkListStore *store, const gchar *current_theme)
cell_rend = gtk_cell_renderer_text_new();
gtk_cell_layout_pack_start(GTK_CELL_LAYOUT (combo_box), cell_rend, FALSE);
gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT(combo_box), cell_rend, "markup", 1, NULL);
+/*#if GTK_CHECK_VERSION(2,6,0)
+ g_object_set(cell_rend, "ellipsize", PANGO_ELLIPSIZE_END, NULL);
+#endif*/
if (gtk_tree_model_get_iter_first(GTK_TREE_MODEL(store), &iter)) {
do {
@@ -1189,7 +1192,7 @@ interface_page(void)
g_signal_connect(G_OBJECT(combo_box), "changed", (GCallback)prefs_set_blist_theme_cb, NULL);
/* Status Icon Themes */
- combo_box = prefs_build_theme_combo_box(prefs_status_icon_themes, purple_prefs_get_string(PIDGIN_PREFS_ROOT "/icon/status/theme"));
+ combo_box = prefs_build_theme_combo_box(prefs_status_icon_themes, purple_prefs_get_string(PIDGIN_PREFS_ROOT "/status/icon-theme"));
gtk_box_pack_start(GTK_BOX (vbox), combo_box, FALSE, FALSE, 0);
g_signal_connect(G_OBJECT(combo_box), "changed", (GCallback)prefs_set_status_icon_theme_cb, NULL);
diff --git a/pidgin/pidginstock.c b/pidgin/pidginstock.c
index 831b2d087d..43dc6f47c6 100644
--- a/pidgin/pidginstock.c
+++ b/pidgin/pidginstock.c
@@ -269,7 +269,7 @@ find_icon_file(PidginStatusIconTheme *theme, const gchar *size, SizedStockIcon s
gchar *file_full = NULL;
if (theme != NULL) {
- file = pidgin_icon_theme_get_file(theme, sized_icon.name);
+ file = pidgin_icon_theme_get_file(PIDGIN_ICON_THEME(theme), sized_icon.name);
dir = purple_theme_get_dir(PURPLE_THEME(theme));
if (rtl)
@@ -356,11 +356,16 @@ pidgin_stock_load_status_icon_theme(PidginStatusIconTheme *theme)
GtkIconSet *translucent = NULL;
GtkWidget *win;
- if (theme != NULL)
- purple_prefs_set_string(PIDGIN_PREFS_ROOT "/icon/status/theme",
- purple_theme_get_name(PURPLE_THEME(theme)));
- else purple_prefs_set_string(PIDGIN_PREFS_ROOT "/icon/status/theme", "");
-
+ if (theme != NULL) {
+ purple_prefs_set_string(PIDGIN_PREFS_ROOT "/status/icon-theme",
+ purple_theme_get_name(PURPLE_THEME(theme)));
+ purple_prefs_set_path(PIDGIN_PREFS_ROOT "/status/icon-theme-dir",
+ purple_theme_get_dir(PURPLE_THEME(theme)));
+ }
+ else {
+ purple_prefs_set_string(PIDGIN_PREFS_ROOT "/status/icon-theme", "");
+ purple_prefs_set_path(PIDGIN_PREFS_ROOT "/status/icon-theme-dir", "");
+ }
icon_factory = gtk_icon_factory_new();
@@ -408,16 +413,19 @@ pidgin_stock_init(void)
GtkIconFactory *icon_factory;
size_t i;
GtkWidget *win;
+ PidginIconThemeLoader *loader;
+ const gchar *path = NULL;
if (stock_initted)
return;
stock_initted = TRUE;
- /* Setup the theme */
- purple_theme_manager_register_type(g_object_new(PIDGIN_TYPE_ICON_THEME_LOADER, "type", "status-icon", NULL));
- purple_prefs_add_none(PIDGIN_PREFS_ROOT "/icon/status");
- purple_prefs_add_string(PIDGIN_PREFS_ROOT "/icon/status/theme", "");
+ /* Setup the status icon theme */
+ loader = g_object_new(PIDGIN_TYPE_ICON_THEME_LOADER, "type", "status-icon", NULL);
+ purple_theme_manager_register_type(PURPLE_THEME_LOADER(loader));
+ purple_prefs_add_string(PIDGIN_PREFS_ROOT "/status/icon-theme", "");
+ purple_prefs_add_path(PIDGIN_PREFS_ROOT "/status/icon-theme-dir", "");
/* Setup the icon factory. */
icon_factory = gtk_icon_factory_new();
@@ -497,7 +505,15 @@ pidgin_stock_init(void)
gtk_widget_destroy(win);
g_object_unref(G_OBJECT(icon_factory));
- pidgin_stock_load_status_icon_theme(NULL);
+ /* Pre-load Status icon theme*/
+ if (purple_prefs_get_string(PIDGIN_PREFS_ROOT "/icon/status/theme") &&
+ (path = purple_prefs_get_path(PIDGIN_PREFS_ROOT "/status/icon-theme-dir"))) {
+
+ PidginStatusIconTheme *theme = purple_theme_loader_build(PURPLE_THEME_LOADER(loader), path);
+ pidgin_stock_load_status_icon_theme(theme);
+ g_object_unref(G_OBJECT(theme));
+
+ } else pidgin_stock_load_status_icon_theme(NULL);
/* Register the stock items. */
gtk_stock_add_static(stock_items, G_N_ELEMENTS(stock_items));