Skip to content

Commit

Permalink
Use description for HeaderLabel
Browse files Browse the repository at this point in the history
  • Loading branch information
danirabbit committed Oct 13, 2023
1 parent 4aa69c4 commit ba9fd4a
Showing 1 changed file with 10 additions and 22 deletions.
32 changes: 10 additions & 22 deletions src/OutputPanel.vala
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,9 @@ public class Sound.OutputPanel : Gtk.Box {
balance_scale.add_mark (0, Gtk.PositionType.BOTTOM, _("Center"));
balance_scale.add_mark (1, Gtk.PositionType.BOTTOM, _("Right"));

var alerts_label = new Granite.HeaderLabel (_("Event Alerts"));
var alerts_label = new Granite.HeaderLabel (_("Event Alerts")) {
secondary_text = _("Notify when the system can't do something in response to input, like attempting to backspace in an empty input or switch windows when only one is open.")
};

var audio_alert_check = new Gtk.CheckButton.with_label (_("Play sound")) {
margin_top = 6
Expand All @@ -89,15 +91,6 @@ public class Sound.OutputPanel : Gtk.Box {
margin_top = 6
};

var alerts_info = new Gtk.Label (
_("Notify when the system can't do something in response to input, like attempting to backspace in an empty input or switch windows when only one is open.")
) {
wrap = true,
xalign = 0
};

alerts_info.add_css_class (Granite.STYLE_CLASS_DIM_LABEL);

var test_popover = new TestPopover ();

var test_button = new Gtk.MenuButton () {
Expand All @@ -107,21 +100,18 @@ public class Sound.OutputPanel : Gtk.Box {
popover = test_popover
};

var screen_reader_label = new Granite.HeaderLabel (_("Screen Reader"));
media_keys_settings = new Settings ("org.gnome.settings-daemon.plugins.media-keys");

var screen_reader_label = new Granite.HeaderLabel (_("Screen Reader")) {
secondary_text = screenreader_shortcut_label
};

var screen_reader_switch = new Gtk.Switch () {
halign = END,
valign = CENTER,
hexpand = true
};

media_keys_settings = new Settings ("org.gnome.settings-daemon.plugins.media-keys");
var screen_reader_description_label = new Gtk.Label (screenreader_shortcut_label) {
wrap = true,
xalign = 0
};
screen_reader_description_label.add_css_class (Granite.STYLE_CLASS_DIM_LABEL);

var output_grid = new Gtk.Grid () {
column_spacing = 12
};
Expand All @@ -132,16 +122,14 @@ public class Sound.OutputPanel : Gtk.Box {

var alerts_box = new Gtk.Box (VERTICAL, 0);
alerts_box.append (alerts_label);
alerts_box.append (alerts_info);
alerts_box.append (audio_alert_check);
alerts_box.append (visual_alert_check);

var screen_reader_grid = new Gtk.Grid () {
column_spacing = 12
};
screen_reader_grid.attach (screen_reader_label, 0, 0);
screen_reader_grid.attach (screen_reader_description_label, 0, 1);
screen_reader_grid.attach (screen_reader_switch, 1, 0, 1, 2);
screen_reader_grid.attach (screen_reader_switch, 1, 0);

orientation = VERTICAL;
spacing = 18;
Expand Down Expand Up @@ -183,7 +171,7 @@ public class Sound.OutputPanel : Gtk.Box {
});

media_keys_settings.changed["screenreader"].connect (() => {
screen_reader_description_label.label = screenreader_shortcut_label;
screen_reader_label.secondary_text = screenreader_shortcut_label;
});

// volume_scale.button_release_event.connect (e => {
Expand Down

0 comments on commit ba9fd4a

Please sign in to comment.