pidgin.next.minor: d47e94f9: Use GtkStatusIcon on GTK+ 2.10+. That's ...
qulogic at pidgin.im
qulogic at pidgin.im
Sun Nov 8 03:31:39 EST 2009
-----------------------------------------------------------------
Revision: d47e94f98ed0b6e0a095e1f7c55cffb5a862316b
Ancestor: a6e2fc8f1a6b687a255d0b468046454b5164d94b
Author: qulogic at pidgin.im
Date: 2009-11-08T08:23:21
Branch: im.pidgin.pidgin.next.minor
URL: http://d.pidgin.im/viewmtn/revision/info/d47e94f98ed0b6e0a095e1f7c55cffb5a862316b
Modified files:
ChangeLog pidgin/Makefile.am pidgin/gtkdocklet-x11.c
pidgin/gtkdocklet.h pidgin/pidginstock.c
pidgin/pidginstock.h
ChangeLog:
Use GtkStatusIcon on GTK+ 2.10+. That's actually the required version for
next minor, but I'm leaving in the rest of the code until all the kinks are
worked out.
I still need to figure out how to properly move the icons so that they
scale nicely. The code is done, just the files need proper placement.
References #2629.
-------------- next part --------------
============================================================
--- ChangeLog 63fce73c13764c24d8c2987b1705eeef7a1c2cb6
+++ ChangeLog f0f94792a87716d3ac887d82c7c3a97e03c20608
@@ -12,6 +12,8 @@ version 2.7.0 (??/??/????):
box to a "Developer Information" dialog accessible on the Help menu.
* Moved the Translator information from the About box to a "Translator
Information" dialog accessible on the Help menu.
+ * Use GtkStatusIcon for the docklet, providing better integration in
+ notification area.
version 2.6.4 (??/??/20??):
libpurple:
============================================================
--- pidgin/Makefile.am b75b10086bc0b4bb08a6a120be0c1b2c12ebfd4e
+++ pidgin/Makefile.am c8d5e3a961fafb7dfa33f2642fe70bc1e0305efc
@@ -87,6 +87,7 @@ pidgin_SOURCES = \
gtkdialogs.c \
gtkdnd-hints.c \
gtkdocklet.c \
+ gtkdocklet-gtk.c \
gtkdocklet-x11.c \
gtkeventloop.c \
gtkft.c \
============================================================
--- pidgin/gtkdocklet-x11.c 5bc5a9b08a44a9fa85818233cd383264ac96109a
+++ pidgin/gtkdocklet-x11.c 5afb93cfca02d22eb57e93dcf11ad1190157553d
@@ -34,6 +34,8 @@
#include "gtkdocklet.h"
#include <gdk/gdkkeysyms.h>
+#if !GTK_CHECK_VERSION(2,10,0)
+
#define SHORT_EMBED_TIMEOUT 5000
#define LONG_EMBED_TIMEOUT 15000
@@ -352,3 +354,6 @@ docklet_ui_init()
purple_prefs_add_none(PIDGIN_PREFS_ROOT "/docklet/x11");
purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/docklet/x11/embedded", FALSE);
}
+
+#endif /* !GTK_CHECK_VERSION(2,10,0) */
+
============================================================
--- pidgin/gtkdocklet.h ab60eb18264813e2890efe5deb5819497d35fc57
+++ pidgin/gtkdocklet.h 16acb1dd32c2646895f80d34f177dca23aa5e72c
@@ -49,7 +49,7 @@ void*pidgin_docklet_get_handle(void);
void pidgin_docklet_uninit(void);
void*pidgin_docklet_get_handle(void);
-/* function in gtkdocklet-{x11,win32}.c */
+/* function in gtkdocklet-{gtk,x11,win32}.c */
void docklet_ui_init(void);
#endif /* _GTKDOCKLET_H_ */
============================================================
--- pidgin/pidginstock.c a4e3828e3e986116489d5fd464987b02a24fe4cc
+++ pidgin/pidginstock.c 5436a74ccd0d7f6d976576d118f671b164d63dd7
@@ -198,8 +198,11 @@ const SizedStockIcon sized_status_icons
{ PIDGIN_STOCK_STATUS_LOGOUT, "status", "log-out.png", TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, NULL },
{ PIDGIN_STOCK_STATUS_OFFLINE, "status", "offline.png", TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, PIDGIN_STOCK_STATUS_OFFLINE_I },
{ PIDGIN_STOCK_STATUS_PERSON, "status", "person.png", TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, NULL },
- { PIDGIN_STOCK_STATUS_MESSAGE, "toolbar", "message-new.png", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL },
+ { PIDGIN_STOCK_STATUS_MESSAGE, "toolbar", "message-new.png", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL }
+};
+const SizedStockIcon sized_tray_icons [] = {
+
{ PIDGIN_STOCK_TRAY_AVAILABLE, "tray", "tray-online.png", FALSE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, NULL },
{ PIDGIN_STOCK_TRAY_INVISIBLE, "tray", "tray-invisible.png", FALSE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, NULL },
{ PIDGIN_STOCK_TRAY_AWAY, "tray", "tray-away.png", FALSE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, NULL },
@@ -332,7 +335,8 @@ add_sized_icon(GtkIconSet *iconset, GtkI
static void
add_sized_icon(GtkIconSet *iconset, GtkIconSize sizeid, PidginIconTheme *theme,
- const char *size, SizedStockIcon sized_icon, gboolean translucent)
+ const char *size, SizedStockIcon sized_icon, gboolean translucent,
+ gboolean size_wildcarded)
{
char *filename;
GtkIconSource *source;
@@ -349,7 +353,7 @@ add_sized_icon(GtkIconSet *iconset, GtkI
gtk_icon_source_set_direction(source, GTK_TEXT_DIR_LTR);
gtk_icon_source_set_direction_wildcarded(source, !sized_icon.rtl);
gtk_icon_source_set_size(source, sizeid);
- gtk_icon_source_set_size_wildcarded(source, FALSE);
+ gtk_icon_source_set_size_wildcarded(source, size_wildcarded);
gtk_icon_source_set_state_wildcarded(source, TRUE);
gtk_icon_set_add_source(iconset, source);
gtk_icon_source_free(source);
@@ -359,7 +363,7 @@ add_sized_icon(GtkIconSet *iconset, GtkI
gtk_icon_source_set_pixbuf(source, pixbuf);
gtk_icon_source_set_direction_wildcarded(source, TRUE);
gtk_icon_source_set_size(source, GTK_ICON_SIZE_MENU);
- gtk_icon_source_set_size_wildcarded(source, FALSE);
+ gtk_icon_source_set_size_wildcarded(source, size_wildcarded);
gtk_icon_source_set_state_wildcarded(source, TRUE);
gtk_icon_set_add_source(iconset, source);
gtk_icon_source_free(source);
@@ -379,7 +383,7 @@ add_sized_icon(GtkIconSet *iconset, GtkI
gtk_icon_source_set_filename(source, filename);
gtk_icon_source_set_direction(source, GTK_TEXT_DIR_RTL);
gtk_icon_source_set_size(source, sizeid);
- gtk_icon_source_set_size_wildcarded(source, FALSE);
+ gtk_icon_source_set_size_wildcarded(source, size_wildcarded);
gtk_icon_source_set_state_wildcarded(source, TRUE);
gtk_icon_set_add_source(iconset, source);
g_free(filename);
@@ -435,9 +439,9 @@ pidgin_stock_load_status_icon_theme(Pidg
#define ADD_SIZED_ICON(name, size) \
if (sized_status_icons[i].name) { \
- add_sized_icon(normal, name, PIDGIN_ICON_THEME(theme), size, sized_status_icons[i], FALSE); \
+ add_sized_icon(normal, name, PIDGIN_ICON_THEME(theme), size, sized_status_icons[i], FALSE, FALSE); \
if (sized_status_icons[i].translucent_name) \
- add_sized_icon(translucent, name, PIDGIN_ICON_THEME(theme), size, sized_status_icons[i], TRUE); \
+ add_sized_icon(translucent, name, PIDGIN_ICON_THEME(theme), size, sized_status_icons[i], TRUE, FALSE); \
}
ADD_SIZED_ICON(microscopic, "11");
ADD_SIZED_ICON(extra_small, "16");
@@ -456,6 +460,35 @@ pidgin_stock_load_status_icon_theme(Pidg
}
}
+ for (i = 0; i < G_N_ELEMENTS(sized_tray_icons); i++)
+ {
+ normal = gtk_icon_set_new();
+ if (sized_tray_icons[i].translucent_name)
+ translucent = gtk_icon_set_new();
+
+#define ADD_SIZED_ICON(name, size) \
+ if (sized_tray_icons[i].name) { \
+ add_sized_icon(normal, name, PIDGIN_ICON_THEME(theme), size, sized_tray_icons[i], FALSE, TRUE); \
+ if (sized_tray_icons[i].translucent_name) \
+ add_sized_icon(translucent, name, PIDGIN_ICON_THEME(theme), size, sized_tray_icons[i], TRUE, TRUE); \
+ }
+ ADD_SIZED_ICON(microscopic, "11");
+ ADD_SIZED_ICON(extra_small, "16");
+ ADD_SIZED_ICON(small, "22");
+ ADD_SIZED_ICON(medium, "32");
+ ADD_SIZED_ICON(large, "48");
+ ADD_SIZED_ICON(huge, "64");
+#undef ADD_SIZED_ICON
+
+ gtk_icon_factory_add(icon_factory, sized_tray_icons[i].name, normal);
+ gtk_icon_set_unref(normal);
+
+ if (sized_tray_icons[i].translucent_name) {
+ gtk_icon_factory_add(icon_factory, sized_tray_icons[i].translucent_name, translucent);
+ gtk_icon_set_unref(translucent);
+ }
+ }
+
gtk_widget_destroy(win);
g_object_unref(G_OBJECT(icon_factory));
reload_settings();
@@ -527,7 +560,7 @@ pidgin_stock_load_stock_icon_theme(Pidgi
#define ADD_SIZED_ICON(name, size) \
if (sized_stock_icons[i].name) \
- add_sized_icon(iconset, name, PIDGIN_ICON_THEME(theme), size, sized_stock_icons[i], FALSE);
+ add_sized_icon(iconset, name, PIDGIN_ICON_THEME(theme), size, sized_stock_icons[i], FALSE, FALSE);
ADD_SIZED_ICON(microscopic, "11");
ADD_SIZED_ICON(extra_small, "16");
ADD_SIZED_ICON(small, "22");
============================================================
--- pidgin/pidginstock.h 34bd25eaf602d488c0298e2d13a6f39842f3e3f4
+++ pidgin/pidginstock.h 1c8674bfee8eb0e0e82005a8271b654c359a4a43
@@ -161,7 +161,7 @@
#endif
/* Tray icons */
-#define PIDGIN_STOCK_TRAY_AVAILABLE "pidgin-tray-available"
+#define PIDGIN_STOCK_TRAY_AVAILABLE "pidgin-tray-online"
#define PIDGIN_STOCK_TRAY_INVISIBLE "pidgin-tray-invisible"
#define PIDGIN_STOCK_TRAY_AWAY "pidgin-tray-away"
#define PIDGIN_STOCK_TRAY_BUSY "pidgin-tray-busy"
More information about the Commits
mailing list