Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

SwitchModelButton: wrap label #729

Merged
merged 2 commits into from
Jul 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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