Skip to content

Commit

Permalink
SwitchModelButton: wrap label (#729)
Browse files Browse the repository at this point in the history
  • Loading branch information
danirabbit committed Jul 31, 2024
1 parent 08553ef commit 020c661
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
1 change: 1 addition & 0 deletions data/granite.metainfo.xml.in
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
<p>Improvements:</p>
<ul>
<li>Improve screen reader support for SwitchModelButton</li>
<li>Wrap long labels for SwitchModelButton</li>
<li>ValidatedEntry: set AccessibleState for validity</li>
<li>Updated translations</li>
</ul>
Expand Down
2 changes: 1 addition & 1 deletion demo/Views/ModeButtonView.vala
Original file line number Diff line number Diff line change
Expand Up @@ -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"
};
Expand Down
7 changes: 4 additions & 3 deletions lib/Widgets/SwitchModelButton.vala
Original file line number Diff line number Diff line change
Expand Up @@ -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
};

Expand Down

0 comments on commit 020c661

Please sign in to comment.