Commit graph

6571 commits

Author SHA1 Message Date
Christopher Davis
161e096667 cc-notifications-panel: Use AdwActionRow
AdwActionRow handles most of what we were building
a custom row for, and what it doesn't handle we
can simply use its API for.
2022-01-06 00:51:36 +00:00
Christopher Davis
d61b5bb0b0 cc-notifications-panel: Use AdwPreferences{Page,Group}
libadwaita provides nice pre-built widgets for preferences
pages and groups. We should use them where possible.
2022-01-06 00:51:36 +00:00
Christopher Davis
e216f7f2db cc-sound-panel: Use AdwPreferencesPage and PreferencesGroup
libadwaita provides nice pre-built widgets for preferences
pages and groups. We should use them where possible.
2022-01-06 00:38:31 +00:00
Benjamin Berg
6f825cd486 network: Fix saving passwords for non-wifi connections
When validating security settings for non-wifi connections, we
temporarily create a wireless connection. Unfortunately, when this
connection is destroyed, it'll clear the stored password from the 802.1x
settings object.

Avoid this by removing the setting before the temporary connection is
destroyed.

Closes: #337
2022-01-05 23:09:45 +00:00
Jakub Steiner
8ba134fbce multitasking: make graphics work in dark mode
- more of a workaround than a solution. Getting rid of the white fills
  at the expense of clarity and style.

Fixes https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/1565
2022-01-05 22:22:57 +00:00
Robert Mader
6a4652bd35 display-config: Do not invert order when constructing modes
Mutter sends modes in descending order of preference. By reverting
the order via `g_list_prepend`, we get unintended side effects
such as choosing the least preferred refresh rate by default (if
the selected mode is not marked as preferred).

Instead of adding complex logic in several places, make sure that
the assumption of descending preference is kept by simply not
inverting the order.

Closes https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/1562
2022-01-05 22:12:13 +00:00
Christopher Davis
0af1937d4d universal-access: Inline Sound Keys dialog
This can also be replaced with a simple switch
in an AdwActionRow.
2022-01-05 22:06:37 +00:00
Christopher Davis
f4b0ac5318 universal-access: Inline Screen Reader dialog
The dialog can easily be replaced by an
AdwActionRow with a switch and a subtitle.
2022-01-05 22:06:37 +00:00
Christopher Davis
9982f30008 cc-ua-panel: Remove custom listboxes
No longer needed now that all rows handle
activation.
2022-01-05 22:06:37 +00:00
Christopher Davis
997fadf8fb cc-ua-panel: Handle row activation on individual rows
The custom listboxes serve another purpose: to handle
row activation. Instead of using a custom listbox, we
can simply listen to the `activated` signal on the
rows that don't have a switch.
2022-01-05 22:06:37 +00:00
Christopher Davis
02b9f29c44 cc-ua-panel: Use AdwActionRow for all rows
AdwActionRow simplifies activation handling for
switches, provides consistent styling and sizing,
and mnemonic handling.
2022-01-05 22:06:37 +00:00
Christopher Davis
a58fa42e1d cc-ua-panel: Use AdwPreferencesPage/AdwPreferencesGroup
The individual groups still use their own listboxes,
as the custom rows they use won't be added to
AdwPreferencesGroup's list.

See https://gnome.pages.gitlab.gnome.org/libadwaita/doc/main/class.PreferencesGroup.html#adwpreferencesgroup-as-gtkbuildable
2022-01-05 22:06:37 +00:00
Christopher Davis
6a525c861e cc-ua-panel: Remove custom keynav handling
We were using this to move between groups and scroll
the page, but that's not necessary. All we need
to do is set `scroll-to-focus` on our GtkViewport.

This commit removes the keynav-failed callback
and all associated plumbing.
2022-01-05 22:06:37 +00:00
Christopher Davis
3ee642e421 net-device-bluetooth: Use AdwActionRow and .boxed-list
This makes both the row and the list fit in better
with the rest of the page.
2021-12-29 23:28:44 -08:00
Alexander Mikhaylenko
5c903af015 background: Polish wallpaper thumbnails
Make corners rounded.

Replace selected style with an overlay check, make the close button
smaller to match. Move slideshow indicator to the lower left corner.

