[gtk/matthiasc/for-master] docs: Add GtkPopover to the widget gallery
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/matthiasc/for-master] docs: Add GtkPopover to the widget gallery
- Date: Mon, 26 Oct 2020 04:31:50 +0000 (UTC)
commit bf66d2eeef057dfdd427de31cab5d9554c94bffd
Author: Matthias Clasen <mclasen redhat com>
Date: Mon Oct 26 00:09:55 2020 -0400
docs: Add GtkPopover to the widget gallery
docs/reference/gtk/images/popover.png | Bin 0 -> 3887 bytes
docs/reference/gtk/meson.build | 1 +
docs/reference/gtk/visual_index.xml | 1 +
docs/tools/widgets.c | 24 ++++++++++++++++++++++++
4 files changed, 26 insertions(+)
---
diff --git a/docs/reference/gtk/images/popover.png b/docs/reference/gtk/images/popover.png
new file mode 100644
index 0000000000..b66e6967a0
Binary files /dev/null and b/docs/reference/gtk/images/popover.png differ
diff --git a/docs/reference/gtk/meson.build b/docs/reference/gtk/meson.build
index d3228b77a0..4ccd9c4e01 100644
--- a/docs/reference/gtk/meson.build
+++ b/docs/reference/gtk/meson.build
@@ -337,6 +337,7 @@ images = [
'images/panes.png',
'images/password-entry.png',
'images/picture.png',
+ 'images/popover.png',
'images/popup-anchors.png',
'images/popup-at.svg',
'images/popup-flip.png',
diff --git a/docs/reference/gtk/visual_index.xml b/docs/reference/gtk/visual_index.xml
index 8c8329b2c0..9c5e368c49 100644
--- a/docs/reference/gtk/visual_index.xml
+++ b/docs/reference/gtk/visual_index.xml
@@ -78,6 +78,7 @@
<link linkend="GtkStack"><inlinegraphic fileref="stack.png" format="PNG"></inlinegraphic></link>
<link linkend="GtkStackSwitcher"><inlinegraphic fileref="stackswitcher.png"
format="PNG"></inlinegraphic></link>
<link linkend="GtkStackSidebar"><inlinegraphic fileref="sidebar.png" format="PNG"></inlinegraphic></link>
+ <link linkend="GtkPopover"><inlinegraphic fileref="popover.png" format="PNG"></inlinegraphic></link>
</para>
</section>
diff --git a/docs/tools/widgets.c b/docs/tools/widgets.c
index 6b589bcc9e..6a5ac3f18f 100644
--- a/docs/tools/widgets.c
+++ b/docs/tools/widgets.c
@@ -39,6 +39,7 @@ new_widget_info (const char *name,
info->snapshot_popover = TRUE;
info->window = gtk_window_new ();
+ gtk_window_set_default_size (GTK_WINDOW (info->window), 200, 200);
gtk_window_set_decorated (GTK_WINDOW (info->window), FALSE);
info->include_decorations = TRUE;
button = gtk_menu_button_new ();
@@ -1640,6 +1641,28 @@ create_menu_bar (void)
return new_widget_info ("menubar", vbox, SMALL);
}
+static WidgetInfo *
+create_popover (void)
+{
+ GtkWidget *widget;
+ GtkWidget *child;
+ WidgetInfo *info;
+
+ widget = gtk_popover_new ();
+ gtk_widget_set_size_request (widget, 180, 180);
+ gtk_widget_set_halign (widget, GTK_ALIGN_CENTER);
+ g_object_set (widget, "autohide", FALSE, NULL);
+ child = gtk_label_new ("Popover");
+ gtk_widget_set_halign (child, GTK_ALIGN_CENTER);
+ gtk_widget_set_valign (child, GTK_ALIGN_CENTER);
+ gtk_popover_set_child (GTK_POPOVER (widget), child);
+
+ info = new_widget_info ("popover", widget, ASIS);
+ info->wait = 100;
+
+ return info;
+}
+
GList *
get_all_widgets (void)
{
@@ -1710,6 +1733,7 @@ get_all_widgets (void)
retval = g_list_prepend (retval, create_emojichooser ());
retval = g_list_prepend (retval, create_expander ());
retval = g_list_prepend (retval, create_menu_bar ());
+ retval = g_list_prepend (retval, create_popover ());
return retval;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]