Commit graph

345 commits

Author SHA1 Message Date
Sam Hewitt
65b109763b Cleanup private use symbolics
- remove references to deprecated app symbolics
- reduce file size of private-use icons
- update dated icons
2022-02-04 18:12:41 +00:00
Jakub Steiner
13376ecb8b Add individual app icons 2022-01-31 14:08:22 +00:00
Bastien Nocera
fa01d3f10a power: Add scenario for a 2nd non-charging laptop battery 2022-01-27 02:52:20 +00:00
Bastien Nocera
6c6d9f4f38 power: Fix launching upower from scenario tester
Not everyone would have upower built under jhbuild, so use the system
one if we can't find it.
2022-01-27 02:52:20 +00:00
Georges Basile Stavracas Neto
07e3f5c3f3 power: Add go-next-symbolic icon to automatic suspend row
See https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/1587
2022-01-21 16:13:21 +00:00
Georges Basile Stavracas Neto
0ab20af9ba panels: Switch to CcPanel content
Start porting panels to the new panel format. This commit
temporarily makes panels have two titlebar, which will be
fixed soon.
2022-01-20 02:23:42 +00:00
Bastien Nocera
595f04ea12 power: Remove ad-hoc UI debugging ifdef's
Remove the static UI debugging tools in the power panel code, and use
the scenario tester instead.
2022-01-18 16:06:15 +01:00
Bastien Nocera
bcf2d54772 power: Add helper to launch the Power Settings in scenarios
This helper tool launches the Power Settings panel in a fake
environment, making it easy to test the UI in different scenarios. The
tool allows:
- cycling through power-profiles-daemon degraded performance reasons
- adding and removing a laptop battery, keyboard, mouse or UPS

UPS support needs umockdev 0.17.4 to work correctly
2022-01-18 16:06:15 +01:00
Bastien Nocera
bd4c27e7ab power: Remove support for power-profiles-daemon < 0.9.0 2022-01-14 13:46:50 +00:00
Jan Beich
37b29c32cb meson: drop unused argument for i18n.merge_file()
Ignored in Meson < 0.60.0, deprecated since 0.60.1 and fatal since 0.61.0.

panels/applications/meson.build:10:5: ERROR: Function does not take positional arguments.
panels/background/meson.build:10:5: ERROR: Function does not take positional arguments.
panels/camera/meson.build:10:5: ERROR: Function does not take positional arguments.
[...]
2022-01-07 17:22:43 +00:00
Christopher Davis
981a8cea7b panels: Use .boxed-list instead of .content
The `.content` style class is deprecated in favor
of the `.boxed-list` style class, which is named
after the design pattern it's used for.
2021-12-16 12:52:44 -08:00
Georges Basile Stavracas Neto
a0d49cb3a8 power: Port to GTK4
Extra care was needed for the combo boxes, and the way we currently
use GtkStringList is kind of hacky, but overall things seem to be
working fine.
2021-12-14 22:34:21 -03:00
Frédéric Péters
667af4f521 power: Use translated strings for power button action behaviors
Fixes: #1476
2021-09-29 17:58:46 +00:00
Bastien Nocera
2b7cccf13b power: Update power profile labels
Use "Balanced" instead of "Balanced Power", and make sure to add a
context for all the profiles for translators.

https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/4530#note_1243075
2021-08-09 13:31:12 +00:00
Bastien Nocera
e4c496158e power: Change "Balanced" power profile label
https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/4530#note_1241985
2021-08-05 15:28:02 +02:00
Allan Day
8fb8a340bf power: Align power profile info boxes with profiles text
See https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/1421
2021-08-05 15:28:02 +02:00
Bastien Nocera
19fb4e4a0c power: Remove icons from power profiles
They were originally included was to educate users about what the icons
mean, for when they appeared in the top bar. However, since we no
longer plan on showing the status icon in the top bar, it's not so
important that people learn the meaning of the icons.

See https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/1421
2021-08-05 15:28:02 +02:00
Bastien Nocera
7b21494774 power: Dim the info box icon
This brings less focus to the icon and more to the text.

