AdwBanner is a new adaptive widget that replaces GtkInfoBar.
AdwBanner adapts better to mobile sizes and has an API
that fits with how we use infobars.
This commit changes CcPermissionInfobar to use an AdwBanner
internally instead of a GtkInfoBar. It also re-implements
part of GtkLockButton, as AdwBanner does not support adding
arbitrary widgets.
When having multiple GPUs, each GPUs are now seperated by a newline
instead of the previously used seperator: " / ".
This particular fix works ONLY for systems that use switcheroo-control.
Also, this commit allows the 'secondary_label' of 'CcListRow' to have
'lines' set to '4' and 'wrap' to 'True', along with 'hexpand'
and 'halign' set to 'True' to accommodate long strings on all labels
which previously suffered from a issue of getting truncated if
the strings are too long.
Fixes: https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/2125
We pass to the setter a const char* but we don't control the ownership
of that and it may be returned later from the property getter.
While this is not causing any crash right now, going in the inspector
and try to check the property leads to some scrambled chars which seems
an indication of a memory error.
In general the string passed to these APIs could come from anywhere and
it's not guaranteed that it's always a constant string (and in fact is
not in some cases).
Since the entry already shows an apply button, update hostname only
after the apply button is clicked. It's not required to update
hostname after every character change.
This was a hack added for libhandy-0, which is no longer required.
Also, this hack results in the switch not working when gtk animations
are turned off.
We set AM/PM label on format change in init(),
but we shall not have set the time in the editor
in init() which results in wrong label if the time
is PM.
Fix it by updating clock label after time changes
cc-common-resources.h is used by both libwidgets and liblanguage, and
so must be generated before they build. However, Meson wasn't aware
of this dependency which resulted in a race condition during build.
Conveniently, "generates_sources_dep" already contains other generated
sources used by these two libraries, so adding cc-common-resources.h
to this list is enough to declare the dependency.
AdwActionRow handles many of the properties we use
CcListRow for. We can re-use it instead of re-creating it.
CcListRow is now an AdwActionRow with three suffixes.
The `activatable-widget` is set when the switch is visible.
Since our `icon-name` property was only used for the arrow
icon, it has been replaced with a `show-arrow` property.
The `bold` property has been removed - it was only used in
one place, and it's not a pattern used in other apps.
I decided to go this route because replacing all the
instances of CcListRow with AdwActionRow directly would
end up being more code.
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)
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.
This is only the bare minimum to make everything under panels/common
build. Since these widgets are used by the main window, port them
first.
CcTimeEntry was particularly hard to port. That's because GtkEntry
is a final class now. Overall, though, I'm happy with how it turned
out to be - much cleaner, less code, more obvious.
As described in #1346, GLib 2.64 includes a g_get_os_info() function,
providing access to keys from /etc/os-release. This commit replaces calls to
gnome-control-center's custom parser (in panels/common/cc-os-release.c)
with calls to this new function, and deletes the custom parser code.
Closes#1346
The C code tries to fetch and use 'check_image', but the UI definition
calls it 'check', which throws a few warnings. Renaming it in the UI file
is easier than in the C file, so I went with the former.