docs: Add gallery images for some more widgets

This adds GtkPicture, GtkVideo, GtkMediaControls.
This commit is contained in:
Matthias Clasen 2020-08-03 23:42:27 -04:00
parent 1d1e1a0068
commit 0ae46040a4
6 changed files with 82 additions and 0 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

View File

@ -322,6 +322,7 @@ images = [
'images/lockbutton.png',
'images/lockbutton-sorry.png',
'images/lockbutton-unlocked.png',
'images/media-controls.png',
'images/menubar.png',
'images/menu-button.png',
'images/messagedialog.png',
@ -330,6 +331,7 @@ images = [
'images/options.png',
'images/pagesetupdialog.png',
'images/panes.png',
'images/picture.png',
'images/placessidebar.png',
'images/popup-anchors.png',
'images/popup-at.svg',
@ -362,6 +364,7 @@ images = [
'images/up-center.png',
'images/up-end.png',
'images/up-start.png',
'images/video.png',
'images/volumebutton.png',
'images/widget-hvalign.png',
'images/window-default.png',

View File

@ -45,6 +45,15 @@
<link linkend="GtkGLArea">
<inlinegraphic fileref="glarea.png" format="PNG"></inlinegraphic>
</link>
<link linkend="GtkPicture">
<inlinegraphic fileref="picture.png" format="PNG"></inlinegraphic>
</link>
<link linkend="GtkVideo">
<inlinegraphic fileref="video.png" format="PNG"></inlinegraphic>
</link>
<link linkend="GtkMediaControls">
<inlinegraphic fileref="media-controls.png" format="PNG"></inlinegraphic>
</link>
</para>
</section>

View File

@ -1027,6 +1027,73 @@ create_image (void)
return new_widget_info ("image", vbox, SMALL);
}
static WidgetInfo *
create_picture (void)
{
GtkWidget *widget;
GtkWidget *vbox;
GtkIconTheme *theme;
GdkPaintable *paintable;
theme = gtk_icon_theme_get_for_display (gdk_display_get_default ());
paintable = GDK_PAINTABLE (gtk_icon_theme_lookup_icon (theme,
"applications-graphics",
NULL,
48, 1, GTK_TEXT_DIR_LTR,
0));
widget = gtk_picture_new_for_paintable (paintable);
gtk_picture_set_can_shrink (GTK_PICTURE (widget), TRUE);
gtk_widget_set_halign (widget, GTK_ALIGN_CENTER);
gtk_widget_set_valign (widget, GTK_ALIGN_CENTER);
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 3);
gtk_box_append (GTK_BOX (vbox), widget);
gtk_box_append (GTK_BOX (vbox), gtk_label_new ("Picture"));
add_margin (vbox);
return new_widget_info ("picture", vbox, SMALL);
}
static WidgetInfo *
create_video (void)
{
GtkWidget *widget;
GtkWidget *vbox;
widget = gtk_video_new_for_filename ("../../demos/gtk-demo/gtk-logo.webm");
gtk_widget_set_halign (widget, GTK_ALIGN_CENTER);
gtk_widget_set_valign (widget, GTK_ALIGN_CENTER);
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 3);
gtk_box_append (GTK_BOX (vbox), widget);
gtk_box_append (GTK_BOX (vbox), gtk_label_new ("Video"));
add_margin (vbox);
return new_widget_info ("video", vbox, SMALL);
}
static WidgetInfo *
create_media_controls (void)
{
GtkWidget *widget;
GtkWidget *vbox;
widget = gtk_media_controls_new (NULL);
gtk_widget_set_halign (widget, GTK_ALIGN_CENTER);
gtk_widget_set_valign (widget, GTK_ALIGN_CENTER);
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 3);
gtk_box_append (GTK_BOX (vbox), widget);
gtk_box_append (GTK_BOX (vbox), gtk_label_new ("Media Controls"));
add_margin (vbox);
return new_widget_info ("media-controls", vbox, SMALL);
}
static WidgetInfo *
create_spinner (void)
{
@ -1458,6 +1525,9 @@ get_all_widgets (void)
retval = g_list_prepend (retval, create_info_bar ());
retval = g_list_prepend (retval, create_gl_area ());
retval = g_list_prepend (retval, create_sidebar ());
retval = g_list_prepend (retval, create_video ());
retval = g_list_prepend (retval, create_media_controls ());
retval = g_list_prepend (retval, create_picture ());
return retval;
}