Set margins in css.
2021-12-20 19:51:46 +00:00
Alexander Mikhaylenko
88879951cf background: Clean up the slideshow icon
Update the unused symbolic to match the svg with a baked-in shadow,
actually use it. Bundle it in gresources instead of installing, fix the
style class name. Fix margins - the close button was overriding them.
2021-12-20 19:51:46 +00:00
Alexander Mikhaylenko
3fea98b151 background: Rename to Appearance 2021-12-20 19:51:46 +00:00
Alexander Mikhaylenko
ecd6124b91 background: Add a light/dark style switcher 2021-12-20 19:51:46 +00:00
Alexander Mikhaylenko
0aaa6f296d background: Redo the layout to match the new mockups 2021-12-20 19:51:46 +00:00
Alexander Mikhaylenko
f89976ff54 ua: Stop setting high contrast WM theme
That key is deprecated.
2021-12-20 19:51:46 +00:00
Alexander Mikhaylenko
c1f8e93636 ua: Use the new high contrast key
Keep setting gtk theme, but use the new boolean as the source of truth.
2021-12-20 19:51:46 +00:00
Christopher Davis
7f601f4698 applications: Remove use of sidebar-icon style 2021-12-17 21:36:54 +00:00
Sebastian Keller
b3a7a16d23 keyboard: Use gtk4 translations instead of gtk3 ones for shortcut search
Otherwise looking up shortcuts with "ctrl" in non-English locales would
fail without gtk3 installed.

Fixes: https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/1546
2021-12-17 19:27:03 +01:00
Colin Watson
14a2672e28 datetime: Fix handling of Irish timezone on map
The timezone map tries to highlight regions of the world that keep the
same time, approximating this by their non-daylight-savings UTC offset.
There's no reasonable API for this, and it goes wrong in various cases,
such as Irish Standard Time which is legally defined as the country's
summer time with a negative DST offset in winter.

Hardcoding this is unpleasant, but there doesn't seem to be a better
solution, and in any case there's already similar hardcoding implied by
the segmented map images in panels/datetime/data/timezone_*.png.  I've
tried to make it practical to fix other similar disagreements between
the detected offset and the groupings implied by map images, though for
now I've conservatively fixed only the case I'm familiar with.

Fixes: #1341
2021-12-17 14:49:24 +00:00
Colin Watson
1b874509a4 datetime: Remove tzname_daylight
The code that set it could only ever have worked by luck in some
timezones on some systems, and there's no API to obtain the information
we were trying to store in it.  Nothing uses it, so there's no point
trying to fix it.

