r3226 - in trunk/src/target/OM-2007.2/libraries/libmokopanelui2: . libmokopanelui
mickey at sita.openmoko.org
mickey at sita.openmoko.org
Fri Oct 19 13:35:27 CEST 2007
Author: mickey
Date: 2007-10-19 13:35:23 +0200 (Fri, 19 Oct 2007)
New Revision: 3226
Modified:
trunk/src/target/OM-2007.2/libraries/libmokopanelui2/ChangeLog
trunk/src/target/OM-2007.2/libraries/libmokopanelui2/libmokopanelui/moko-panel-applet.c
Log:
libmokopanelui2: try to workaround scaling image bug
Modified: trunk/src/target/OM-2007.2/libraries/libmokopanelui2/ChangeLog
===================================================================
--- trunk/src/target/OM-2007.2/libraries/libmokopanelui2/ChangeLog 2007-10-18 16:35:48 UTC (rev 3225)
+++ trunk/src/target/OM-2007.2/libraries/libmokopanelui2/ChangeLog 2007-10-19 11:35:23 UTC (rev 3226)
@@ -1,3 +1,11 @@
+2007-10-19 Michael Lauer <mickey at openmoko.org>
+
+ * libmokopanelui/moko-panel-appet.c:
+ Try to workaround size-calculation bug in MBScaledPanelImage by
+ setting the actual icon @ mainloop idle time (and hopefully
+ after the enclosing widget has already been realized and we have
+ a valid size)
+
2007-07-28 Michael Lauer <mickey at openmoko.org>
* AUTHORS:
Modified: trunk/src/target/OM-2007.2/libraries/libmokopanelui2/libmokopanelui/moko-panel-applet.c
===================================================================
--- trunk/src/target/OM-2007.2/libraries/libmokopanelui2/libmokopanelui/moko-panel-applet.c 2007-10-18 16:35:48 UTC (rev 3225)
+++ trunk/src/target/OM-2007.2/libraries/libmokopanelui2/libmokopanelui/moko-panel-applet.c 2007-10-19 11:35:23 UTC (rev 3226)
@@ -40,6 +40,7 @@
{
gboolean is_initialized;
gboolean hold_timeout_triggered;
+ const char* filename_for_icon;
} MokoPanelAppletPrivate;
enum {
@@ -196,11 +197,24 @@
moko_panel_applet_open_popup( self, MOKO_PANEL_APPLET_TAP_HOLD_POPUP );
}
+gboolean moko_panel_applet_iconadd_cb(MokoPanelApplet* self)
+{
+ MokoPanelAppletPrivate* priv = MOKO_PANEL_APPLET_GET_PRIVATE( self );
+
+ if ( priv->filename_for_icon )
+ {
+ mb_panel_scaling_image_set_icon( MB_PANEL_SCALING_IMAGE(self->icon), priv->filename_for_icon );
+ priv->filename_for_icon = 0;
+ }
+ return FALSE;
+}
+
////////////////
// PUBLIC API //
////////////////
void moko_panel_applet_set_icon(MokoPanelApplet* self, const gchar* filename)
{
+ MokoPanelAppletPrivate* priv = MOKO_PANEL_APPLET_GET_PRIVATE( self );
if ( !self->icon )
{
self->icon = mb_panel_scaling_image_new( GTK_ORIENTATION_HORIZONTAL, NULL );
@@ -209,7 +223,8 @@
gtk_event_box_set_visible_window( GTK_EVENT_BOX(self->eventbox), FALSE );
gtk_widget_show_all( self->eventbox );
}
- mb_panel_scaling_image_set_icon( MB_PANEL_SCALING_IMAGE(self->icon), filename );
+ priv->filename_for_icon = filename;
+ g_idle_add( G_CALLBACK(moko_panel_applet_iconadd_cb), self );
}
void moko_panel_applet_set_pixbuf(MokoPanelApplet* self, GdkPixbuf* pixbuf)
More information about the commitlog
mailing list