diff options
author | Conor Curran <conor.curran@canonical.com> | 2010-06-21 11:36:58 +0100 |
---|---|---|
committer | Conor Curran <conor.curran@canonical.com> | 2010-06-21 11:36:58 +0100 |
commit | 1b9837ab2ddfac074149d020e700e9272579b211 (patch) | |
tree | 8f3906ac4bd479ec9c1ee3aede7152a20e20b848 /src/transport-widget.c | |
parent | 9bba58ee4dae536ce92f396854e2c0e671d9b7f0 (diff) | |
download | ayatana-indicator-sound-1b9837ab2ddfac074149d020e700e9272579b211.tar.gz ayatana-indicator-sound-1b9837ab2ddfac074149d020e700e9272579b211.tar.bz2 ayatana-indicator-sound-1b9837ab2ddfac074149d020e700e9272579b211.zip |
lots of changes
Diffstat (limited to 'src/transport-widget.c')
-rw-r--r-- | src/transport-widget.c | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/src/transport-widget.c b/src/transport-widget.c index c53513d..10b96df 100644 --- a/src/transport-widget.c +++ b/src/transport-widget.c @@ -61,7 +61,9 @@ static gboolean transport_widget_button_press_event (GtkWidget *men GdkEventButton *event); static gboolean transport_widget_button_release_event (GtkWidget *menuitem, GdkEventButton *event); - +static void transport_widget_play_clicked (GtkWidget* button, + TransportWidget* self); + static void transport_widget_property_update(DbusmenuMenuitem* item, gchar * property, GValue * value, @@ -78,7 +80,9 @@ transport_widget_class_init (TransportWidgetClass *klass) { GObjectClass *gobject_class = G_OBJECT_CLASS (klass); GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass); + GtkMenuItemClass *menu_item_class = GTK_MENU_ITEM_CLASS(klass); + menu_item_class->hide_on_activate = FALSE; widget_class->button_press_event = transport_widget_button_press_event; widget_class->button_release_event = transport_widget_button_release_event; @@ -143,6 +147,8 @@ transport_widget_init (TransportWidget *self) g_signal_connect(G_OBJECT(twin_item), "property-changed", G_CALLBACK(transport_widget_property_update), self); + g_signal_connect(priv->play_button, "clicked", G_CALLBACK(transport_widget_play_clicked), self); + gtk_container_add (GTK_CONTAINER (self), priv->hbox); gtk_widget_show_all (priv->hbox); @@ -166,8 +172,10 @@ transport_widget_button_press_event (GtkWidget *menuitem, GdkEventButton *event) { g_debug("TransportWidget::menu_press_event"); + TransportWidgetPrivate * priv = TRANSPORT_WIDGET_GET_PRIVATE(TRANSPORT_WIDGET(menuitem)); + gtk_widget_event (priv->hbox, (GdkEvent*)event); gboolean state = g_ascii_strcasecmp(gtk_button_get_label(GTK_BUTTON(priv->play_button)), ">") == 0; gtk_button_set_label(GTK_BUTTON(priv->play_button), transport_widget_toggle_play_label(gtk_button_get_label(GTK_BUTTON(priv->play_button)))); @@ -181,11 +189,21 @@ transport_widget_button_press_event (GtkWidget *menuitem, return TRUE; } +static void +transport_widget_play_clicked(GtkWidget* button, + TransportWidget* self) +{ + g_debug("Transport_widget_play_clicked"); +} + static gboolean transport_widget_button_release_event (GtkWidget *menuitem, GdkEventButton *event) { g_debug("TransportWidget::menu_release_event"); + TransportWidgetPrivate * priv = TRANSPORT_WIDGET_GET_PRIVATE(TRANSPORT_WIDGET(menuitem)); + gtk_widget_event (priv->hbox, (GdkEvent*)event); + return TRUE; } |