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
In case fractional scaling is enabled, depending on the resolution,
mutter may advertise many fractional scaling values which are way more
than MAX_SCALE_BUTTONS, making impossible to use higher fractional
scaling values in high dpi setups.
So, in case scaling is possible, show them as buttons if they fit the
buttons limit, otherwise fallback to a combo box that is consistent with
the rest of the UI and will allow to use any valid scaling value.
In the front-end we define a minimum size and then we check every time
we iterate through resolutions or scales if such mode is valid.
Since the configuration won't change, we can just filter the invalid
values once when the minimum allowed size is set, so that we can be sure
that the returned scales list is always matching the ones appliable for
the current mode.
The only edge case is when using a cloned configuration, as in this case
the values need to be applied to all the monitors.
However, since we already return a reffed GArray we can just create a
temporary one in this case where unappliable scales are skipped.
As per this we can just use around the scales array length as the number
of visible buttons.
It's just a nicer api and allows us to avoid having to count all the
elements around or to expose the size via an out value.
Given this is a private API anyway there's no risk for modifying the
array, so it's something safe to use anyways.
The "Add..." toolbar button on the printers panel is currently hidden until the panel is unlocked.
This commit makes the button visible but insensitive when the panel is locked (becoming sensitive when unlocked),
as suggested in #1213. It also changes the text from "Add..." to "Add Printer..."
and updates the subtitle in the infobar to "Unlock to Add Printers and Change Settings."
These changes make the button's UI consistent with the Accounts panel's "Add User..." toolbar button.
Closes#1213
Make the logo non-square by setting its pixel size to -1. If (or when)
scaling the logo down is needed, we should instead use GtkIconTheme to
load the backing pixbuf, and use it to populate the GtkImage.
When loading the LOGO icon name from /etc/os-release, append -text to
prefer a textual variant of the logo if it exists, and -dark if the
theme variant is dark.
This allows distributors to ship textual and dark variants of their
logos without adding more fields to /etc/os-release, or more code
specific to logo handling for specific distributions.
$LOGO: default icon
$LOGO-dark: default icon when dark theme is used
$LOGO-text: icon with text
$LOGO-text-dark: icon with text when dark theme is used
This should avoid issues where this setting is changed just by opening
Gnome Control Center, as reported in
https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/918
This should also mean someone can tweak the settings as desired outside
Gnome Control Center, and not have them clobbered unless they open the
dialog in g-c-c.