Commit 09988198 authored by Paolo Borelli's avatar Paolo Borelli
Browse files
parent fac10d13
......@@ -45,6 +45,9 @@ public interface Clock : GLib.Object {
return false;
}
public virtual void back () {
}
public virtual void update_header_bar () {
}
}
......
......@@ -186,6 +186,18 @@ public class Window : Gtk.ApplicationWindow {
return base.key_press_event (event);
}
public override bool button_release_event (Gdk.EventButton event) {
const uint BUTTON_BACK = 8;
uint button;
if (((Gdk.Event)(event)).get_button (out button) && button == BUTTON_BACK) {
((Clock) stack.visible_child).back ();
return true;
}
return base.button_release_event (event);
}
protected override bool configure_event (Gdk.EventConfigure event) {
if (get_realized () && !(Gdk.WindowState.MAXIMIZED in get_window ().get_state ())) {
int width, height;
......
......@@ -438,6 +438,12 @@ public class Face : Gtk.Stack, Clocks.Clock {
return content_view.escape_pressed ();
}
public void back () {
if (visible_child == standalone) {
reset_view ();
}
}
public void reset_view () {
standalone_location = null;
visible_child = locations.get_n_items () == 0 ? empty_view : content_view;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment