Commit graph

485 commits

Author SHA1 Message Date
Ian Douglas Scott
959d530c44 keyboard: Use HdyActionRow for shortcut/category 2020-12-18 07:55:41 -08:00
Ian Douglas Scott
a7d526f70b keyboard: Display shortcut for switching input source 2020-12-18 07:55:41 -08:00
Ian Douglas Scott
a19c7c2e65 keyboard: Change wording for switch input source 2020-12-18 07:55:41 -08:00
Ian Douglas Scott
e39a2916f3 keyboard: change margins of CcInputRow to better fit keyboard panel 2020-12-18 07:55:41 -08:00
Ian Douglas Scott
f1e8f9b364 keyboard: Add margins between sections, like other panels 2020-12-18 07:55:41 -08:00
Ian Douglas Scott
a89b83c9ec keyboard: Use HdyClamp to expand similarly to other panels 2020-12-18 07:55:41 -08:00
Ian Douglas Scott
8996ffac88 Move input sources from region panel to keyboard panel 2020-12-18 07:55:41 -08:00
Ian Douglas Scott
25b12bf157 keyboard: Compose key
This was previously available only in Gnome Tweaks.
2020-12-18 07:55:41 -08:00
Ian Douglas Scott
fe173f661b keyboard: Do not call gtk_grab_{add,remove} in shortcut editor
For some reason, the ungrab was making the window impossible to interact
with. Without these calls, it seems to work as expected.
2020-12-18 07:55:41 -08:00
Ian Douglas Scott
238327e0ae keyboard: Move keyboard shortcuts configuration to a dialog window 2020-12-18 07:55:38 -08:00
Robert Ancell
7e89c293b0 keyboard: Remove unused CcKeyboardOption. 2020-12-11 18:38:04 +00:00
Robert Ancell
e09e53a8c2 keyboard: Replace g_object_new with gtk widget methods
This improves compile time type checking.
2020-10-19 04:07:53 +00:00
Ian Douglas Scott
8b7eac0a7b keyboard: replace CcAltCharsKeyDialog with a generic XkbModifierDialog
Previously, there were multiple redundant lists of possible values for
this setting. This uses one struct to define not only all the possible
values, but also anything specific to the alternate characters key, so
this can be used for other modifiers.

This also changes the style of the dialog to use a GtkListBox.
2020-10-19 04:00:32 +00:00
Ian Douglas Scott
57a0f909d4 keyboard: fix gtk_widget_get_can_default assertion error
Occured when showing the "Replace" button.
2020-09-25 03:24:59 +00:00
Ian Douglas Scott
099426714c keyboard: Fix behavior of "Replace" when adding custom shortcut
In the shortcut editor, the "Replace" button is shown instead of "Set"
or "Add" when there is a collision. But this executes the same code as
"Set", so when adding a shortcut, it doesn't actually work.
2020-09-25 03:17:29 +00:00
Ian Douglas Scott
dc02c803c2 keyboard: Move row code to CcKeyboardShortcutRow
This adds a widget called `CcKeyboardShortcutRow`, sub-classing
`GtkListBoxRow`, to handle a shortcut row. This makes the implementation
a bit tidier, rather than handling it all in `CcKeyboardPanel`, and
allows the widgets that compose the row to be laid out in xml.

This is a prerequisite for moving the shortcuts to a new dialog.
2020-09-14 17:19:33 +00:00
Ian Douglas Scott
67cb508802 keyboard: Refactoring of CcKeyboardItem handling of multiple combos
This commit includes all the changes that seem to be necessary for
CcKeyboardItem to be used for dealing with multiple keybindings, without
(yet) changing the user interface to expose this.

The `primary_combo` and `binding` fields of `CcKeyboardItem` are
removed, in favor of the existing `key_combos`. No combination is
"primary", since all of them can now be seen and changed equally.

We treat `CcKeyboardItem.key_combos` as a set, that a combo can be added
to or removed from. Though it continues to be represented as a `GList`,
instead of a `GHashTable`, to preserve ordering.

