[gnome-builder/wip/gtk4-port: 460/736] libide/greeter: add action to set the greeter page
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder/wip/gtk4-port: 460/736] libide/greeter: add action to set the greeter page
- Date: Tue, 26 Apr 2022 01:46:27 +0000 (UTC)
commit 403a50ee64a93db323810aa2f3ce40e8e580e112
Author: Christian Hergert <chergert redhat com>
Date: Wed Apr 6 18:02:30 2022 -0700
libide/greeter: add action to set the greeter page
src/libide/greeter/ide-greeter-workspace.c | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
---
diff --git a/src/libide/greeter/ide-greeter-workspace.c b/src/libide/greeter/ide-greeter-workspace.c
index 086d8c77e..83f1aa702 100644
--- a/src/libide/greeter/ide-greeter-workspace.c
+++ b/src/libide/greeter/ide-greeter-workspace.c
@@ -609,6 +609,24 @@ ide_greeter_workspace_purge_selected_rows (GSimpleAction *action,
gtk_window_present (GTK_WINDOW (dialog));
}
+static void
+ide_greeter_workspace_page_action (GtkWidget *widget,
+ const char *action_name,
+ GVariant *param)
+{
+ IdeGreeterWorkspace *self = (IdeGreeterWorkspace *)widget;
+
+ IDE_ENTRY;
+
+ g_assert (IDE_IS_GREETER_WORKSPACE (self));
+ g_assert (g_variant_is_of_type (param, G_VARIANT_TYPE_STRING));
+
+ ide_greeter_workspace_set_page_name (self,
+ g_variant_get_string (param, NULL));
+
+ IDE_EXIT;
+}
+
static void
ide_greeter_workspace_dispose (GObject *object)
{
@@ -719,6 +737,8 @@ ide_greeter_workspace_class_init (IdeGreeterWorkspaceClass *klass)
gtk_widget_class_bind_template_child (widget_class, IdeGreeterWorkspace, title);
gtk_widget_class_bind_template_callback (widget_class, stack_notify_visible_child_cb);
+ gtk_widget_class_install_action (widget_class, "greeter.page", "s", ide_greeter_workspace_page_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);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]