From 1d0f58a776b0b10dd4603d0e4b060352b9d8ba8c Mon Sep 17 00:00:00 2001 From: Conor Curran Date: Wed, 15 Sep 2010 17:39:15 +0100 Subject: on menu close buttons are now reset --- src/play-button.c | 2 ++ src/transport-widget.c | 45 +++++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 45 insertions(+), 2 deletions(-) diff --git a/src/play-button.c b/src/play-button.c index 2ab5fc8..d27ae61 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 diff --git a/src/transport-widget.c b/src/transport-widget.c index 2dfcbef..329797c 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_val_if_fail(IS_TRANSPORT_WIDGET(transport), FALSE); + 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, -- cgit v1.2.3 From 7ea705e793423d293cca7b5d5e39697c245df7df Mon Sep 17 00:00:00 2001 From: Conor Curran Date: Wed, 15 Sep 2010 17:40:38 +0100 Subject: on menu close buttons are now reset --- src/play-button.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/play-button.c b/src/play-button.c index d27ae61..2e85a6c 100644 --- a/src/play-button.c +++ b/src/play-button.c @@ -370,7 +370,7 @@ play_button_init (PlayButton *self) GINT_TO_POINTER(TRANSPORT_NEXT), next_list); - gtk_widget_set_size_request(GTK_WIDGET(self), 200, 50); + gtk_widget_set_size_request(GTK_WIDGET(self), 100, 50); } -- cgit v1.2.3 From 746d97ef9c7b08acf2cf6a6a7699638a780a2ef1 Mon Sep 17 00:00:00 2001 From: Conor Curran Date: Wed, 15 Sep 2010 18:19:47 +0100 Subject: mistaken checkin reverted --- src/play-button.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/play-button.c b/src/play-button.c index 2e85a6c..5e8a90d 100644 --- a/src/play-button.c +++ b/src/play-button.c @@ -370,7 +370,7 @@ play_button_init (PlayButton *self) GINT_TO_POINTER(TRANSPORT_NEXT), next_list); - gtk_widget_set_size_request(GTK_WIDGET(self), 100, 50); + gtk_widget_set_size_request(GTK_WIDGET(self), 200, 50); } @@ -397,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; -- cgit v1.2.3 From 3282a81299408614457ce01168f23feb7574e368 Mon Sep 17 00:00:00 2001 From: Conor Curran Date: Wed, 15 Sep 2010 19:17:35 +0100 Subject: prep of 0.4.7 --- configure.ac | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index b4a9e91..19000bf 100644 --- a/configure.ac +++ b/configure.ac @@ -1,10 +1,10 @@ -AC_INIT(indicator-sound, 0.4.6, conor.curran@canonical.com) +AC_INIT(indicator-sound, 0.4.7, conor.curran@canonical.com) AC_PREREQ(2.53) AM_CONFIG_HEADER(config.h) -AM_INIT_AUTOMAKE(indicator-sound, 0.4.6) +AM_INIT_AUTOMAKE(indicator-sound, 0.4.7) AM_MAINTAINER_MODE -- cgit v1.2.3