diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-27 15:18:46 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-27 15:18:46 +0000 |
commit | 56294d30a82ec2da6f9ce399740c1ef65a9ddef4 (patch) | |
tree | bbe3823e41495d026ba8edc6eeaef166edb7e2a2 /src/gs-first-run-dialog.c | |
parent | Initial commit. (diff) | |
download | gnome-software-56294d30a82ec2da6f9ce399740c1ef65a9ddef4.tar.xz gnome-software-56294d30a82ec2da6f9ce399740c1ef65a9ddef4.zip |
Adding upstream version 3.38.1.upstream/3.38.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/gs-first-run-dialog.c')
-rw-r--r-- | src/gs-first-run-dialog.c | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/src/gs-first-run-dialog.c b/src/gs-first-run-dialog.c new file mode 100644 index 0000000..5603479 --- /dev/null +++ b/src/gs-first-run-dialog.c @@ -0,0 +1,60 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- + * vi:set noexpandtab tabstop=8 shiftwidth=8: + * + * Copyright (C) 2014-2015 Kalev Lember <klember@redhat.com> + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +#include "config.h" + +#include <gtk/gtk.h> + +#include "gs-first-run-dialog.h" + +struct _GsFirstRunDialog +{ + GtkDialog parent_instance; + + GtkWidget *button; +}; + +G_DEFINE_TYPE (GsFirstRunDialog, gs_first_run_dialog, GTK_TYPE_DIALOG) + +static void +button_clicked_cb (GtkWidget *widget, GsFirstRunDialog *dialog) +{ + gtk_window_close (GTK_WINDOW (dialog)); +} + +static void +gs_first_run_dialog_init (GsFirstRunDialog *dialog) +{ + GtkWidget *button_label; + + gtk_widget_init_template (GTK_WIDGET (dialog)); + + button_label = gtk_bin_get_child (GTK_BIN (dialog->button)); + gtk_widget_set_margin_start (button_label, 16); + gtk_widget_set_margin_end (button_label, 16); + + g_signal_connect (dialog->button, "clicked", G_CALLBACK (button_clicked_cb), dialog); +} + +static void +gs_first_run_dialog_class_init (GsFirstRunDialogClass *klass) +{ + GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass); + + gtk_widget_class_set_template_from_resource (widget_class, "/org/gnome/Software/gs-first-run-dialog.ui"); + + gtk_widget_class_bind_template_child (widget_class, GsFirstRunDialog, button); +} + +GtkWidget * +gs_first_run_dialog_new (void) +{ + return GTK_WIDGET (g_object_new (GS_TYPE_FIRST_RUN_DIALOG, + "use-header-bar", TRUE, + NULL)); +} |