[gtk/matthiasc/for-master] docs: Fix the GtkVolumeButton gallery image



commit a70c9c69a0669c98ff29cb8b5ed21e8b66f559e4
Author: Matthias Clasen <mclasen redhat com>
Date:   Sun Oct 25 22:42:40 2020 -0400

    docs: Fix the GtkVolumeButton gallery image
    
    Give up on showing the popup, we don't do that
    for other buttons either.

 docs/reference/gtk/images/volumebutton.png | Bin 2398 -> 3085 bytes
 docs/tools/widgets.c                       |  25 +++++++++----------------
 2 files changed, 9 insertions(+), 16 deletions(-)
---
diff --git a/docs/reference/gtk/images/volumebutton.png b/docs/reference/gtk/images/volumebutton.png
index b310451235..ff484bd158 100644
Binary files a/docs/reference/gtk/images/volumebutton.png and b/docs/reference/gtk/images/volumebutton.png 
differ
diff --git a/docs/tools/widgets.c b/docs/tools/widgets.c
index 04c6882140..5d83a0df79 100644
--- a/docs/tools/widgets.c
+++ b/docs/tools/widgets.c
@@ -1170,25 +1170,18 @@ create_spinner (void)
 static WidgetInfo *
 create_volume_button (void)
 {
-  GtkWidget *button, *box;
-  GtkWidget *widget;
-  GtkWidget *popup;
-
-  widget = gtk_window_new ();
-  gtk_widget_set_size_request (widget, 100, 250);
-
-  box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
-  gtk_window_set_child (GTK_WINDOW (widget), box);
+  GtkWidget *widget, *vbox;
 
-  button = gtk_volume_button_new ();
-  gtk_box_append (GTK_BOX (box), button);
+  widget = gtk_volume_button_new ();
+  gtk_scale_button_set_value (GTK_SCALE_BUTTON (widget), 33);
 
-  gtk_scale_button_set_value (GTK_SCALE_BUTTON (button), 33);
-  popup = gtk_scale_button_get_popup (GTK_SCALE_BUTTON (button));
-  gtk_widget_realize (widget);
-  gtk_widget_show (popup);
+  vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 3);
+  gtk_widget_set_halign (widget, GTK_ALIGN_CENTER);
+  gtk_widget_set_valign (widget, GTK_ALIGN_CENTER);
+  gtk_box_append (GTK_BOX (vbox), widget);
+  gtk_box_append (GTK_BOX (vbox), gtk_label_new ("Volume Button"));
 
-  return new_widget_info ("volumebutton", widget, ASIS);
+  return new_widget_info ("volumebutton", vbox, SMALL);
 }
 
 static WidgetInfo *


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]