Commit graph

7984 commits

Author SHA1 Message Date
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
Automeris naranja
5387d76a50 datetime-page: Fix AM/PM button mnemonic
It was using the letter A, which is also used
by the Date row.
2023-12-02 17:31:35 -03:00
Felipe Borges
3a40e95dcf system: Bind Remote Desktop gsetting state to widgets
So that the main switch and the page summary are updated when the
backend changes.

With this, the UI reacts to external calls such as
`grdctl rdp enable`.
2023-11-30 12:38:14 +00:00
Felipe Borges
80d476d9d7 system: Update subtitle of Remote Desktop row earlier
The Remote Desktop page subtitle was updated asynchronously when
the System panel was loaded but after the following steps:

1. Connection established to `org.gnome.SettingsDaemon.Sharing`
(handled on `sharing_proxy_ready`).
2. Then a check whether Remote Desktop is available by watching
the `org.gnome.Mutter.RemoteDesktop` bus name appear.
3. Then we are finally populating the UI (and updating the
subtitle).

Now we bypass the panel initialization and check directly for the
"enable" state of the backend GSetting and the availability of the
gnome-remote-desktop.service, using `is_remote_desktop_enabled()`.

Fixes #2772
2023-11-30 12:38:14 +00:00
velsinki
0427e160bd network: Hexpand connection editor routes labels
Commit ef644deb made the routes labels for the IPv4 and IPv6 center
properly. However, when stretching the dialog, this centering is lost
because the labels do not horizontally expand.

So let's make all of them horizontally expand.
2023-11-30 09:41:49 +00:00
Kevin Bullock
f19a7abf59 keyboard: Add Left Ctrl to Compose Key options 2023-11-29 19:37:47 +00:00
Automeris naranja
2303cd1e2c mouse: Fix "Disable Touchpad While Typing" option being inverted
This option was previously called "Allow Using Keyboard With Touchpad".
Since option label was saying "allow", the switch state needed to be reversed.
Now that the option is called "Disable Touchpad While Typing" again,
the switch state is inverted and, thus, incorrect. Fix that.
2023-11-29 17:44:10 +00:00
Maximiliano Sandoval R.
200cac0970 connection-editor: Remove default size
In the previous commits we added scrolled windows on all pages, these
scrolled windows propagate their natural size and hence the dialog will
try to present itself with that size.

By having all pages inside of a scrolled window we can now use the
connection editor on mobile devices.

Fixes: https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/2764
2023-11-29 17:35:16 +00:00
Maximiliano Sandoval R.
b291e98c00 ce-vpn-page: Add a scrolled window
We wrap the contents of the page in a scrolled window.
2023-11-29 17:35:16 +00:00
Maximiliano Sandoval R.
f37e284ae4 ce-ip6-page: Remove comments 2023-11-29 17:35:16 +00:00
Maximiliano Sandoval R.
e85f094184 ce-ip6-page: Propagate natural size of content
We remove hscrollbar-policy=never. This can only work if the view is
adaptive. This has to be restored once the page is adaptive.
2023-11-29 17:35:16 +00:00
Maximiliano Sandoval R.
4fade06a02 ce-ip4-page: Propagate natural size of content
We remove hscrollbar-policy=never. This can only work if the view is
adaptive. This has to be restored once the page is adaptive.
2023-11-29 17:35:16 +00:00
Maximiliano Sandoval R.
3b3ca34a57 ce-wireguard: Propagate natural size of content
We remove hscrollbar-policy=never. This can only work if the view is
adaptive. This has to be restored once the page is adaptive.
2023-11-29 17:35:16 +00:00
Maximiliano Sandoval R
15844ddefe ce-page-details: Port to AdwBin
We add a scrolled window.
2023-11-29 17:35:16 +00:00