diff options
author | Ken VanDine <ken.vandine@canonical.com> | 2010-09-15 18:02:12 -0400 |
---|---|---|
committer | Ken VanDine <ken.vandine@canonical.com> | 2010-09-15 18:02:12 -0400 |
commit | 7695b78d05fd79ad7581d82b1f5ad171529e19e0 (patch) | |
tree | 5a3f94f07d4d70e889b15421fd4ce5626ff5766f /src | |
parent | 9c0a0730c61f4e3b515f95a55d0db93e0d3ae21f (diff) | |
parent | 3282a81299408614457ce01168f23feb7574e368 (diff) | |
download | ayatana-indicator-sound-7695b78d05fd79ad7581d82b1f5ad171529e19e0.tar.gz ayatana-indicator-sound-7695b78d05fd79ad7581d82b1f5ad171529e19e0.tar.bz2 ayatana-indicator-sound-7695b78d05fd79ad7581d82b1f5ad171529e19e0.zip |
Import upstream version 0.4.7
Diffstat (limited to 'src')
-rw-r--r-- | src/play-button.c | 3 | ||||
-rw-r--r-- | src/transport-widget.c | 45 |
2 files changed, 46 insertions, 2 deletions
diff --git a/src/play-button.c b/src/play-button.c index 2ab5fc8..5e8a90d 100644 --- a/src/play-button.c +++ b/src/play-button.c @@ -99,6 +99,7 @@ static void play_button_dispose (GObject *object); static void play_button_finalize (GObject *object); static gboolean play_button_expose (GtkWidget *button, GdkEventExpose *event); + static void draw (GtkWidget* button, cairo_t *cr); G_DEFINE_TYPE (PlayButton, play_button, GTK_TYPE_DRAWING_AREA); @@ -370,6 +371,7 @@ play_button_init (PlayButton *self) next_list); gtk_widget_set_size_request(GTK_WIDGET(self), 200, 50); + } static void @@ -395,6 +397,7 @@ play_button_expose (GtkWidget *button, GdkEventExpose *event) event->area.width, event->area.height); cairo_clip(cr); + draw (button, cr); cairo_destroy (cr); return FALSE; diff --git a/src/transport-widget.c b/src/transport-widget.c index 2dfcbef..eba2099 100644 --- a/src/transport-widget.c +++ b/src/transport-widget.c @@ -54,10 +54,15 @@ static gboolean transport_widget_button_press_event (GtkWidget *menuitem, GdkEventButton *event); static gboolean transport_widget_button_release_event (GtkWidget *menuitem, GdkEventButton *event); -static void transport_widget_property_update(DbusmenuMenuitem* item, +static void transport_widget_property_update( DbusmenuMenuitem* item, gchar * property, GValue * value, - gpointer userdata); + gpointer userdata ); +static void transport_widget_menu_hidden ( GtkWidget *menu, + TransportWidget *transport); +static void transport_widget_notify ( TransportWidget *item, + GParamSpec *pspec, + gpointer user_data ); G_DEFINE_TYPE (TransportWidget, transport_widget, GTK_TYPE_MENU_ITEM); @@ -100,6 +105,11 @@ transport_widget_init (TransportWidget *self) gtk_container_add (GTK_CONTAINER (self), priv->hbox); gtk_widget_show_all (priv->hbox); + + g_signal_connect (G_OBJECT(self), + "notify", + G_CALLBACK (transport_widget_notify), + NULL); } static void @@ -129,6 +139,37 @@ static void transport_widget_set_twin_item(TransportWidget* self, G_CALLBACK(transport_widget_property_update), self); } +static void +transport_widget_notify (TransportWidget *item, + GParamSpec *pspec, + gpointer user_data) +{ + + if (g_strcmp0 (pspec->name, "parent")) + { + GtkWidget *parent = gtk_widget_get_parent (GTK_WIDGET (item)); + + if (parent) + { + g_signal_connect (parent, "hide", + G_CALLBACK (transport_widget_menu_hidden), + item); + } + } +} + +static void +transport_widget_menu_hidden ( GtkWidget *menu, + TransportWidget *transport) +{ + g_debug("Transport Widget's menu hidden method called"); + g_return_if_fail(IS_TRANSPORT_WIDGET(transport)); + TransportWidgetPrivate * priv = TRANSPORT_WIDGET_GET_PRIVATE(TRANSPORT_WIDGET(transport)); + play_button_react_to_button_release(priv->play_button, TRANSPORT_NADA); + +} + + /* keyevents */ static gboolean transport_widget_button_press_event (GtkWidget *menuitem, |