From 020c661c538da572a5f9584f34510794f5473bb1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danielle=20For=C3=A9?= Date: Wed, 31 Jul 2024 10:49:34 -0700 Subject: [PATCH] SwitchModelButton: wrap label (#729) --- data/granite.metainfo.xml.in | 1 + demo/Views/ModeButtonView.vala | 2 +- lib/Widgets/SwitchModelButton.vala | 7 ++++--- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/data/granite.metainfo.xml.in b/data/granite.metainfo.xml.in index 22448f14f..5eb92d0be 100644 --- a/data/granite.metainfo.xml.in +++ b/data/granite.metainfo.xml.in @@ -32,6 +32,7 @@

Improvements:

diff --git a/demo/Views/ModeButtonView.vala b/demo/Views/ModeButtonView.vala index 0c108c243..fe6b37366 100644 --- a/demo/Views/ModeButtonView.vala +++ b/demo/Views/ModeButtonView.vala @@ -30,7 +30,7 @@ public class ModeButtonView : Gtk.Box { var switchmodelbutton = new Granite.SwitchModelButton ("Default"); - var description_switchmodelbutton = new Granite.SwitchModelButton ("With Description") { + var description_switchmodelbutton = new Granite.SwitchModelButton ("A SwitchModelButton With A Description") { active = true, description = "A description of additional affects related to the activation state of this switch" }; diff --git a/lib/Widgets/SwitchModelButton.vala b/lib/Widgets/SwitchModelButton.vala index f657d75c0..3f07f1074 100644 --- a/lib/Widgets/SwitchModelButton.vala +++ b/lib/Widgets/SwitchModelButton.vala @@ -37,11 +37,12 @@ public class Granite.SwitchModelButton : Gtk.ToggleButton { construct { var label = new Gtk.Label (text) { - ellipsize = Pango.EllipsizeMode.MIDDLE, - halign = Gtk.Align.START, + halign = START, hexpand = true, - vexpand = true, max_width_chars = 25, + vexpand = true, + wrap = true, + xalign = 0, mnemonic_widget = this };