See https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/1421
2021-08-05 15:28:02 +02:00
Bastien Nocera
dafbd54fe0 power: Update and add subtitle to automatic brightness row
As per:
https://gitlab.gnome.org/GNOME/gnome-control-center/-/merge_requests/1020#note_1210702
2021-07-28 11:55:34 +00:00
Bastien Nocera
3a289fe502 power: Remove unused CcBrightnessScale 2021-07-28 11:55:34 +00:00
Bastien Nocera
bb30b04ed6 power: Remove Brightness scales
From https://gitlab.gnome.org/GNOME/gnome-control-center/-/merge_requests/1020#note_1211728
"
They are out of place - fine-grained control over brightness isn't what the
power settings are for. As a result, they confuse the settings overall.

In both cases we have alternative controls, through keyboard hot keys or
through the shell's screen brightness slider.
"
2021-07-28 11:55:34 +00:00
Bastien Nocera
fd53f569f1 power: Tweak labels in "Power Saving Options" section
To match the latest mockups.

The lack of subtitles for most of the items in that section made the
section look pretty bizarre.
2021-07-28 11:55:34 +00:00
Bastien Nocera
f03cf178dd power: Remove Bluetooth power switch button
See previous commit.
2021-07-28 11:55:34 +00:00
Bastien Nocera
2f2ea3aed6 power: Remove Wi-Fi and WWAN "power saving" toggles
It's pretty clear from their experiences on smartphones that our users
know that Wi-Fi and other wireless technologies use enough battery that
turning them off is a power saving move.

The switches and text were also pretty confusing as we would be turning
"off" the devices to turn "on" the power saving.
2021-07-28 11:55:34 +00:00
Bastien Nocera
93cf2405ee power: Fix logic when showing profile holds
A logic error meant that the power profiles info boxes container
would not be shown if there wasn't a "degraded" performance as well.

Spotted by Allan Day
2021-07-27 15:49:26 +02:00
Bastien Nocera
1144db552e power: Add UI for "power-saver profile when battery is low"
See https://gitlab.gnome.org/GNOME/gnome-settings-daemon/-/merge_requests/247
2021-07-26 18:53:20 +02:00
Bastien Nocera
738c15be66 power: Fix D-Bus proxy leak 2021-07-21 13:53:59 +00:00
Bastien Nocera
98b921b46f power: Reword lap mode info message
Reword the lap mode info message slightly as the performance mode might
not have been what the user requested, but the warning should stay until
cleared nonetheless.
2021-07-20 00:51:48 +02:00
Bastien Nocera
06d110a3d0 power: Tweak power profile info boxes horizontal spacing
A bit too much whitespace around the info icon.
2021-07-20 00:51:48 +02:00
Bastien Nocera
c0ce1e53ab power: Show power profile info boxes for profile holds
Applications can request that power-profiles-daemon "hold" a particular
power profile for the duration of a task or event, such as launching a
taxing application, or saving power because of low battery.

Show those holds in the same type of info boxes we already use to show
"degraded" performance.

See https://gitlab.freedesktop.org/hadess/power-profiles-daemon/-/merge_requests/46
2021-07-20 00:51:48 +02:00
Bastien Nocera
05997b424c power: Move variant_lookup_string() helper function 2021-07-20 00:51:48 +02:00
Bastien Nocera
eda473f0d6 power: Prepare for adding more power profile info boxes
Rename and re-indent the code that adds the power profile info boxes to
prepare for adding more info boxes when needed.
2021-07-20 00:51:48 +02:00
Bastien Nocera
9724d3ef59 power: Handle new power-profiles-daemon API
Handle the new PerformanceDegraded property to replace
PerformanceInhibited.
2021-07-15 22:14:06 +02:00
Bastien Nocera
e5bbe4d7c6 power: Add new power profile info row widget 2021-07-15 22:14:06 +02:00
Bastien Nocera
0f86d4d754 power: Simplify emptying listbox
We do that in a few places.
2021-07-15 14:57:49 +02:00
Bastien Nocera
d35c816508 power: Fix keynav not working
gnome-control-center/panels/power/cc-power-panel.c: In function ‘keynav_failed_cb’:
gnome-control-center/panels/power/cc-power-panel.c:892:50: warning: statement with no effect [-Wunused-value]
  892 |   direction == GTK_DIR_UP ? GTK_DIR_TAB_BACKWARD : GTK_DIR_TAB_FORWARD;
      |   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~