tzname_normal is also unused, but slightly useful for debugging, so
rename it to tzname but otherwise keep it in place.
2021-12-17 14:48:45 +00:00
Victor Toso
8355404ed4 keyboard-shortcut-editor: fix leak of accel string
==31571== 120 bytes in 8 blocks are definitely lost in loss record 17,034 of 19,290
==31571==    at 0x484086F: malloc (vg_replace_malloc.c:380)
==31571==    by 0x4AF77A8: g_malloc (gmem.c:106)
==31571==    by 0x4D9816A: gtk_accelerator_name (gtkaccelgroup.c:1577)
==31571==    by 0x4A82D1: setup_custom_shortcut (cc-keyboard-shortcut-editor.c:364)
==31571==    by 0x4A92DF: cc_keyboard_shortcut_editor_key_press_event (cc-keyboard-shortcut-editor.c:745)
2021-12-17 09:53:41 +01:00
Victor Toso
365fb19957 keyboard-item: fix leak on unused CcKeyCombo
==31571== 288 bytes in 24 blocks are definitely lost in loss record 18,138 of 19,290
==31571==    at 0x484086F: malloc (vg_replace_malloc.c:380)
==31571==    by 0x4AF77A8: g_malloc (gmem.c:106)
==31571==    by 0x4A4119: variant_get_key_combos (cc-keyboard-item.c:475)
==31571==    by 0x4A41FD: settings_get_key_combos (cc-keyboard-item.c:498)
==31571==    by 0x4A46BE: cc_keyboard_item_load_from_gsettings (cc-keyboard-item.c:574)
==31571==    by 0x4A5BBB: append_section (cc-keyboard-manager.c:315)
==31571==    by 0x4A605D: append_sections_from_file (cc-keyboard-manager.c:431)
==31571==    by 0x4A6766: reload_sections (cc-keyboard-manager.c:568)
==31571==    by 0x4A6D68: cc_keyboard_manager_load_shortcuts (cc-keyboard-manager.c:707)
==31571==    by 0x4A2FA4: cc_keyboard_shortcut_dialog_init (cc-keyboard-shortcut-dialog.c:841)
==31571==    by 0x4A7A288: g_type_create_instance (gtype.c:1929)
==31571==    by 0x4A61CAC: g_object_new_internal (gobject.c:1945)
2021-12-17 09:53:41 +01:00
Victor Toso
7741dc1abe keyboard-manager: fix leak of section list store
==25729== 1,058 (40 direct, 1,018 indirect) bytes in 1 blocks are definitely lost in loss record 20,104 of 20,657
==25729==    at 0x484086F: malloc (vg_replace_malloc.c:380)
==25729==    by 0x4AF77A8: g_malloc (gmem.c:106)
==25729==    by 0x4B0F1E4: g_slice_alloc (gslice.c:1072)
==25729==    by 0x4B09060: UnknownInlinedFun (gsequence.c:1609)
==25729==    by 0x4B09060: g_sequence_insert_before (gsequence.c:527)
==25729==    by 0x4ED2FE7: gtk_list_store_insert (gtkliststore.c:1271)
==25729==    by 0x4A5DCE: append_section (cc-keyboard-manager.c:363)
==25729==    by 0x4A605D: append_sections_from_file (cc-keyboard-manager.c:431)
==25729==    by 0x4A6766: reload_sections (cc-keyboard-manager.c:568)
==25729==    by 0x4A6D33: cc_keyboard_manager_load_shortcuts (cc-keyboard-manager.c:706)
==25729==    by 0x4A2FA4: cc_keyboard_shortcut_dialog_init (cc-keyboard-shortcut-dialog.c:841)
==25729==    by 0x4A7A288: g_type_create_instance (gtype.c:1929)
==25729==    by 0x4A61CAC: g_object_new_internal (gobject.c:1945)
2021-12-17 09:50:57 +01:00
Victor Toso
dac8fd64cd common: Fix leak of GUdevDevice
The add_device() check for g_udev_device_get_parent() was leaking (see
below). As this is actually used in create_device(), I'm passing it as
argument to avoid a second call to that function.

 > 34,175 (1,080 direct, 33,095 indirect) bytes in 27 blocks are definitely lost in loss record 19,729 of 19,758
 >    at 0x4A7A337: g_type_create_instance (gtype.c:1907)
 >    by 0x4A61CAC: g_object_new_internal (gobject.c:1945)
 >    by 0x4A62C7C: g_object_new_with_properties (gobject.c:2114)
 >    by 0x4A63780: g_object_new (gobject.c:1785)
 >    by 0x5EA5A6A: _g_udev_device_new (gudevdevice.c:132)
 >    by 0x4B6D24: add_device (gsd-device-manager.c:447)
 >    by 0x4B6FBF: gsd_device_manager_init (gsd-device-manager.c:517)
 >    by 0x4A7A288: g_type_create_instance (gtype.c:1929)
 >    by 0x4A61CAC: g_object_new_internal (gobject.c:1945)
 >    by 0x4A62C7C: g_object_new_with_properties (gobject.c:2114)
 >    by 0x4A63780: g_object_new (gobject.c:1785)
 >    by 0x4B7075: gsd_device_manager_get (gsd-device-manager.c:533)
2021-12-17 09:50:57 +01:00
Christopher Davis
897c641549 panels: Replace .view.frame with .boxed-list 2021-12-16 16:32:21 -08: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
Michael Catanzaro
c180aa660c network: fix critical when opening VPN details page
I was seeing this critical when opening the VPN details page:

(gnome-control-center:78888): nm-CRITICAL **: 16:26:21.689: ((src/libnm-client-impl/nm-device.c:1299)): assertion '<dropped>' failed

It probably broke in 551d72280b. The code
above and below expects self->device may be NULL, so let's add a
NULL check here.
2021-12-15 16:33:00 +00:00
Georges Basile Stavracas Neto
234d1aadb7 common: Depend on generated sources
Generated sources need to be generated before files that
use them can be built.

