Commit graph

8197 commits

Author SHA1 Message Date
Hari Rana
9ea7a1e5d6 removable-media-settings: Port to AdwSwitchRow 2024-01-08 10:01:48 +00:00
Hari Rana
afc690cb74 night-light-page: Port to AdwSwitchRow 2024-01-08 09:57:13 +00:00
Hari Rana
1367e3b1ef mouse-panel: Port to AdwSwitchRow 2024-01-08 09:53:59 +00:00
kramo
4112e30591 applications: Add padding to sandbox info button 2024-01-08 09:47:27 +00:00
Automeris naranja
dcb0231baf cc-info-entry: Use the .caption style class
Scaling the text isn't necessary here, because
the .caption style class already makes the text
small.
2024-01-08 09:42:46 +00:00
Automeris naranja
760f605bbb power: Add missing mnemonics in the automatic suspend dialog 2024-01-08 09:42:04 +00:00
velsinki
0b3c670ed4 wifi: Avoid critical warning for hotspot dialog
The CcWifiHotspotDialog is derived from GtkDialog, which is floating.
The floating reference is destroyed on closing the main window, before
the NetDeviceWifi is disposed. This causes a critical warning when the
NetDeviceWifi dispose does run, since it tries to destroy a now
non-existent window.

Fix this by sinking the floating reference, and unreffing it in the
NetDeviceWifi dispose function.

Fixes #2823
2024-01-08 09:38:55 +00:00
Alessandro Bono
67358cd529 cc-ua-seeing-page: Invert overlay scrollbars logic
Similar reasoning as in 7e42076a0a [1].
Accessibility features should be features that you enable[2]. It is odd
to see a feature enabled by default and that should be disabled in
order to improve accessibility.

[1] 7e42076a0a
[2] https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/2154#note_1600075
2024-01-08 09:30:22 +00:00
Felipe Borges
88e0a3caba mouse: Split "Scroll Method" and "Direction" into separate row groups
Per mockups in
https://gitlab.gnome.org/Teams/Design/settings-mockups/-/raw/master/mouse-and-touchpad/mouse-and-touchpad.png?ref_type=heads
2024-01-04 13:50:39 +00:00
Felipe Borges
3335985290 mouse: Add "Click method" option
Fixes #229
2024-01-04 13:50:39 +00:00
Felipe Borges
8da25aaef5 system: Replace dynamic System row subtitles with static text
Row subtitles in Settings are typically a description of the main label or setting.
You can see this in Mouse & Touchpad, Privacy, Sharing, and Wi-Fi.
For the System panel we did something a bit different and used the subtitle to show
the status of each panel.

Given the standard use of subtitles elsewhere, this feels a bit surprising which,
as a result, makes the panel harder to read. I think that a standard description
would probably also be more useful than the current labels.

Mockups https://gitlab.gnome.org/Teams/Design/settings-mockups/-/blob/master/system/system-panel.png?ref_type=heads

This also removes the thin CcSystemPage abstract class because it was
only introduced to add the support for dynamic System row subtitle. Now
this abstraction is no longer necessary.

Fixes #2776
2024-01-04 11:38:47 +00:00
Automeris naranja
45a5a1e0e7 sharing: Use AdwPreferencesPage/AdwPreferencesGroup in all dialogs 2024-01-04 11:31:04 +00:00
Bart Gravendeel
cacc2b5bef Remove use-underline property from all CCListRows 2024-01-04 10:11:35 +00:00
Jakub Steiner
fa4c6edbe0 mouse: fix edge scroll animation
- more accurate representation of the physical dimensions
  of the active area.

Fixes https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/2803
2024-01-04 10:08:18 +00:00
Alynx Zhou
cbfd3b1ad9 system/region: Prevent preview crash from accessing invalid pointer
In !2051, we switch back to real locale before setting the label text,
however, according to nl_langinfo's manpage, the returned pointer could
be invalid after switching locale or creating new locale, so the program
may crash.