2021-07-15 13:12:36 +02:00
Adrien Plazas
2925509472 power: Ellipsize the labels of the battery row
This helps the window fit any size, including the narrow one of phones.
2021-05-07 02:50:40 +00:00
Adrien Plazas
97ba14e002 power: Hide the icon of the battery row when unused
This gives more room to the label.
2021-05-07 02:50:40 +00:00
Adrien Plazas
a75a0f0384 power: Fix the indentation
The indentation was purposefully left incorrect in the previous commits
to ease the review of the actual changes, this fixes it.
2021-05-07 02:50:40 +00:00
Adrien Plazas
a5c0934b4d power: Use HdyPreferencesGroup 2021-05-07 02:50:40 +00:00
Adrien Plazas
6c8307faf4 power: Use HdyActionRow to simplify the code 2021-05-07 02:50:40 +00:00
Adrien Plazas
4cc4b91b4e power: Use HdyComboRow for the Power Button Behavior row
This simplifies the code a bit and modernizes the UI.
2021-05-07 02:50:40 +00:00
Adrien Plazas
3069dc84c8 power: Use HdyComboRow for the Blank Screen row
This simplifies the code a bit and modernizes the UI.
2021-05-07 02:50:40 +00:00
Adrien Plazas
f986fedf49 power: Don't set the vadjustment
This is useless as GtkScrolledwindow already does it on the viewport it
creates.
2021-05-07 02:50:40 +00:00
Adrien Plazas
5168e924cf power: Simplifies keyboard navigation
This drops the ability to loop through the page but significantly
simplifies the code. I think this is a good tradeoff as looping is a
rather unexpected behavior.
2021-05-07 02:50:40 +00:00
Bastien Nocera
9acaa10567 power: Fix possible assertion on startup
When opening the Power panel, and if power-profiles-daemon isn't already
started, we'll be autostarting it, making it send signals about all the
changed properties, including "PerformanceInhibited" even if we
don't have a Performance row.

Ignore the property change if we don't have a row for it rather than
asserting.

 #0  0x00007f73916bc292 in raise () from /lib64/libc.so.6
 #1  0x00007f73916a58a4 in abort () from /lib64/libc.so.6
 #2  0x00007f7393203ccc in g_assertion_message.cold () from /lib64/libglib-2.0.so.0
 #3  0x00007f739325f22f in g_assertion_message_expr () from /lib64/libglib-2.0.so.0
 #4  0x000055a4099e28ae in performance_profile_set_inhibited (self=0x55a40b37e320, self=0x55a40b37e320, performance_inhibited=<optimized out>) at ../panels/power/cc-power-panel.c:1366
 #5  power_profiles_properties_changed_cb (self=0x55a40b37e320, changed_properties=<optimized out>, invalidated_properties=<optimized out>, proxy=<optimized out>) at ../panels/power/cc-power-panel.c:1425
 #6  0x00007f7393332c2f in g_closure_invoke () from /lib64/libgobject-2.0.so.0
 #7  0x00007f739334eea6 in signal_emit_unlocked_R () from /lib64/libgobject-2.0.so.0

1362	{
1363	  CcPowerProfileRow *row;
1364
1365	  row = self->power_profiles_row[CC_POWER_PROFILE_PERFORMANCE];
1366	  g_assert (row != NULL);
1367	  cc_power_profile_row_set_performance_inhibited (row, performance_inhibited);
1368	}
2021-03-31 11:12:17 +02:00
Benjamin Berg
58c4a39af1 power: Fix crash when power proxy becomes ready after finalize
While the code was using the pattern to cancel the operation, it was
still resolving the user_data pointer even in the case the operation has
been cancelled.

Fix this by simply moving the initialization.

Fixes: #1260
2021-02-16 15:44:22 +01:00
Robert Ancell
2dbab9d4fa power: Use GtkBuilder for CcPowerProfileRow 2021-01-06 20:02:46 +00:00
Robert Ancell
ab621482e8 power: Remove properties and use simpler constructor 2021-01-06 20:02:46 +00:00
Robert Ancell
edec4b6575 power: Use self variable naming style 2021-01-06 20:02:46 +00:00