Add a separate dependency on them, and make the various
libraries under panels/common/ depend on these sources.
2021-12-15 11:17:57 -03:00
Alexander Mikhaylenko
04e3497fa6 background-preview: Fix a measure() infloop 2021-12-14 22:34:21 -03:00
Georges Basile Stavracas Neto
efbad6eb50 network: Port to GTK4
Boy this was hard.

To ease the pain of porting wireless-security to GTK4, add
a new WsFileChooserButton class that mimics the behavior of
a button that triggers a filechooser, as per the migration
guide suggests.

There were lots of GtkGrids, so the diff is particularly
horrendous. Sorry.

This needs serious testing before landing.
2021-12-14 22:34:21 -03:00
Georges Basile Stavracas Neto
d189a67000 flatpak: Update dependencies to GTK4 2021-12-14 22:34:21 -03:00
Georges Basile Stavracas Neto
816e6203e3 wacom: Port to GTK4
Many part of this commit were made by Carlos
Garnacho <carlosg@gnome.org>

WIP wacom: Port to GTK4

Lots of stuff missing and probably broken.

wacom: Port CcDrawingArea input to gestures

We have a handy GtkGestureStylus to use here, which avoids direct
handling of GdkEvents.

wacom: Update current stylus tracking to GtkGestureStylus

Use the ::proximity signal to notice when we are being hovered with
a tablet stylus, and look up the tool from there.
2021-12-14 22:34:21 -03:00
Georges Basile Stavracas Neto
f598fb3ed6 display: Port to GTK4 2021-12-14 22:34:21 -03:00
Georges Basile Stavracas Neto
d00cc3929e [WIP] color: Port to GTK4
This is very rough still. The calibration code
is entirely untested.
2021-12-14 22:34:21 -03:00
Georges Basile Stavracas Neto
d9d670328b background: Port to GTK4
CcBackgroundPreview required some layout changes, but
overall a pretty easy port.
2021-12-14 22:34:21 -03:00
Georges Basile Stavracas Neto
ddf6ca9952 region: Port to GTK4
An uneventful port.
2021-12-14 22:34:21 -03:00
Georges Basile Stavracas Neto
c6dd59f378 datetime: Port to GTK4
Of particular relevance, the timezone map was massively cleaned up.
It is much more pleasant to use now.
2021-12-14 22:34:21 -03:00
Georges Basile Stavracas Neto
d7e794e7ab keyboard: Port to GTK4
Drop the wm-common insanity.
2021-12-14 22:34:21 -03:00
Georges Basile Stavracas Neto
8141af469c printers: Port to GTK4
Fortunately for us GtkTreeView still operates pretty
much exactly like in GTK3. Other than that, it's a
dense junction of all that we've done so far to port
other panels.
2021-12-14 22:34:21 -03:00
Georges Basile Stavracas Neto
2b11900b0c bluetooth: Port to GTK4
This needs libgnome-bluetooth-2.0, which was recently merged.
2021-12-14 22:34:21 -03:00
Georges Basile Stavracas Neto
b81a180c4f thunderbolt: Port to GTK4
The C code of this panel is just so. damn. good. Porting it was
a breeze.
2021-12-14 22:34:21 -03:00
Georges Basile Stavracas Neto
3b6b678db9 diagnostics: Port to GTK4
A trivial one.
2021-12-14 22:34:21 -03:00
Georges Basile Stavracas Neto
f043ca3680 sharing: Port to GTK4
Again, it was easier to just switch some of the code to use
AdwActionRow, and that's what I've done in this commit.
2021-12-14 22:34:21 -03:00
Georges Basile Stavracas Neto
25edfb4a4b mouse: Port to GTK4
This one is an interesting case. It was easier to simply switch
to AdwPreferencesPage than actually port all the GtkFrames in
there.

In addition to that, the mouse test page now uses a GtkPicture
instead of a GtkImage, and the GtkDrawingArea API changes are
reflected in the code.
2021-12-14 22:34:21 -03:00
Georges Basile Stavracas Neto
2d762680d2 usage: Port to GTK4 2021-12-14 22:34:21 -03:00