From 7e8e32c37e9bc6cd8c47d4cd4a3f2cb1618004f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danielle=20For=C3=A9?= Date: Mon, 23 Mar 2026 10:21:24 -0700 Subject: [PATCH] Demo/Controls: add more image button examples --- demo/Views/ControlsView.vala | 34 ++++++++++++++++++++++++++-------- 1 file changed, 26 insertions(+), 8 deletions(-) diff --git a/demo/Views/ControlsView.vala b/demo/Views/ControlsView.vala index 214a3a756..2583286fa 100644 --- a/demo/Views/ControlsView.vala +++ b/demo/Views/ControlsView.vala @@ -30,17 +30,35 @@ public class ControlsView : DemoPage { var destructive_button = new Gtk.Button.with_label ("Granite.CssClass.DESTRUCTIVE"); destructive_button.add_css_class (Granite.CssClass.DESTRUCTIVE); + var destructive_imagebutton = new Gtk.Button.from_icon_name ("call-stop-symbolic") { + tooltip_text = "Gtk.Button.from_icon_name () with Granite.CssClass.DESTRUCTIVE" + }; + destructive_imagebutton.add_css_class (Granite.CssClass.DESTRUCTIVE); + var suggested_button = new Gtk.Button.with_label ("Granite.CssClass.SUGGESTED"); suggested_button.add_css_class (Granite.CssClass.SUGGESTED); - var button_box = new Granite.Box (VERTICAL, HALF); - button_box.append (textbutton); - button_box.append (toggle_button); - button_box.append (back_button); - button_box.append (destructive_button); - button_box.append (suggested_button); - button_box.append (imagebutton); - button_box.append (toggle_imagebutton); + var suggested_imagebutton = new Gtk.Button.from_icon_name ("call-start-symbolic") { + tooltip_text = "Gtk.Button.from_icon_name () with Granite.CssClass.SUGGESTED" + }; + suggested_imagebutton.add_css_class (Granite.CssClass.SUGGESTED); + + var text_button_box = new Granite.Box (VERTICAL, HALF); + text_button_box.append (textbutton); + text_button_box.append (toggle_button); + text_button_box.append (destructive_button); + text_button_box.append (suggested_button); + text_button_box.append (back_button); + + var image_button_box = new Granite.Box (VERTICAL, HALF); + image_button_box.append (imagebutton); + image_button_box.append (toggle_imagebutton); + image_button_box.append (destructive_imagebutton); + image_button_box.append (suggested_imagebutton); + + var button_box = new Granite.Box (HORIZONTAL, SINGLE); + button_box.append (text_button_box); + button_box.append (image_button_box); var checkradio_header = new Granite.HeaderLabel ("Check & Radio Buttons");