To fix this, we save the result before switching locale, so we won't
access the invalid pointer after switching locale.
2024-01-04 11:23:54 +08:00
Hari Rana
a00a0fe3fd automatic-suspend-dialog: Use AdwPreferencesPage
The GtkScrolledWindow-AdwClamp-GtkBox combo would cause the dialog to horizontally move when the user resizes it to its minimum width. Furthermore, the AdwClamp used in the window wasn't using its `child` property. The dialog looks identical.
2024-01-02 15:20:47 +00:00
Automeris naranja
21d93d19df remote-desktop-page: Use an en dash in the page description 2024-01-02 08:44:15 +00:00
Automeris naranja
6a04869948 wwan: Remove object ID from the "No WWAN Adapter Found" AdwStatusPage
I copied the AdwStatusPage code from the Bluetooth panel
to make https://gitlab.gnome.org/GNOME/gnome-control-center/-/merge_requests/2082.
However, I forgot to remove the object ID from the
"No WWAN Adapter Found" AdwStatusPage.

Remove the ID to avoid future problems.
2024-01-02 08:42:35 +00:00
Automeris naranja
ae73d2d324 input-chooser: Reduce window width
The input chooser window width is unnecessarily
big, so this change reduces it to avoid unused space.
2023-12-21 09:30:06 +00:00
Automeris naranja
4d6c32c187 remote-desktop-page: Add period to the page description phrase
I forgot this in !2095.

Mockups:
https://gitlab.gnome.org/Teams/Design/settings-mockups/-/blob/master/remote-desktop/remote-desktop.png
2023-12-21 09:25:57 +00:00
Automeris naranja
05b9fcd85e location-page: Set up the page description in the C code
This will make easier to translate the strings.
2023-12-21 09:25:57 +00:00
Peter Hutterer
e53cc1f69b wacom: Mark the center-point of the stylus pressure curve 2023-12-21 09:23:49 +00:00
Peter Hutterer
815bd93943 wacom: Simplify the algorithm a bit
Now that our first and last configuration points are 0/100 and 100/0
respectively, we can simplify the calculation a bit. Doubly so because
p2 is just a mirror of p1.

That with extending the slider range to 200 means we get a value for
each integer combination on our pressurecurves - which in turn means
that for any of our generated curves we get a slider value return.
2023-12-21 09:23:49 +00:00
Peter Hutterer
b76a7e06b2 wacom: Extend the pressurecurve range by 25% in each direction
Now that we have a smooth range of curves we can extend the curve
into the maximum range we can support given 0 < x|y < 100.
2023-12-21 09:23:49 +00:00
Peter Hutterer
7814309ee9 wacom: Generate a smooth pressure curve instead of just 7
Our previously hardcoded pressurecurves follow a predictable
pattern so we can generate the value on-the-fly based on that pattern.
The slider now uses a range of 100 (integer) values and calculates the
matching pressure curve based on that. The actual pressure curve remains
the same for previous values.

However, the functions are lossy thanks to CLAMP() so figuring out
a slider position from points requires heuristics: for each of the four
coordinates we calculate a slider value. Then we calculate the points
for that slider value and if those calculated points match ours then we
have a winner.
2023-12-21 09:23:49 +00:00
Carlos Garnacho
17d8013769 common: Query Virtual core pointer for currently used tablet
This code does not work as expected in X11, since the GdkDevice
that GTK gives us is the Virtual core pointer, and not the hardware
device that is driving it at the moment.

Since there's no way to ask for this information to GTK4, query
XI2 indirectly about it, by checking the source device that the
Virtual core pointer inherited its XIValuatorClass classes from
(e.g. pressure), then querying that source device /dev node path.
2023-12-20 20:57:52 +01:00
Felipe Borges
445bc72c7c apps: Add banner indicating when an app isn't sandboxed
This uses a work around AdwBanner not having APIs for setting a
custom child on its internal GtkOverlay child.

It adds a custom widget (CcListRowInfoButton) using the GtkWidget
API and binds the widget visibility to the AdwBanner.visible
property.

This workaround ignores AdwBanner.revealed and relies on its
"visible" property so that we avoid having a "hide" animation when
switching between an app that shows the banner to one that doesn't.

An app page is static populated and the banner is supposed to be
displayed when the page loads and not later.

Fixes #2782
2023-12-20 12:03:09 +00:00
velsinki
94513252fc background: Remove bg-colors-source and refactor
The ability to choose solid colored backgrounds has been removed at
least 4 years ago, so let's remove the code for it too.

