diff options
author | Bastien Nocera <hadess@hadess.net> | 2022-02-11 18:23:25 +0100 |
---|---|---|
committer | Bastien Nocera <hadess@hadess.net> | 2022-02-11 18:33:04 +0100 |
commit | b3c9ded43e602a279651377677edc03dd27c1609 (patch) | |
tree | cb5b33f0949bfa7285e90a4702cc758f650d300e | |
parent | 35baa6f759c18815a565e7f0509e756c472fd2f2 (diff) | |
download | totem-b3c9ded43e602a279651377677edc03dd27c1609.tar.gz |
main: Add Shift+V to toggle subtitles
Closes: #130
-rw-r--r-- | data/shortcuts.ui | 28 | ||||
-rw-r--r-- | src/totem-object.c | 5 |
2 files changed, 24 insertions, 9 deletions
diff --git a/data/shortcuts.ui b/data/shortcuts.ui index dfad70605..767d1abac 100644 --- a/data/shortcuts.ui +++ b/data/shortcuts.ui @@ -142,13 +142,6 @@ <property name="title" translatable="yes" context="shortcut window">Next video or chapter</property> </object> </child> - <child> - <object class="GtkShortcutsShortcut" id="cycle-subtitle"> - <property name="visible">1</property> - <property name="accelerator">V</property> - <property name="title" translatable="yes" context="shortcut window">Select next Subtitle</property> - </object> - </child> </object> </child> <child> @@ -308,7 +301,26 @@ </child> </object> </child> - + <child> + <object class="GtkShortcutsGroup" id="subtitles-menu"> + <property name="visible">1</property> + <property name="title" translatable="yes" context="shortcut window">Subtitles</property> + <child> + <object class="GtkShortcutsShortcut" id="cycle-subtitle"> + <property name="visible">1</property> + <property name="accelerator">V</property> + <property name="title" translatable="yes" context="shortcut window">Select next subtitle</property> + </object> + </child> + <child> + <object class="GtkShortcutsShortcut" id="cycle-subtitle"> + <property name="visible">1</property> + <property name="accelerator"><Shift>V</property> + <property name="title" translatable="yes" context="shortcut window">Toggle subtitles</property> + </object> + </child> + </object> + </child> </object> </child> </object> diff --git a/src/totem-object.c b/src/totem-object.c index c242baf06..5da970f69 100644 --- a/src/totem-object.c +++ b/src/totem-object.c @@ -3521,7 +3521,10 @@ totem_object_handle_key_press (TotemObject *totem, GdkEventKey *event) case GDK_KEY_Subtitle: case GDK_KEY_V: case GDK_KEY_v: - bacon_video_widget_set_next_subtitle (totem->bvw); + if (mask == GDK_SHIFT_MASK) + bacon_video_toggle_subtitles (totem->bvw); + else + bacon_video_widget_set_next_subtitle (totem->bvw); break; case GDK_KEY_t: case GDK_KEY_T: |