Commit 5fe83748 authored by Matthias Clasen's avatar Matthias Clasen

docs: Add GtkOverlay to the widget gallery

parent 4f15b988
Pipeline #224758 passed with stages
in 21 minutes and 52 seconds
......@@ -338,6 +338,7 @@ images = [
'images/multiline-text.png',
'images/notebook.png',
'images/options.png',
'images/overlay.png',
'images/pagesetupdialog.png',
'images/panes.png',
'images/password-entry.png',
......
......@@ -82,6 +82,7 @@
<link linkend="GtkFlowBox"><inlinegraphic fileref="flow-box.png" format="PNG"></inlinegraphic></link>
<link linkend="GtkTreeView"><inlinegraphic fileref="list-and-tree.png" format="PNG"></inlinegraphic></link>
<link linkend="GtkIconView"><inlinegraphic fileref="icon-view.png" format="PNG"></inlinegraphic></link>
<link linkend="GtkOverlay"><inlinegraphic fileref="overlay.png" format="PNG"></inlinegraphic></link>
<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>
......
......@@ -2072,6 +2072,45 @@ create_grid (void)
return new_widget_info ("grid", vbox, MEDIUM);
}
static WidgetInfo *
create_overlay (void)
{
GtkWidget *vbox;
WidgetInfo *info;
GtkWidget *widget;
GtkWidget *overlay;
GtkWidget *label;
GtkWidget *child;
widget = gtk_frame_new (NULL);
overlay = gtk_overlay_new ();
gtk_widget_add_css_class (widget, "view");
label = gtk_label_new ("Content");
gtk_widget_set_vexpand (label, TRUE);
gtk_frame_set_child (GTK_FRAME (widget), overlay);
gtk_overlay_set_child (GTK_OVERLAY (overlay), label);
child = gtk_frame_new (NULL);
gtk_widget_add_css_class (child, "app-notification");
gtk_frame_set_child (GTK_FRAME (child), gtk_label_new ("Overlay"));
gtk_widget_set_valign (child, GTK_ALIGN_START);
gtk_widget_set_halign (child, GTK_ALIGN_CENTER);
gtk_overlay_add_overlay (GTK_OVERLAY (overlay), child);
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
gtk_widget_set_halign (widget, GTK_ALIGN_FILL);
gtk_widget_set_valign (widget, GTK_ALIGN_FILL);
gtk_box_append (GTK_BOX (vbox), widget);
gtk_box_append (GTK_BOX (vbox), gtk_label_new ("Overlay"));
add_margin (vbox);
info = new_widget_info ("overlay", vbox, MEDIUM);
return info;
}
GList *
get_all_widgets (void)
{
......@@ -2161,6 +2200,7 @@ get_all_widgets (void)
retval = g_list_prepend (retval, create_box ());
retval = g_list_prepend (retval, create_center_box ());
retval = g_list_prepend (retval, create_grid ());
retval = g_list_prepend (retval, create_overlay ());
return retval;
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment