Using `g_clear_handle_id()` in combination with `g_source_remove()` can
save a lot of boiler plate code.
This removes about 110 lines of code for free.
Ditch GtkListBox and use AdwActionRow to display
the key options, adding them directly to the
preferences group.
This fixes two issues:
- Orca not reading the key options and their states
- The xkb-modifier-dialog rows looking inconsistent
with other rows with radio buttons, such as the ones
from the Multitasking and Keyboard panels
Also, remove visible=true from the AdwActionRow,
since GTK4 shows all widgets by default.
The search entry is way too big, even more than
all shortcut category rows; this makes the UI
to look unbalanced. Make the search entry smaller
to fix that.
This will be consistent with the writing style used in Settings
(e.g. "Connect to Hidden Network" and "Add Printer" instead of
"Connect to a Hidden Network" and "Add a Printer" respectively).
We add a toolbar view containing a scrolled window.
- We set the margins to 12 instead of 18
- Use AdwHeaderBar
- Set minimum size and default size
- Make resizable so it fits on small screens
See https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/2624
At the moment the search entry is consuming the Escape key press, so we
have to manually tell it what to do with it.
We clear the search on the first press, if there is input, and close the
window otherwise.
I used the wrong value here.
This should have been caught by an unused variable warning, but
gnome-control-center has so many build warnings that nobody will ever
notice a new one....
Fedora's anaconda wants to know the current input source separately from
the configured input sources. Installing the configured input sources in
the order they are configured is good, but not good enough because only
the currently-active input source at the time the LUKS passphrase is
entered can be used to decrypt the disk post-install, so anaconda needs
a way to know what the active input source is. Currently, there is no
way to find this. For example:
* User has English (US) input source configured by default
* User adds Czech input source
* User reorders Czech input source to be first in the list
In this scenario, the Czech input source is first in the list, but
English is still the currently-active input source, and there's no way
to know this. Only the mru-sources setting can indicate the active input
source, but because the active input source has never been changed,
mru-sources still has its default value.
The key to fixing this is that if mru-sources holds its default value,
then the user has never changed input sources before, and the first
input source that is previously configured is therefore the most recently
used. So we can copy the previous value of the sources setting to
mru-sources, and then applications can trust that either (a) mru-sources
will indicate the current input source, or (b) the current input source
is the first configured input source if mru-sources is empty.
https://bugzilla.redhat.com/show_bug.cgi?id=2231085
AdwNavigationView is a new widget meant to be used specifically
for navigation, unlike AdwLeaflet which was multipurpose.
AdwNavigationView provides a cleaner API, and when used in
conjuction with the new AdwToolbarView widget we get automatic
titles, back buttons, gestures, actions, and window controls.
In addition, AdwToolbarView provides a new style with flat headers
and an undershoot.
This commit ports the keyboard shortcut dialog to use both of
these new widgets, allowing us to simplify our navigation.
As described in #2565, the "Move Up" and "Move Down" popover menu options
are currently displayed for all input rows in the list, doing nothing if clicked
when a row is at the top or bottom of the list respectively. This commit adds
checks when creating and moving the input rows and disables these options at the
top and bottom of the list respectively, removing a useless menu option.
Fixes#2565
When editing shortcut key combination and this new combination already
exists in another shortcut, a message (new_shortcut_conflict_label) is
shown, but when clicking on the reset button (reset_custom_button) the
elements Name, Command and Shortcut skip.
It turned out that these jumps were due to the current values of the
width_chars and max_width_chars properties of the new_shortcut_conflict_label
element. So by setting these properties to zero the jumps don't occur.