Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Take photo or video on secondary click #204

Merged
merged 16 commits into from
Feb 3, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/MainWindow.vala
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,15 @@ public class Camera.MainWindow : Hdy.ApplicationWindow {

camera_view = new Widgets.CameraView ();
camera_view.bind_property ("horizontal-flip", header_bar, "horizontal-flip", GLib.BindingFlags.BIDIRECTIONAL | GLib.BindingFlags.SYNC_CREATE);
camera_view.button_press_event.connect ((event) => {
if (event.button == Gdk.BUTTON_SECONDARY) {
header_bar.take_button.activate ();

return Gdk.EVENT_STOP;
}

return base.button_press_event (event);
jeremypw marked this conversation as resolved.
Show resolved Hide resolved
});

var overlay = new Gtk.Overlay ();
overlay.add (camera_view);
Expand Down
3 changes: 2 additions & 1 deletion src/Widgets/HeaderBar.vala
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
public class Camera.Widgets.HeaderBar : Gtk.HeaderBar {
public signal void request_change_balance (double brightness, double contrast);

public Gtk.Button take_button;

private const string PHOTO_ICON_SYMBOLIC = "view-list-images-symbolic";
private const string VIDEO_ICON_SYMBOLIC = "view-list-video-symbolic";
private const string STOP_ICON_SYMBOLIC = "media-playback-stop-symbolic";
Expand All @@ -31,7 +33,6 @@ public class Camera.Widgets.HeaderBar : Gtk.HeaderBar {
private Gtk.Revealer video_timer_revealer;
private Gtk.Label take_timer;
private Gtk.Box linked_box;
private Gtk.Button take_button;
private Gtk.MenuButton camera_menu_button;
private Gtk.MenuButton menu_button;
private Gtk.Revealer camera_menu_revealer;
Expand Down