A lot of the keyboard panel code relied on the assumption that only one
combo can be set for each setting, so this required a variety of
miscellaneous changes.
2020-09-14 17:19:33 +00:00
Ian Douglas Scott
21d5e6c6e0 keyboard: make Alternate Character Key HdyActionRow activatable
libhandy made this not activatable by default, breaking this.

ef6707f6cc
2020-07-29 02:04:38 +00:00
Robert Ancell
ec2d3e2862 keyboard: Fix variable typo 2020-07-21 11:30:58 +12:00
Robert Ancell
6db24acc49 Replace whitelist/blacklist terms
For rationale see here:
https://chromium.googlesource.com/chromium/src/+/master/styleguide/inclusive_code.md#racially-neutral
2020-07-21 10:41:55 +12:00
Yuri Chornoivan
e7050ab6f4 Fix minor typos 2020-07-20 10:38:09 +03:00
Adrien Plazas
0c71793e7c Stop using the action HdyActionRow child type
It has been dropped and is now the default child type.
2020-07-20 08:04:28 +02:00
lionirdeadman
146ddd9739 Rename Universal to Accessibility
Fixes #867
Don't touch parts which are not visible
to the user as to avoid regressions
2020-07-19 21:59:22 +00:00
Ian Douglas Scott
7244bd997d keyboard: unify standard_edit_box and custom_edit_box
The redundant design here seemed awkward when I was thinking about how
to implement support for displaying multiple conflicts as needed by
https://gitlab.gnome.org/GNOME/gnome-control-center/-/merge_requests/776
and https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/1041.

This should be more maintainable.
2020-07-01 10:38:30 -07:00
Ian Douglas Scott
34883c0c33 keyboard: fix seat grabbing when setting custom shortcut
The callback `edit_custom_shortcut_button_toggled_cb()` was unused,
presumably a relic of an earlier UI design.
2020-06-29 15:25:27 -07:00
Ian Douglas Scott
0a50d2b7ec keyboard: remove CcKeyboardItem.model
No longer set without `shortcuts_model`. This wasn't being used anyway.
2020-06-29 00:19:54 +00:00
Ian Douglas Scott
44959e0049 keyboard: remove some dead code 2020-06-29 00:19:54 +00:00
Ian Douglas Scott
f5ec024035 keyboard: remove shortcuts_model
This appears to be largely vestigial code from a time when a GtkTreeView
was used here. It is very confusing, because someone reading the code
expects this to be critical to what's displayed on the screen, but it
isn't.

If I understand correctly, the only place this was still useful for
something was in `cc_keyboard_manager_remove_custom_shortcut()`, to check
that the CcKeyboardItem is valid. If I understand, this is a sanity
check that should never fail, so this seems unnecessary, and I've
removed it.

If that check is actually important, it would be better to have a
`GHashTable` of custom shortcuts, which should be simpler and clearer.

`sections_store` should similarly be removed/replaced. It seems to only
be needed in `add_shortcuts()`. But that seems like it can't just be
removed, so I haven't changed that yet.
2020-06-29 00:19:54 +00:00
Robert Ancell
1862ec50e4 keyboard: Connect signals with g_signal_connect_object in swapped form 2020-03-30 16:18:49 +13:00
Robert Ancell
ef9b0c7313 keyboard: Replace GtkStack child names with widget references
The child names are easier to break if widgets are changed - this can't be
detected by the compiler.
2020-03-30 01:49:50 +00:00
Robert Ancell
ee4d08ca1d keyboard: Use GTK widget types 2020-03-30 01:49:50 +00:00
Robert Ancell
df71952112 keyboard: Remove markup from translatable strings 2020-01-06 16:57:43 +00:00
Georges Basile Stavracas Neto
01193fb7ce keyboard: Remove stray debug messages
These sneaked in in !19. Remove them.
2019-11-11 14:34:24 -03:00
Bastien Nocera
2e99dd4f5e keyboard: Add "Alternate Characters Key" configuration
This adds an entry to select the "Level 3" selection key, which is
usually Right Alt (or Alt-Gr on a majority of keyboards).
Mockups at [1].

However, we replaced the "Left Ctrl" key option with a "Menu key"
option, as "Left Ctrl" isn't a possible XKB option for the level3 key.

