Commit graph

400 commits

Author SHA1 Message Date
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
Georges Basile Stavracas Neto
d7e794e7ab keyboard: Port to GTK4
Drop the wm-common insanity.
2021-12-14 22:34:21 -03:00
Andre Klapper
54a360811c Update keyboard related panel descriptions
Input Sources moved from Region & Language to Keyboard section in 40

Fixes #1447
2021-09-07 07:48:15 +00:00
Nishal Kulkarni
7bd8a4e50c keyboard: deprecation fix
Change `g_binding_get_source` to `g_binding_dup_source` in keyboard
2021-08-15 11:29:19 +00:00
Mohammed Sadiq
1fa95b5fc5 keyboard: Use content style for listboxes 2021-05-19 03:25:47 +00:00
Ian Douglas Scott
edffd1b295 keyboard: Create CcXkbModifierDialog only when 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.
2021-05-19 03:20:41 +00:00
Ian Douglas Scott
e224e5177a keyboard: Rename XkbOption and XkbModifier with Cc prefix 2021-05-19 03:20:41 +00:00
Ian Douglas Scott
3a50deb431 keyboard: Update panel layout with descriptions for sections
Changes based on mockup by @aday:
https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/1222#note_1017128
2021-05-07 03:08:11 +00:00
Claude Paroz
d0d44dd6cd keyboard: Use g_dngettext to allow pluralized 'modified' string 2021-04-13 01:31:13 +00:00
Rachit Keerti Das
fccfb52cad keyboard: Improve Empty Search State.
The empty search state looks out-of place due to it being nested inside
a listbox. This is because we can only detect empty states through
gtk_list_filter_func().

Refine it by making the empty search placeholder a child of the main stack.
Introduce an additional helper function to detect when all the listbox
rows would be hidden by the filter.

As a part of https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/1222
2021-02-12 15:41:10 +13:00
Ian Douglas Scott
252f8659c8 keyboard: Use g_type_ensure() 2021-01-11 15:19:36 -08:00
Ian Douglas Scott
621dd80ab0 keyboard: Do now call g_binding_unbind() finalizing shortcut editor
This errors and is unnecessary because the binding is removed when the
object bound is finalized.
2021-01-11 15:19:36 -08:00
Ian Douglas Scott
3fdb5f7ab2 keyboard: Correctly free references when finalizing shortcut dialog 2021-01-11 15:19:33 -08:00
Ian Douglas Scott
5e8e9c3236 keyboard: Right align shortcut
Reset button is in a `GtkRevealer` to not take up space when hidden.
2020-12-18 08:11:24 -08:00
Ian Douglas Scott
fd661a6607 keyboard: Use "+" row at end of custom shortcuts, not another box 2020-12-18 07:55:41 -08:00
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