Skip to content

Commit 28de283

Browse files
committed
clapper-app: Add auto window resize keyboard shortcut
In addition to middle click, also add "Super+r" keyboard shortcut to perform window resize to fit video action
1 parent ae6512b commit 28de283

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed

src/bin/clapper-app/clapper-app-application.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -700,6 +700,7 @@ clapper_app_application_constructed (GObject *object)
700700
{ "app.preferences", { "<Control>comma", NULL, NULL }},
701701
{ "app.about", { "F1", NULL, NULL }},
702702
{ "win.toggle-fullscreen", { "F11", "f", NULL }},
703+
{ "win.auto-resize", { "<Super>r", NULL, NULL }},
703704
{ "win.show-help-overlay", { "<Control>question", NULL, NULL }},
704705
{ "window.close", { "<Control>q", "q", NULL }},
705706
};

src/bin/clapper-app/clapper-app-window.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1063,6 +1063,12 @@ toggle_fullscreen (GSimpleAction *action, GVariant *param, gpointer user_data)
10631063
video_toggle_fullscreen_cb (CLAPPER_GTK_VIDEO_CAST (self->video), self);
10641064
}
10651065

1066+
static void
1067+
auto_resize (GSimpleAction *action, GVariant *param, gpointer user_data)
1068+
{
1069+
_resize_window (CLAPPER_APP_WINDOW_CAST (user_data));
1070+
}
1071+
10661072
static void
10671073
show_help_overlay (GSimpleAction *action, GVariant *param, gpointer user_data)
10681074
{
@@ -1217,6 +1223,7 @@ clapper_app_window_constructed (GObject *object)
12171223

12181224
static const GActionEntry win_entries[] = {
12191225
{ "toggle-fullscreen", toggle_fullscreen, NULL, NULL, NULL },
1226+
{ "auto-resize", auto_resize, NULL, NULL, NULL },
12201227
{ "show-help-overlay", show_help_overlay, NULL, NULL, NULL },
12211228
};
12221229

src/bin/clapper-app/ui/clapper-app-help-overlay.ui

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,13 @@
3333
<property name="accelerator">F11 f</property>
3434
</object>
3535
</child>
36+
<child>
37+
<object class="GtkShortcutsShortcut">
38+
<property name="title" translatable="yes">Auto window resize</property>
39+
<property name="subtitle" translatable="yes">Middle click</property>
40+
<property name="accelerator">&lt;Super&gt;r</property>
41+
</object>
42+
</child>
3643
<child>
3744
<object class="GtkShortcutsShortcut">
3845
<property name="title" translatable="yes">Quit</property>

0 commit comments

Comments
 (0)