[totem/wip/hadess/track-lists] main: Move subtitles and audio tracks to a separate menu
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [totem/wip/hadess/track-lists] main: Move subtitles and audio tracks to a separate menu
- Date: Fri, 11 Feb 2022 16:43:31 +0000 (UTC)
commit d9fb60d1d627b8c29418759498ad79b7a601e938
Author: Bastien Nocera <hadess hadess net>
Date: Thu Feb 10 14:10:52 2022 +0100
main: Move subtitles and audio tracks to a separate menu
data/totem.ui | 38 +++++++++++++++++++++-----------------
src/totem-object.c | 26 ++++++++++++++++++++++++++
src/totem-private.h | 2 ++
3 files changed, 49 insertions(+), 17 deletions(-)
---
diff --git a/data/totem.ui b/data/totem.ui
index d076cea3d..c4bd1bf63 100644
--- a/data/totem.ui
+++ b/data/totem.ui
@@ -84,23 +84,7 @@
<attribute name="accel"><Ctrl>G</attribute>
</item>
</section>
- <section>
- <submenu>
- <attribute name="label" translatable="yes">_Languages</attribute>
- <section id="languages-placeholder"/>
- </submenu>
- <submenu>
- <attribute name="label" translatable="yes">S_ubtitles</attribute>
- <section>
- <item>
- <attribute name="label" translatable="yes">_Select Text
Subtitles…</attribute>
- <attribute name="action">app.select-subtitle</attribute>
- </item>
- <section id="subtitle-download-placeholder"/>
- <section id="subtitles-placeholder"/>
- </section>
- </submenu>
- </section>
+
<section>
<item>
<attribute name="label" translatable="yes">Prefere_nces</attribute>
@@ -124,6 +108,26 @@
</section>
</menu>
+<menu id="subtitlesmenu">
+ <section>
+ <submenu>
+ <attribute name="label" translatable="yes">_Languages</attribute>
+ <section id="languages-placeholder"/>
+ </submenu>
+ <submenu>
+ <attribute name="label" translatable="yes">S_ubtitles</attribute>
+ <section>
+ <item>
+ <attribute name="label" translatable="yes">_Select Text
Subtitles…</attribute>
+ <attribute name="action">app.select-subtitle</attribute>
+ </item>
+ <section id="subtitle-download-placeholder"/>
+ <section id="subtitles-placeholder"/>
+ </section>
+ </submenu>
+ </section>
+</menu>
+
<menu id="gomenu">
<section>
<item>
diff --git a/src/totem-object.c b/src/totem-object.c
index 3ad6de4c8..fc5855447 100644
--- a/src/totem-object.c
+++ b/src/totem-object.c
@@ -512,6 +512,7 @@ totem_object_class_init (TotemObjectClass *klass)
accumulator_first_non_null_wins, NULL,
g_cclosure_marshal_generic,
G_TYPE_STRING, 1, G_TYPE_STRING);
+
}
static void
@@ -1065,6 +1066,7 @@ totem_object_set_main_page (TotemObject *totem,
NULL);
gtk_widget_show (totem->fullscreen_button);
gtk_widget_show (totem->gear_button);
+ gtk_widget_show (totem->subtitles_button);
gtk_widget_hide (totem->add_button);
gtk_widget_hide (totem->main_menu_button);
show_popup (totem);
@@ -1088,6 +1090,7 @@ totem_object_set_main_page (TotemObject *totem,
gtk_widget_show (totem->main_menu_button);
gtk_widget_hide (totem->fullscreen_button);
gtk_widget_hide (totem->gear_button);
+ gtk_widget_hide (totem->subtitles_button);
if (totem_grilo_get_current_page (TOTEM_GRILO (totem->grilo)) == TOTEM_GRILO_PAGE_RECENT)
gtk_widget_show (totem->add_button);
totem_grilo_start (TOTEM_GRILO (totem->grilo));
@@ -4046,6 +4049,19 @@ totem_callback_connect (TotemObject *totem)
gtk_widget_hide (item);
gtk_widget_set_no_show_all (item, TRUE);
+ /* Subtitles menu */
+ item = totem->subtitles_button = totem_interface_create_header_button (totem->header,
+ gtk_menu_button_new (),
+
"media-view-subtitles-symbolic",
+ GTK_PACK_END);
+ menu = (GMenuModel *) gtk_builder_get_object (totem->xml, "subtitlesmenu");
+ gtk_menu_button_set_menu_model (GTK_MENU_BUTTON (item), menu);
+ popover = gtk_menu_button_get_popover (GTK_MENU_BUTTON (item));
+ g_signal_connect (G_OBJECT (item), "toggled",
+ G_CALLBACK (popup_menu_shown_cb), totem);
+ gtk_widget_hide (item);
+ gtk_widget_set_no_show_all (item, TRUE);
+
/* Add button */
item = totem->add_button = totem_interface_create_header_button (totem->header,
gtk_menu_button_new (),
@@ -4193,6 +4209,16 @@ add_fullscreen_toolbar (TotemObject *totem,
g_signal_connect (G_OBJECT (item), "toggled",
G_CALLBACK (popup_menu_shown_cb), totem);
totem->fullscreen_gear_button = item;
+
+ item = totem_interface_create_header_button (totem->fullscreen_header,
+ gtk_menu_button_new (),
+ "media-view-subtitles-symbolic",
+ GTK_PACK_END);
+ menu = (GMenuModel *) gtk_builder_get_object (totem->xml, "subtitlesmenu");
+ gtk_menu_button_set_menu_model (GTK_MENU_BUTTON (item), menu);
+ g_signal_connect (G_OBJECT (item), "toggled",
+ G_CALLBACK (popup_menu_shown_cb), totem);
+ totem->fullscreen_subtitles_button = item;
}
void
diff --git a/src/totem-private.h b/src/totem-private.h
index 6337210dd..bc079a76b 100644
--- a/src/totem-private.h
+++ b/src/totem-private.h
@@ -89,6 +89,7 @@ struct _TotemObject {
GtkWidget *fullscreen_header;
GtkWidget *fullscreen_gear_button;
+ GtkWidget *fullscreen_subtitles_button;
/* Plugins */
GtkWidget *plugins;
@@ -140,6 +141,7 @@ struct _TotemObject {
GtkWidget *gear_button;
GtkWidget *add_button;
GtkWidget *main_menu_button;
+ GtkWidget *subtitles_button;
char *player_title;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]