[gnome-builder] libide/greeter: leave selection mode with escape
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] libide/greeter: leave selection mode with escape
- Date: Sat, 30 Jul 2022 22:24:25 +0000 (UTC)
commit 101dbb1a150a575da837143b60a98b0097079da8
Author: Christian Hergert <chergert redhat com>
Date: Sat Jul 30 15:24:08 2022 -0700
libide/greeter: leave selection mode with escape
Fixes #1728
src/libide/greeter/ide-greeter-workspace.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
---
diff --git a/src/libide/greeter/ide-greeter-workspace.c b/src/libide/greeter/ide-greeter-workspace.c
index 9d18cda33..db086b249 100644
--- a/src/libide/greeter/ide-greeter-workspace.c
+++ b/src/libide/greeter/ide-greeter-workspace.c
@@ -796,6 +796,14 @@ ide_greeter_workspace_open_action (GtkWidget *widget,
IDE_EXIT;
}
+static void
+ide_greeter_workspace_reset_action (GtkWidget *widget,
+ const char *action_name,
+ GVariant *param)
+{
+ ide_greeter_workspace_set_selection_mode (IDE_GREETER_WORKSPACE (widget), FALSE);
+}
+
static void
ide_greeter_workspace_dispose (GObject *object)
{
@@ -908,9 +916,11 @@ ide_greeter_workspace_class_init (IdeGreeterWorkspaceClass *klass)
gtk_widget_class_install_action (widget_class, "greeter.open", NULL, ide_greeter_workspace_open_action);
gtk_widget_class_install_action (widget_class, "greeter.page", "s", ide_greeter_workspace_page_action);
+ gtk_widget_class_install_action (widget_class, "greeter.reset", NULL, ide_greeter_workspace_reset_action);
gtk_widget_class_add_binding_action (widget_class, GDK_KEY_Left, GDK_ALT_MASK, "win.page", "s",
"overview");
gtk_widget_class_add_binding_action (widget_class, GDK_KEY_w, GDK_CONTROL_MASK, "window.close", NULL);
+ gtk_widget_class_add_binding_action (widget_class, GDK_KEY_Escape, 0, "greeter.reset", NULL);
g_type_ensure (IDE_TYPE_GREETER_BUTTONS_SECTION);
g_type_ensure (IDE_TYPE_GREETER_ROW);
@@ -935,6 +945,8 @@ ide_greeter_workspace_init (IdeGreeterWorkspace *self)
g_action_map_add_action (G_ACTION_MAP (self), G_ACTION (selection_action));
g_action_map_add_action_entries (G_ACTION_MAP (self), actions, G_N_ELEMENTS (actions), self);
+ gtk_widget_action_set_enabled (GTK_WIDGET (self), "greeter.reset", FALSE);
+
gesture = gtk_gesture_click_new ();
gtk_gesture_single_set_button (GTK_GESTURE_SINGLE (gesture), 8);
gtk_widget_add_controller (GTK_WIDGET (self), GTK_EVENT_CONTROLLER (gesture));
@@ -1123,6 +1135,8 @@ ide_greeter_workspace_set_selection_mode (IdeGreeterWorkspace *self,
ide_greeter_section_set_selection_mode (IDE_GREETER_SECTION (child), selection_mode);
}
+ gtk_widget_action_set_enabled (GTK_WIDGET (self), "greeter.reset", selection_mode);
+
gtk_widget_set_visible (GTK_WIDGET (self->action_bar), selection_mode);
gtk_widget_set_visible (GTK_WIDGET (self->projects_action_bar), !selection_mode);
g_object_notify_by_pspec (G_OBJECT (self), properties [PROP_SELECTION_MODE]);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]