[gtk/ebassi/gidocgen: 99/500] docs: Improve the togglebutton image




commit 18f525f7b4816110abba1286ab947b177f4ea3e0
Author: Matthias Clasen <mclasen redhat com>
Date:   Sun Feb 21 12:44:28 2021 -0500

    docs: Improve the togglebutton image
    
    Make it actually show toggles.

 docs/reference/gtk/images/toggle-button.png | Bin 3227 -> 3066 bytes
 docs/tools/widgets.c                        |  12 ++++++++++--
 2 files changed, 10 insertions(+), 2 deletions(-)
---
diff --git a/docs/reference/gtk/images/toggle-button.png b/docs/reference/gtk/images/toggle-button.png
index b928538d56..a6e2377d1b 100644
Binary files a/docs/reference/gtk/images/toggle-button.png and b/docs/reference/gtk/images/toggle-button.png 
differ
diff --git a/docs/tools/widgets.c b/docs/tools/widgets.c
index 884939adb5..ca00f5e101 100644
--- a/docs/tools/widgets.c
+++ b/docs/tools/widgets.c
@@ -118,9 +118,17 @@ static WidgetInfo *
 create_toggle_button (void)
 {
   GtkWidget *widget;
+  GtkWidget *button;
 
-  widget = gtk_toggle_button_new_with_mnemonic ("_Toggle Button");
-  gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (widget), FALSE);
+  widget = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
+  gtk_box_set_homogeneous (GTK_BOX (widget), TRUE);
+  gtk_widget_add_css_class (widget, "linked");
+  button = gtk_toggle_button_new_with_label ("Toggle");
+  gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), TRUE);
+  gtk_box_append (GTK_BOX (widget), button);
+  button = gtk_toggle_button_new_with_label ("Button");
+  gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), FALSE);
+  gtk_box_append (GTK_BOX (widget), button);
   gtk_widget_set_halign (widget, GTK_ALIGN_CENTER);
   gtk_widget_set_valign (widget, GTK_ALIGN_CENTER);
 


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