[1] https://raw.githubusercontent.com/gnome-design-team/gnome-mockups/master/system-settings/keyboard/keyboard-wires.png
2019-11-11 16:19:50 +13:00
Bastien Nocera
3fe047828c keyboard: Rename listbox to shortcuts_listbox
So that we can add another listbox and not confused them.
2019-11-11 16:19:41 +13:00
Florian Müllner
eb3580ee9d media-keys: Handle 'Above_Tab' fake key
Mutter supports the 'Above_Tab' fake keysym that refers to the key
that is physically located above the tab key. It is used in the default
shortcut of the "Switch windows of an application" action.

As gtk_accelerator_parse() doesn't recognize the keysym, we display
the shortcut incorrectly as "disabled", and it is not taken into account
for conflict resolution.

Address this by translating binding that contains the 'Above_Tab' string
to bindings where the string is replaced with each possible keysym that
corresponds to the fixed keycode of KEY_GRAVE + 8.

https://gitlab.gnome.org/GNOME/gnome-control-center/issues/581
2019-09-10 13:32:08 +00:00
Robert Ancell
6fc8e57bdd keyboard: Make .ui filename match the .c filename 2019-09-09 21:58:01 +00:00
Robert Ancell
97985a664e Remove unused GNOMELOCALEDIR defines 2019-09-09 21:45:53 +00:00
Benjamin Berg
936a66f4ca keyboard: Add microphone mute key
Add the required UI for users to change the newly mic-mute keybinding.

See also https://bugzilla.gnome.org/show_bug.cgi?id=793596

https://bugzilla.gnome.org/show_bug.cgi?id=793641
2019-05-27 20:48:35 +00:00
Benjamin Berg
f972ffc569 keyboard: Clarify that mute key toggles the mute state
This is just a string change to make it clear that the mute keys toggle
the mute state rather than simply muting the volume.

https://bugzilla.gnome.org/show_bug.cgi?id=793641
2019-05-27 20:48:35 +00:00
Georges Basile Stavracas Neto
5ec241aae2 keyboard: Move "Reset All" to the start of the headerbar
https://gitlab.gnome.org/GNOME/gnome-control-center/issues/528
2019-05-21 13:00:32 -03:00
Georges Basile Stavracas Neto
75f150d5a2 shell: Add position to cc_shell_embed_widget_in_header()
So we can control where the widget should be added to. The
main window only supports left and right positions.

https://gitlab.gnome.org/GNOME/gnome-control-center/issues/528
2019-05-21 12:59:36 -03:00
Georges Basile Stavracas Neto
20b3d0c653 keyboard: Remove "Keyboard Shortcuts" section header
It's unnecessary now that we have "Keyboard Shortcuts" everywhere
else.
2019-05-21 12:09:00 -03:00
Georges Basile Stavracas Neto
9385cc78d1 keyboard: Rename panel to "Keyboard Shortcuts"
https://gitlab.gnome.org/GNOME/gnome-control-center/issues/528
2019-05-21 12:01:15 -03:00
Bastien Nocera
07485a1103 keyboard: Fix keyboard shortcut label
The instructions label says:
Press Esc to cancel or Backspace to reset the keyboard shortcut.
but the Backspace key set the shortcut to be empty, and disables the
feature. Reset is achieved clicking the button to the right handside of
the shortcut in the main window, and is only visible when the shortcut
isn't set to the default value.
2019-03-29 17:03:45 +00:00
Robert Ancell
465f096ea0 keyboard: Make .ui filename match the .c filename 2018-11-12 16:41:01 +00:00
Robert Ancell
13bfd725cd keyboard: Remove unused header file 2018-11-08 14:17:43 +13:00
Robert Ancell
bb4a9703e3 keyboard: Don't use gtk_widget_show_all
It is removed in GTK+ 4
2018-10-10 04:01:11 +00:00
Sam Hewitt
24174173be common: update pixel_size values to base 16 for icon clarity 2018-07-10 17:52:08 -04:00
Georges Basile Stavracas Neto
1b68bf1cb4 keyboard: Update code style
No functional changes were introduced. This is purely
aesthetical.
2018-05-29 13:50:17 -03:00