Commit graph

418 commits

Author SHA1 Message Date
Alberts Muktupāvels
ea47caa533
keyboard: restore _GNOME_WM_KEYBINDINGS support
Before d7e794e7ab Keyboard Shortcuts dialog showed keybindings
for current WM. This commit restores this functionality.
2022-03-07 17:46:37 +02:00
Christopher Davis
9a2cd1b5d2 keyboard: Don't dim input chooser icons
We generally don't dim icons in rows anymore.
2022-02-13 13:33:25 +00:00
Christopher Davis
4ccf6e670b keyboard: Adjust input chooser widgetry
Adjusts the widgetry of the input chooser to clamp
the list and add a separator between the search bar
and the list.

The list's shadow is no longer clipped, and keyboard
navigation now scrolls.
2022-02-13 13:33:25 +00:00
Christopher Davis
cd4dd18f52 keyboard: Handle keynav-failed on input source list
Fixes keynav with arrows between the input list
group and other groups.
2022-02-13 13:33:25 +00:00
Christopher Davis
1a3971fdbe keyboard: Allow input list rows to manage their own size
Using GtkSizeGroup causes weird jumping,
and size groups generally should not be used for
boxed list rows.
2022-02-13 13:33:25 +00:00
Christopher Davis
ced8c1cb99 keyboard: Use GAction and GMenuModel for input row popovers
Gives these menus proper styling without having to
roll our own widgets.

Also removes the Remove button when the action is
disabled.
2022-02-13 13:33:25 +00:00
Christopher Davis
530fbac68e keyboard: Subclass AdwActionRow for InputRow 2022-02-13 13:33:25 +00:00
Christopher Davis
485dd456bb keyboard: Use AdwActionRow for input switch rows 2022-02-13 13:33:25 +00:00
Christopher Davis
84becfbd80 keyboard: Use AdwPreferences{Page,Group} 2022-02-13 13:33:25 +00:00
Ivan Molodetskikh
3ecc151061 keyboard: Remove 01-screenshot.xml
Move this to gnome-shell where it belongs. See
https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2107
2022-02-12 12:18:29 +00:00
Jakub Steiner
13376ecb8b Add individual app icons 2022-01-31 14:08:22 +00:00
Ivan Molodetskikh
03299794a6 keyboard: Update screenshot key bindings
They moved from g-s-d to gnome-shell.
2022-01-27 23:00:05 +00:00
Georges Basile Stavracas Neto
0ab20af9ba panels: Switch to CcPanel content
Start porting panels to the new panel format. This commit
temporarily makes panels have two titlebar, which will be
fixed soon.
2022-01-20 02:23:42 +00:00
Jan Beich
37b29c32cb meson: drop unused argument for i18n.merge_file()
Ignored in Meson < 0.60.0, deprecated since 0.60.1 and fatal since 0.61.0.

panels/applications/meson.build:10:5: ERROR: Function does not take positional arguments.
panels/background/meson.build:10:5: ERROR: Function does not take positional arguments.
panels/camera/meson.build:10:5: ERROR: Function does not take positional arguments.
[...]
2022-01-07 17:22:43 +00:00
Sebastian Keller
b3a7a16d23 keyboard: Use gtk4 translations instead of gtk3 ones for shortcut search
Otherwise looking up shortcuts with "ctrl" in non-English locales would
fail without gtk3 installed.

Fixes: https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/1546
2021-12-17 19:27:03 +01:00
Victor Toso
8355404ed4 keyboard-shortcut-editor: fix leak of accel string
==31571== 120 bytes in 8 blocks are definitely lost in loss record 17,034 of 19,290
==31571==    at 0x484086F: malloc (vg_replace_malloc.c:380)
==31571==    by 0x4AF77A8: g_malloc (gmem.c:106)
==31571==    by 0x4D9816A: gtk_accelerator_name (gtkaccelgroup.c:1577)
==31571==    by 0x4A82D1: setup_custom_shortcut (cc-keyboard-shortcut-editor.c:364)
==31571==    by 0x4A92DF: cc_keyboard_shortcut_editor_key_press_event (cc-keyboard-shortcut-editor.c:745)
2021-12-17 09:53:41 +01:00
Victor Toso
365fb19957 keyboard-item: fix leak on unused CcKeyCombo
==31571== 288 bytes in 24 blocks are definitely lost in loss record 18,138 of 19,290
==31571==    at 0x484086F: malloc (vg_replace_malloc.c:380)
==31571==    by 0x4AF77A8: g_malloc (gmem.c:106)
==31571==    by 0x4A4119: variant_get_key_combos (cc-keyboard-item.c:475)
==31571==    by 0x4A41FD: settings_get_key_combos (cc-keyboard-item.c:498)
==31571==    by 0x4A46BE: cc_keyboard_item_load_from_gsettings (cc-keyboard-item.c:574)
==31571==    by 0x4A5BBB: append_section (cc-keyboard-manager.c:315)
==31571==    by 0x4A605D: append_sections_from_file (cc-keyboard-manager.c:431)
==31571==    by 0x4A6766: reload_sections (cc-keyboard-manager.c:568)
==31571==    by 0x4A6D68: cc_keyboard_manager_load_shortcuts (cc-keyboard-manager.c:707)
==31571==    by 0x4A2FA4: cc_keyboard_shortcut_dialog_init (cc-keyboard-shortcut-dialog.c:841)
==31571==    by 0x4A7A288: g_type_create_instance (gtype.c:1929)
==31571==    by 0x4A61CAC: g_object_new_internal (gobject.c:1945)
2021-12-17 09:53:41 +01:00
Victor Toso
7741dc1abe keyboard-manager: fix leak of section list store
==25729== 1,058 (40 direct, 1,018 indirect) bytes in 1 blocks are definitely lost in loss record 20,104 of 20,657
==25729==    at 0x484086F: malloc (vg_replace_malloc.c:380)
==25729==    by 0x4AF77A8: g_malloc (gmem.c:106)
==25729==    by 0x4B0F1E4: g_slice_alloc (gslice.c:1072)
==25729==    by 0x4B09060: UnknownInlinedFun (gsequence.c:1609)
==25729==    by 0x4B09060: g_sequence_insert_before (gsequence.c:527)
==25729==    by 0x4ED2FE7: gtk_list_store_insert (gtkliststore.c:1271)
==25729==    by 0x4A5DCE: append_section (cc-keyboard-manager.c:363)
==25729==    by 0x4A605D: append_sections_from_file (cc-keyboard-manager.c:431)
==25729==    by 0x4A6766: reload_sections (cc-keyboard-manager.c:568)
==25729==    by 0x4A6D33: cc_keyboard_manager_load_shortcuts (cc-keyboard-manager.c:706)
==25729==    by 0x4A2FA4: cc_keyboard_shortcut_dialog_init (cc-keyboard-shortcut-dialog.c:841)
==25729==    by 0x4A7A288: g_type_create_instance (gtype.c:1929)
==25729==    by 0x4A61CAC: g_object_new_internal (gobject.c:1945)
2021-12-17 09:50:57 +01:00
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