Furthermore, we slightly refactor some code to make it easier to
understand and fit better to the usual style.
2023-12-19 14:14:28 +00:00
velsinki
23e7e8466e background: Make preview sharper using CcBackgroundPaintable
Because the CcBackgroundPaintable is now reusable, it can be used inside
the preview. This allows removing lots of code, since the drawing is now
done by the paintable. Because the scale factor was previously not
handled properly, this change makes the preview much sharper on scale
factors > 1.

Fixes #704
2023-12-19 14:14:28 +00:00
velsinki
18413cb172 background: Make CcBackgroundPaintable independent
To make the CcBackgroundPaintable fully reusable, it has to know the
desired thumbnail size and the thumbnail factory. We add a width and
height property, and modify the thumbnail retrieval of CcBackgroundItem
to use the scale factor now.

This also allows us to greatly simplify the background sources, so that
they now only do one thing: provide CcBackgroundItems from different
sources.

We keep the fixed thumbnail height and width for the chooser, which
makes more sense now that it is in the chooser code instead of the
background source code.
2023-12-19 14:14:28 +00:00
velsinki
761367ac4a background: Make paintable light/dark adjustable
In order to make the CcBackgroundPaintable more reusable, the way it
draws itself either light, dark, or both needs to be adjustable. We
therefore introduce CcBackgroundPaintFlags that indicate the desired
drawing behavior.
2023-12-19 14:14:28 +00:00
velsinki
50411b206d background: Split Meson generated enums
This separates the CcBackground... enums from the GDesktop... ones,
preserving the separate namespaces.
2023-12-19 14:14:28 +00:00
velsinki
99b42130b0 wifi: Fix crash when switching to other panel after forget network
Similar to the previous crashes, if you switch panels after forgetting a
network while the toast is still alive, Settings crashes. This is
because the AdwToastOverlay is not properly disposed because the Saved
Networks dialog is also not destroyed.

However, destroying the saved networks dialog still leaves a crash,
because the overlay disposal first unreferences its child, but we still
need that for the dismissal of the waiting toasts. Therefore, we keep an
extra reference to the saved networks list.

To prevent further crashing, we cannot set "list" to NULL, because there
may be multiple async calls. Also, we have to keep a reference to self
in the async call, otherwise it does not work when you remove many
networks and then switch panels.

As an added bonus, we can now use the saved networks list inside the UI
refresh function.
2023-12-19 09:33:26 +00:00
velsinki
794d8f5135 wifi: Move Saved Network mostly to .ui and clean up
It is cleaner to define the dialog in a .ui file. Moreover, since we are
initializing the main Visible Networks list in the code, we can
initialize the Saved Networks list in the same location, in the same
style.
2023-12-19 09:33:26 +00:00
velsinki
74279db43f wifi: Clean up net-device-wifi
There is a lot of unused code for the saved networks dialog. We can
remove all of that.

We furthermore format the code a litte better.
2023-12-19 09:33:26 +00:00
velsinki
91771c4c31 wifi: Avoid casting of Adw and GTK types
This reduces some of the casting noise in the code.
2023-12-19 09:33:26 +00:00
velsinki
218adbd306 wifi: Fix crash on reopen of Saved Networks after forget
When a network is forgotten from the Saved Networks dialog and the
dialog is closed, the toast remains active. However, when you then
quickly reopen the dialog, a new CcWifiConnectionList gets made, which
causes a crash when the toast expires or is dismissed, as the row for
the toast has now become invalid.

Fix this by only setting up the CcWifiConnectionList for saved networks
once.
2023-12-19 09:33:26 +00:00
velsinki
7a4869017e wifi: Fix "forget multiple networks" crash
When forgetting more than one network from the Saved Networks dialog,
there are multiple overlapping toasts. When the first toast expires or
is dismissed, the underlying CcWifiConnectionList is already thawed,
meaning previous rows get cleaned up and new ones generated. When the
next toast then expires or is dismissed, this results in a crash, as the
row belonging to that toast is now invalid.

Fix this by freezing the connection list earlier.

Fixes #2793
2023-12-19 09:33:26 +00:00
Automeris naranja
163791a08a remote-desktop-page: Tweak the page description
Move the page description to AdwPreferencesPage, since
it's the correct place to put the page description.
Also, set up the page description in the C code to
help translators.
2023-12-15 10:51:35 +00:00
velsinki
1e8ce56887 ce-vpn-page: Fix layout of Identity page
b291e98c introduced a scrolled window, but forgot to update the C code
to use the new box instead. Now we use it correctly again.

