Commit graph

7971 commits

Author SHA1 Message Date
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
Maximiliano Sandoval R.
f374c62b81 ce-page-ethernet: Port to AdwBin
We add a scrolled window.
2023-11-29 17:35:16 +00:00
Maximiliano Sandoval R.
665288a47c ce-page-wifi: Port to AdwBin
We add a scrolled window.
2023-11-29 17:35:16 +00:00
Maximiliano Sandoval R.
4f8789c466 ce-page-security: Port to AdwBin
We add a scrolled window.
2023-11-29 17:35:16 +00:00
Maximiliano Sandoval R.
15694399dd ce-8021x-security-page: Port to AdwBin
We add a scrolled window.
2023-11-29 17:35:16 +00:00
Maximiliano Sandoval R.
9f86405bdd connection-editor: Add suggested action to button 2023-11-29 17:35:16 +00:00
Ian Douglas Scott
0e91d89a81 mouse: Add option to allow using touchpad with keyboard
Reference: https://gitlab.gnome.org/Teams/Design/settings-mockups/-/blob/master/mouse-and-touchpad/mouse-and-touchpad.png

Closes https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/125
2023-11-29 18:07:22 +01:00
Automeris naranja
f3ae59023c universal-access: Describe better what the "Accessibility Menu" option does
When enabling some a11y options, the a11y menu is automatically
shown in the shell top bar, even when the "Accessibility Menu"
option is disabled. Change the option name to
"Always Show Accessibility Menu" to avoid misunderstandings.

Closes https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/2690
2023-11-29 16:13:14 +00:00
Felipe Borges
6719b7ae36 system: Use toggle buttons for Time Format setting
Fixes #798
2023-11-29 16:46:07 +01:00
Felipe Borges
80c0cf33ec apps: Use "computer-fail-symbolic" instead of Software icon
This icon gets shown when an app cannot be found in the App search.

This change makes us rely on an icon that is part of the theme
instead of assuming gnome-software is properly installed and the
org.gnome.Software-symbolic is available in the system.

Fixes #2561
2023-11-29 12:41:20 +01:00
Jonathan Kang
f0d04a180f network-connection-editor: Close the editor when nm-connection-editor exits
Previously, when editing a connection that doesn't have native editor
support, nm-connection-editor is spawned to do the work. But after
closing nm-connection-editor, an empty editor dialog still exists.

Fix that in this commit.
2023-11-29 10:28:18 +00:00
Felipe Borges
1c9c6805a5 privacy: Make firmware page visibility check cancellable
So that the page doesn't crash when closing the panel before the
firmware page visibility has been set.
2023-11-29 10:23:51 +00:00
Felipe Borges
0263993642 privacy: Make Bolt page visibility check cancellable
When the Bolt page gets disposed before it finishes initializing
its client object we get a crash. See #2700

A way to trigger the crash is to switch panels fast enough so that
the sync dbus call is not finished by the time the panel is disposed.

This is not a guaranteed fix since I can't reproduce the issue
consistently.
2023-11-29 10:23:51 +00:00
Automeris naranja
1ae2c5295c apps: Mimic AdwStatusPage when showing "No Apps Found"
AdwStatusPage can't be used here, because an
unwanted scrollbar would appear inside of it.
See https://gitlab.gnome.org/GNOME/libadwaita/-/issues/697
2023-11-29 10:17:47 +00:00