Repository navigation
Conversation
8ae12b5 to
908399e
Compare
908399e to
8a12a7c
Compare
leolost2605
left a comment
There was a problem hiding this comment.
Works great with elementary/gala#2916 thanks! I left a few comments
| private void populate_list () { | ||
| for (int i = 0; i < brightness_manager.get_n_monitors (); i++) { | ||
| if (i != 0) { | ||
| list_box.append (new Gtk.Separator (Gtk.Orientation.HORIZONTAL) { |
There was a problem hiding this comment.
You can just use Gtk.ListBox.show_separators for this
There was a problem hiding this comment.
Hmm maybe even no separators would work? Since it belongs to the same group of controls I think it would make sense to have no separators. @elementary/ux any opinions?
ceb59d7 to
58955ad
Compare
58955ad to
be83482
Compare
So there would be no warning when we are trying to scroll on top of indicator while there is no suitable monitors with brightness control
be83482 to
3b4e913
Compare
leolost2605
left a comment
There was a problem hiding this comment.
A few nits apart from that LGTM :)
| /* | ||
| * Copyright (c) 2011-2018 elementary LLC. (https://elementary.io) | ||
| * | ||
| * This program is free software; you can redistribute it and/or | ||
| * modify it under the terms of the GNU General Public | ||
| * License as published by the Free Software Foundation; either | ||
| * version 2 of the License, or (at your option) any later version. | ||
| * | ||
| * This program is distributed in the hope that it will be useful, | ||
| * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| * General Public License for more details. | ||
| * | ||
| * You should have received a copy of the GNU General Public | ||
| * License along with this program; if not, write to the | ||
| * Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, | ||
| * Boston, MA 02110-1301, USA. | ||
| */ |
There was a problem hiding this comment.
You should use the new license header here like you do elsewhere
| /* | |
| * Copyright (c) 2011-2018 elementary LLC. (https://elementary.io) | |
| * | |
| * This program is free software; you can redistribute it and/or | |
| * modify it under the terms of the GNU General Public | |
| * License as published by the Free Software Foundation; either | |
| * version 2 of the License, or (at your option) any later version. | |
| * | |
| * This program is distributed in the hope that it will be useful, | |
| * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| * General Public License for more details. | |
| * | |
| * You should have received a copy of the GNU General Public | |
| * License along with this program; if not, write to the | |
| * Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, | |
| * Boston, MA 02110-1301, USA. | |
| */ | |
| /* | |
| * Copyright 2026 elementary, Inc. (https://elementary.io) | |
| * SPDX-License-Identifier: GPL-3.0-or-later | |
| */ |
| if (gala_brightness_manager == null) { | ||
| return false; | ||
| } | ||
|
|
||
| return true; |
There was a problem hiding this comment.
| if (gala_brightness_manager == null) { | |
| return false; | |
| } | |
| return true; | |
| return gala_brightness_manager != null; |
| if (get_n_monitors () <= 0) { | ||
| return false; | ||
| } | ||
|
|
||
| return true; |
There was a problem hiding this comment.
| if (get_n_monitors () <= 0) { | |
| return false; | |
| } | |
| return true; | |
| return get_n_monitors () > 0; |
| brightness_manager.notify["has-monitors"].connect ((s, p) => { | ||
| update_device_separator_revealer (); | ||
| }); |
There was a problem hiding this comment.
| brightness_manager.notify["has-monitors"].connect ((s, p) => { | |
| update_device_separator_revealer (); | |
| }); | |
| brightness_manager.notify["has-monitors"].connect (update_device_separator_revealer); |
| /* | ||
| * Copyright 2011-2021 elementary, Inc. (https://elementary.io) | ||
| * | ||
| * This program is free software; you can redistribute it and/or | ||
| * modify it under the terms of the GNU General Public | ||
| * License as published by the Free Software Foundation; either | ||
| * version 2 of the License, or (at your option) any later version. | ||
| * | ||
| * This program is distributed in the hope that it will be useful, | ||
| * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| * General Public License for more details. | ||
| * | ||
| * You should have received a copy of the GNU General Public | ||
| * License along with this program; if not, write to the | ||
| * Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, | ||
| * Boston, MA 02110-1301, USA. | ||
| */ |
There was a problem hiding this comment.
| /* | |
| * Copyright 2011-2021 elementary, Inc. (https://elementary.io) | |
| * | |
| * This program is free software; you can redistribute it and/or | |
| * modify it under the terms of the GNU General Public | |
| * License as published by the Free Software Foundation; either | |
| * version 2 of the License, or (at your option) any later version. | |
| * | |
| * This program is distributed in the hope that it will be useful, | |
| * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| * General Public License for more details. | |
| * | |
| * You should have received a copy of the GNU General Public | |
| * License along with this program; if not, write to the | |
| * Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, | |
| * Boston, MA 02110-1301, USA. | |
| */ | |
| /* | |
| * Copyright 2026 elementary, Inc. (https://elementary.io) | |
| * SPDX-License-Identifier: GPL-3.0-or-later | |
| */ | |
| }; | ||
|
|
||
| if (index == 0) { | ||
| monitor_label.set_text (_(@"$(monitor_label.get_text ()) (Primary)")); |
There was a problem hiding this comment.
| monitor_label.set_text (_(@"$(monitor_label.get_text ()) (Primary)")); | |
| monitor_label.set_text (_("%s (Primary)").printf (monitor_label.get_text ())); |
| monitor_label.set_text (_(@"$(monitor_label.get_text ()) (Primary)")); | ||
| } | ||
|
|
||
| brightness_slider = new Gtk.Scale.with_range (Gtk.Orientation.HORIZONTAL, 0, 1, 0.1) { |
There was a problem hiding this comment.
We usually leave the namespace away if it's not necessary
| brightness_slider = new Gtk.Scale.with_range (Gtk.Orientation.HORIZONTAL, 0, 1, 0.1) { | |
| brightness_slider = new Gtk.Scale.with_range (HORIZONTAL, 0, 1, 0.1) { |
| width_request = 175 | ||
| }; | ||
|
|
||
| var slider_box = new Granite.Box (Gtk.Orientation.VERTICAL, Granite.Box.Spacing.NONE) { |
There was a problem hiding this comment.
| var slider_box = new Granite.Box (Gtk.Orientation.VERTICAL, Granite.Box.Spacing.NONE) { | |
| var slider_box = new Granite.Box (VERTICAL, NONE) { |
| slider_box.append (monitor_label); | ||
| slider_box.append (brightness_slider); | ||
|
|
||
| var box = new Granite.Box (Gtk.Orientation.HORIZONTAL, Granite.Box.Spacing.HALF) { |
There was a problem hiding this comment.
| var box = new Granite.Box (Gtk.Orientation.HORIZONTAL, Granite.Box.Spacing.HALF) { | |
| var box = new Granite.Box (HORIZONTAL, HALF) { |

Fixes #296
Requires elementary/gala#2916