Fixes #2795
2023-12-15 10:49:22 +00:00
Automeris naranja
5cf922a24e keyboard-shortcut-dialog: Add mnemonic to the "Reset All" button
Also, organize the properties (from the "Reset All" button)
together in the .ui file instead of mixing them with the signal name.
2023-12-14 16:46:34 -03:00
Jakub Steiner
758f87b783 data: use outline symbolics
- Use the up-to-date style for symbolics (2px outline). Notifications, Printers and Info/About
  work fine as outlines.
- filled silouehette symbolic are only to be used where a 2px outline is impossible
  to cram to 16x16px canvas.
2023-12-14 13:07:39 +00:00
Diego Iván
3e3d61078e applications: Ignore symlinks when measuring cache/data size
Some applications have symlinks that point outside of their folder
in their cache/data directories, leading to incorrect, slower
measurements. Namely, Builder has a symlink to the home directory
in its cache folder, which also contains the Builder app directory,
creating recursion and (very) wrong measurements.

By adding the `FTW_PHYS` flag to the function that traverses the
directory and measures folder size, symlinks are ignored.

Closes #2375
2023-12-12 18:39:58 -06:00
Pablo Correa Gómez
2611bc58e2 sound: fix compiler warning
Fix many warnings of the form:

../panels/sound/cc-output-test-wheel.c: In function 'cc_output_test_wheel_dispose':
../panels/sound/cc-output-test-wheel.c:155:20: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
  155 |   g_clear_pointer ((GtkWidget**) &self->front_center_speaker_button, gtk_widget_unparent);
/usr/include/glib-2.0/glib/gmacros.h:870:47: note: in definition of macro 'G_STATIC_ASSERT'
  870 | #define G_STATIC_ASSERT(expr) _Static_assert (expr, "Expression evaluates to false")
      |                                               ^~~~
../panels/sound/cc-output-test-wheel.c:155:3: note: in expansion of macro 'g_clear_pointer'
  155 |   g_clear_pointer ((GtkWidget**) &self->front_center_speaker_button, gtk_widget_unparent);
      |   ^~~~~~~~~~~~~~~
2023-12-11 15:12:00 +00:00
Pablo Correa Gómez
1bafd46ea3 wwan: fix compiler warning
Fix many warnings of the shape:

warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]

Consequence of casting the pointers during g_clear_pointer
2023-12-11 15:12:00 +00:00
Felipe Borges
f0b8dbc973 privacy: Make app icons larger in Location/Camera/Microphone pages
Fixes #1637
2023-12-11 14:03:06 +00:00
Felipe Borges
affa60edcf Revert "system: Replace dynamic System row subtitles with static text"
This reverts commit ea224c4045.

This was accidentally included in another MR.
2023-12-05 15:17:11 +01:00
Felipe Borges
9ee0795c0a notifications: Don't list system services
The current system related entries are ambiguous, as it isn't clear
what the actual notifications are.

System services should handle their own notification settings
instead.

Fixes #527
Fixes #1175
2023-12-05 14:07:13 +00:00
Felipe Borges
ea224c4045 system: Replace dynamic System row subtitles with static text
Row subtitles in Settings are typically a description of the main label or setting.
You can see this in Mouse & Touchpad, Privacy, Sharing, and Wi-Fi.
For the System panel we did something a bit different and used the subtitle to show
the status of each panel.

Given the standard use of subtitles elsewhere, this feels a bit surprising which,
as a result, makes the panel harder to read. I think that a standard description
would probably also be more useful than the current labels.

Mockups https://gitlab.gnome.org/Teams/Design/settings-mockups/-/blob/master/system/system-panel.png?ref_type=heads

This also removes the thin CcSystemPage abstract class because it was
only introduced to add the support for dynamic System row subtitle. Now
this abstraction is no longer necessary.

Fixes #2776
2023-12-05 14:07:13 +00:00
Automeris naranja
2e97cef7a8 wwan: Improve status pages design
- Use AdwStatusPage
- Use .pill and .suggested-action style classes in
the button from airplane mode status page

And use valign=center, otherwise AdwStatusPage
won't be vertically centralized.
2023-12-05 10:25:39 +00:00