Verified Commit 2bfc3974 authored by Sebastian Krzyszkowiak's avatar Sebastian Krzyszkowiak
Browse files

home: Fold on Escape key press

This doesn't matter much for phone, but makes the interaction much
more pleasant on desktop.
parent 121739d5
......@@ -153,6 +153,24 @@ fold_cb (PhoshHome *self, PhoshOverview *overview)
phosh_home_set_state (self, PHOSH_HOME_STATE_FOLDED);
static gboolean
key_press_event_cb (PhoshHome *self, GdkEventKey *event, gpointer data)
gboolean handled = FALSE;
g_return_val_if_fail (PHOSH_IS_HOME (self), FALSE);
switch (event->keyval) {
case GDK_KEY_Escape:
phosh_home_set_state (self, PHOSH_HOME_STATE_FOLDED);
handled = TRUE;
/* nothing to do */
return handled;
static void
......@@ -190,6 +208,12 @@ phosh_home_constructed (GObject *object)
G_CALLBACK (phosh_home_resize),
gtk_widget_add_events (GTK_WIDGET (self), GDK_KEY_PRESS_MASK);
g_signal_connect (G_OBJECT (self),
G_CALLBACK (key_press_event_cb),
G_OBJECT_CLASS (phosh_home_parent_class)->constructed (object);
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