[gtk/ebassi/gidocgen: 221/501] docs: Add dialogs to the gallery
- From: Emmanuele Bassi <ebassi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/ebassi/gidocgen: 221/501] docs: Add dialogs to the gallery
- Date: Fri, 5 Mar 2021 15:53:33 +0000 (UTC)
commit a79cc97df700ae7e56ea10b622c74792c2e8ff5f
Author: Matthias Clasen <mclasen redhat com>
Date: Fri Feb 26 08:29:50 2021 -0500
docs: Add dialogs to the gallery
docs/reference/gtk/gtk4.toml.in | 1 +
docs/reference/gtk/images/dialog.png | Bin 0 -> 6210 bytes
docs/reference/gtk/visual_index.md | 1 +
docs/tools/widgets.c | 31 +++++++++++++++++++++++++++++++
4 files changed, 33 insertions(+)
---
diff --git a/docs/reference/gtk/gtk4.toml.in b/docs/reference/gtk/gtk4.toml.in
index a7bf658176..4c5ca3c5e5 100644
--- a/docs/reference/gtk/gtk4.toml.in
+++ b/docs/reference/gtk/gtk4.toml.in
@@ -101,6 +101,7 @@ content_images = [
"images/combo-box-entry.png",
"images/combo-box.png",
"images/combo-box-text.png",
+ "images/dialog.png",
"images/down-center.png",
"images/down-end.png",
"images/down-start.png",
diff --git a/docs/reference/gtk/images/dialog.png b/docs/reference/gtk/images/dialog.png
new file mode 100644
index 0000000000..4e56521564
Binary files /dev/null and b/docs/reference/gtk/images/dialog.png differ
diff --git a/docs/reference/gtk/visual_index.md b/docs/reference/gtk/visual_index.md
index 1fff19351b..06727feb3c 100644
--- a/docs/reference/gtk/visual_index.md
+++ b/docs/reference/gtk/visual_index.md
@@ -71,6 +71,7 @@ Title: Widget Gallery
## Windows
[![window](window.png)](class.Window.html)
+[![dialog](dialog.png)](class.Dialog.html)
[![messagedialog](messagedialog.png)](class.MessageDialog.html)
[![aboutdialog](aboutdialog.png)](class.AboutDialog.html)
[![assistant](assistant.png)](class.Assistant.html)
diff --git a/docs/tools/widgets.c b/docs/tools/widgets.c
index de0ddca882..56cf2eb8d2 100644
--- a/docs/tools/widgets.c
+++ b/docs/tools/widgets.c
@@ -837,6 +837,36 @@ create_message_dialog (void)
return new_widget_info ("messagedialog", widget, ASIS);
}
+static WidgetInfo *
+create_dialog (void)
+{
+ GtkWidget *widget;
+ GtkWidget *content;
+ GtkWidget *label;
+
+ widget = g_object_new (GTK_TYPE_DIALOG, "use-header-bar", TRUE, NULL);
+ gtk_window_set_title (GTK_WINDOW (widget), "Dialog");
+
+ gtk_dialog_add_button (GTK_DIALOG (widget), "Accept", GTK_RESPONSE_OK);
+ gtk_dialog_add_button (GTK_DIALOG (widget), "Cancel", GTK_RESPONSE_CANCEL);
+
+ gtk_dialog_set_default_response (GTK_DIALOG (widget), GTK_RESPONSE_OK);
+
+ content = gtk_dialog_get_content_area (GTK_DIALOG (widget));
+ label = gtk_label_new ("Content");
+ g_object_set (label,
+ "margin-start", 20,
+ "margin-end", 20,
+ "margin-top", 20,
+ "margin-bottom", 20,
+ NULL);
+ gtk_widget_set_hexpand (label, TRUE);
+ gtk_widget_set_halign (label, GTK_ALIGN_CENTER);
+ gtk_box_append (GTK_BOX (content), label);
+
+ return new_widget_info ("dialog", widget, ASIS);
+}
+
static WidgetInfo *
create_about_dialog (void)
{
@@ -2120,6 +2150,7 @@ get_all_widgets (void)
retval = g_list_prepend (retval, create_combo_box ());
retval = g_list_prepend (retval, create_combo_box_entry ());
retval = g_list_prepend (retval, create_combo_box_text ());
+ retval = g_list_prepend (retval, create_dialog ());
retval = g_list_prepend (retval, create_entry ());
retval = g_list_prepend (retval, create_font_button ());
retval = g_list_prepend (retval, create_frame ());
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]