[totem] main: Move fullscreen button to header bar
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [totem] main: Move fullscreen button to header bar
- Date: Wed, 8 May 2013 17:21:13 +0000 (UTC)
commit 9943371b592562e12bbeee162afd07e95b9bb734
Author: Bastien Nocera <hadess hadess net>
Date: Wed May 8 17:44:24 2013 +0200
main: Move fullscreen button to header bar
And add stub "Go" button in the controls bar in its place.
data/controls.ui | 11 ++++++++---
src/backend/bacon-video-controls-actor.c | 2 +-
src/backend/bacon-video-header-actor.c | 29 ++++++++++++++++++++---------
src/backend/bvw-test.c | 6 +++---
src/totem-object.c | 23 +++++++++++++----------
5 files changed, 45 insertions(+), 26 deletions(-)
---
diff --git a/data/controls.ui b/data/controls.ui
index 69aa997..2f4679c 100644
--- a/data/controls.ui
+++ b/data/controls.ui
@@ -82,16 +82,21 @@
</packing>
</child>
<child>
- <object class="GtkToolItem" id="fullscreen_toolbutton">
+ <object class="GtkToolItem" id="go_toolbutton">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
- <object class="GtkButton" id="fullscreen_button">
+ <object class="GtkMenuButton" id="go_button">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="relief">none</property>
- <property name="action_name">app.fullscreen</property>
+ <child>
+ <object class="GtkImage" id="go_button_image">
+ <property name="visible">True</property>
+ <property name="icon-name">view-more-symbolic</property>
+ </object>
+ </child>
</object>
</child>
</object>
diff --git a/src/backend/bacon-video-controls-actor.c b/src/backend/bacon-video-controls-actor.c
index a3e6560..008ee25 100644
--- a/src/backend/bacon-video-controls-actor.c
+++ b/src/backend/bacon-video-controls-actor.c
@@ -105,7 +105,7 @@ bacon_video_controls_actor_init (BaconVideoControlsActor *controls)
setup_object (controls, "seek_scale");
setup_object (controls, "controls_box");
- setup_object (controls, "fullscreen_button");
+ setup_object (controls, "go_button");
setup_object (controls, "volume_button");
setup_object (controls, "time_label");
setup_object (controls, "time_rem_label");
diff --git a/src/backend/bacon-video-header-actor.c b/src/backend/bacon-video-header-actor.c
index efd9e55..a352a44 100644
--- a/src/backend/bacon-video-header-actor.c
+++ b/src/backend/bacon-video-header-actor.c
@@ -30,7 +30,6 @@
struct BaconVideoHeaderActorPrivate
{
GtkWidget *widget;
- GtkWidget *button;
};
G_DEFINE_TYPE (BaconVideoHeaderActor, bacon_video_header_actor, GTK_CLUTTER_TYPE_ACTOR);
@@ -71,22 +70,34 @@ setup_object (BaconVideoHeaderActor *header,
g_object_set_data (G_OBJECT (header), name, widget);
}
+static GtkWidget *
+add_button (BaconVideoHeaderActor *header,
+ GtkWidget *button,
+ const char *icon_name,
+ const char *object_name)
+{
+ GtkWidget *image;
+
+ image = gtk_image_new_from_icon_name (icon_name, GTK_ICON_SIZE_MENU);
+ gtk_button_set_image (GTK_BUTTON (button), image);
+ setup_object (header, object_name, button);
+
+ gtk_header_bar_pack_end (GTK_HEADER_BAR (header->priv->widget), button);
+ return button;
+}
+
static void
bacon_video_header_actor_init (BaconVideoHeaderActor *header)
{
- GtkWidget *image;
+ GtkWidget *button;
header->priv = BACON_VIDEO_HEADER_ACTOR_GET_PRIVATE (G_OBJECT (header));
header->priv->widget = gtk_header_bar_new ();
setup_object (header, "header", header->priv->widget);
- header->priv->button = gtk_menu_button_new ();
- image = gtk_image_new_from_icon_name ("emblem-system-symbolic", GTK_ICON_SIZE_MENU);
- gtk_button_set_image (GTK_BUTTON (header->priv->button), image);
- setup_object (header, "button", header->priv->button);
-
- gtk_header_bar_pack_end (GTK_HEADER_BAR (header->priv->widget),
- header->priv->button);
+ button = add_button (header, gtk_button_new (), "view-fullscreen-symbolic", "fullscreen_button");
+ gtk_actionable_set_action_name (GTK_ACTIONABLE (button), "app.fullscreen");
+ add_button (header, gtk_menu_button_new (), "emblem-system-symbolic", "button");
}
ClutterActor *
diff --git a/src/backend/bvw-test.c b/src/backend/bvw-test.c
index 420993e..d853ea6 100644
--- a/src/backend/bvw-test.c
+++ b/src/backend/bvw-test.c
@@ -146,9 +146,9 @@ int main
item = gtk_separator_tool_item_new ();
gtk_box_pack_start (box, GTK_WIDGET (item), FALSE, FALSE, 0);
- /* Fullscreen button */
- item = g_object_get_data (bacon_video_widget_get_controls_object (BACON_VIDEO_WIDGET (bvw)),
"fullscreen_button");
- image = gtk_image_new_from_icon_name ("view-fullscreen-symbolic", GTK_ICON_SIZE_SMALL_TOOLBAR);
+ /* Go button */
+ item = g_object_get_data (bacon_video_widget_get_controls_object (BACON_VIDEO_WIDGET (bvw)),
"go_button");
+ image = gtk_image_new_from_icon_name ("view-more-symbolic", GTK_ICON_SIZE_SMALL_TOOLBAR);
gtk_button_set_image (GTK_BUTTON (item), image);
gtk_widget_show_all (GTK_WIDGET (box));
diff --git a/src/totem-object.c b/src/totem-object.c
index dee9a9c..4763993 100644
--- a/src/totem-object.c
+++ b/src/totem-object.c
@@ -3877,16 +3877,6 @@ totem_callback_connect (TotemObject *totem)
_("Next Chapter/Movie"));
gtk_box_pack_start (box, item, FALSE, FALSE, 0);
- /* Fullscreen button */
- item = g_object_get_data (totem->controls, "fullscreen_button");
- image = gtk_image_new ();
- gtk_button_set_image (GTK_BUTTON (item), image);
- g_object_bind_property_full (totem, "fullscreen",
- image, "icon-name",
- G_BINDING_SYNC_CREATE,
- fullscreen_button_image_sync,
- NULL, NULL, NULL);
-
/* Seekbar */
g_signal_connect (totem->seek, "button-press-event",
G_CALLBACK (seek_slider_pressed_cb), totem);
@@ -3897,6 +3887,19 @@ totem_callback_connect (TotemObject *totem)
g_signal_connect (totem->seekadj, "value-changed",
G_CALLBACK (seek_slider_changed_cb), totem);
+ /* Go button */
+ /* FIXME */
+
+ /* Fullscreen button */
+ item = g_object_get_data (bacon_video_widget_get_header_object (totem->bvw),
+ "fullscreen_button");
+ image = gtk_button_get_image (GTK_BUTTON (item));
+ g_object_bind_property_full (totem, "fullscreen",
+ image, "icon-name",
+ G_BINDING_SYNC_CREATE,
+ fullscreen_button_image_sync,
+ NULL, NULL, NULL);
+
/* Cog wheel */
item = g_object_get_data (bacon_video_widget_get_header_object (totem->bvw),
"button");
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]