aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorConor Curran <conor.curran@canonical.com>2011-08-24 10:22:02 +0100
committerConor Curran <conor.curran@canonical.com>2011-08-24 10:22:02 +0100
commita11951d98dad7f9b65be6c5866c3dd46b3f077e6 (patch)
tree3e724b3dfce49b329d795f63a21991f1da1b8a50
parent90a91a268a34289aed38215dc9c801365a598e3c (diff)
downloadayatana-indicator-session-a11951d98dad7f9b65be6c5866c3dd46b3f077e6.tar.gz
ayatana-indicator-session-a11951d98dad7f9b65be6c5866c3dd46b3f077e6.tar.bz2
ayatana-indicator-session-a11951d98dad7f9b65be6c5866c3dd46b3f077e6.zip
gtk2 user widget drawing fixed
-rw-r--r--src/user-widget.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/user-widget.c b/src/user-widget.c
index a3ad1e4..1530967 100644
--- a/src/user-widget.c
+++ b/src/user-widget.c
@@ -90,6 +90,10 @@ static gboolean user_widget_draw_usericon_gtk_3 (GtkWidget *widget,
static gboolean user_widget_primitive_draw_cb (GtkWidget *image,
GdkEventExpose *event,
gpointer user_data);
+static gboolean user_widget_draw_usericon_gtk_2 (GtkWidget *widget,
+ GdkEventExpose *event,
+ gpointer user_data);
+
#endif
G_DEFINE_TYPE (UserWidget, user_widget, GTK_TYPE_MENU_ITEM);
@@ -174,6 +178,9 @@ user_widget_init (UserWidget *self)
g_signal_connect_after (GTK_WIDGET(self), "expose-event",
G_CALLBACK(user_widget_primitive_draw_cb),
GTK_WIDGET(self));
+ g_signal_connect_after (GTK_WIDGET(priv->user_image), "expose-event",
+ G_CALLBACK(user_widget_draw_usericon_gtk_2),
+ GTK_WIDGET(self));
#endif
}
@@ -252,6 +259,23 @@ user_widget_draw_usericon_gtk_3 (GtkWidget *widget,
*/
// GTK 2 Expose handler
#else
+
+static gboolean
+user_widget_draw_usericon_gtk_2 (GtkWidget *widget,
+ GdkEventExpose *event,
+ gpointer user_data)
+{
+ g_return_val_if_fail(IS_USER_WIDGET(user_data), FALSE);
+ UserWidget* meta = USER_WIDGET(user_data);
+ UserWidgetPrivate * priv = USER_WIDGET_GET_PRIVATE(meta);
+
+ if (priv->using_personal_icon == FALSE)
+ return FALSE;
+
+ draw_album_border (widget, FALSE);
+ return FALSE;
+}
+
static gboolean
user_widget_primitive_draw_cb (GtkWidget *widget,
GdkEventExpose *event,
@@ -273,6 +297,8 @@ user_widget_primitive_draw_cb (GtkWidget *widget,
gdouble x, y;
style = gtk_widget_get_style (widget);
+
+ GtkAllocation allocation;
gtk_widget_get_allocation (widget, &allocation);
x = allocation.x + 13;