diff options
author | Matthias Clasen <mclasen@redhat.com> | 2020-10-26 00:09:55 -0400 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2020-10-26 01:08:49 -0400 |
commit | 65f748fc621b82e997e0a2c39c5b483faf955d69 (patch) | |
tree | d69e92b4882126d11d0c8d76b437c0c1dde7dab3 /docs | |
parent | bed3616bf0886c74305a426e817ddeee8d1b21cb (diff) | |
download | gtk+-65f748fc621b82e997e0a2c39c5b483faf955d69.tar.gz |
docs: Add GtkPopover to the widget gallery
Diffstat (limited to 'docs')
-rw-r--r-- | docs/reference/gtk/images/popover.png | bin | 0 -> 3887 bytes | |||
-rw-r--r-- | docs/reference/gtk/meson.build | 1 | ||||
-rw-r--r-- | docs/reference/gtk/visual_index.xml | 1 | ||||
-rw-r--r-- | docs/tools/widgets.c | 24 |
4 files changed, 26 insertions, 0 deletions
diff --git a/docs/reference/gtk/images/popover.png b/docs/reference/gtk/images/popover.png Binary files differnew file mode 100644 index 0000000000..b66e6967a0 --- /dev/null +++ b/docs/reference/gtk/images/popover.png 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; } |