Commit graph

487 commits

Author SHA1 Message Date
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
Robert Ancell
5174ae136d keyboard: Replace ifdefs with #pragma once 2018-05-29 15:44:19 +00:00
Robert Ancell
57975633e6 keyboard: Replace GObject boilerplace with G_DECLARE_TYPE 2018-05-29 15:44:19 +00:00
Robert Ancell
a90e13f12c keyboard: Use g_auto for variables 2018-05-29 10:35:14 +12:00
Andrea Azzarone
0d16cd3feb keyboard: Make "Set Shortcut" button accessible
Set 'can-focus' property to True for change_custom_shortcut_button, fixing
keyboard navigation in the shortcut editor dialog.

https://gitlab.gnome.org/GNOME/gnome-control-center/issues/45
2018-03-30 15:27:26 +00:00
Georges Basile Stavracas Neto
9a611e0d69 keyboard: Remove deprecated gdk_error_trap_push|pop calls
Instead, implement custom error push and pop functions that mimic
what GDK used to do, but using only non-deprecated functions.
2018-03-16 14:56:28 -03:00
Georges Basile Stavracas Neto
0269f6e5b2 keyboard: Trivial update to code style
This fixed many code style issues in wm-common, and add
a few g_autofree when possible.
2018-03-16 14:39:31 -03:00
Georges Basile Stavracas Neto
aba1647bea keyboard: Silence initialization warning
This field is always initialized properly before being
used, so let's not initialize it when declaring.
2018-03-16 14:19:43 -03:00
Georges Basile Stavracas Neto
ee66dc5f3f keyboard: Turn gchar** into GStrv and use g_auto 2018-03-16 14:18:45 -03:00
Georges Basile Stavracas Neto
4496b60c73 keyboard: Make unused public function static
It is not used outside wm-common.c, so let's not export
it as a public function.
2018-03-16 14:14:41 -03:00
Georges Basile Stavracas Neto
2416b4278d keyboard: Remove unused include 2018-03-16 14:14:11 -03:00
Piotr Drąg
7265bd53a0 Add translator comments to .desktop files
Icons are confusing translators, and gettext
is unlikely to get fixed any time soon.
2018-02-23 18:49:35 +01:00
Bastien Nocera
a1f57ce50a keyboard: Simplify keyboard grab
https://bugzilla.gnome.org/show_bug.cgi?id=793070
2018-02-06 10:42:18 +01:00
Iñigo Martínez
0dd386f405 build: Migrate from Intltool to Gettext
Recent versions of Gettext are able to translate several formats
that are used in GNOME applications. This patch migrates from
Intltool to Gettext by using meson's i18n features.

https://bugzilla.gnome.org/show_bug.cgi?id=787588
2018-01-23 10:49:31 +01:00
Bastien Nocera
3dafd78569 keyboard: Simplify keyboard option object creation
https://bugzilla.gnome.org/show_bug.cgi?id=771009
2018-01-18 11:09:18 -02:00
Iñigo Martínez
dc0988d47c build: Remove autotools
To avoid the burden of maintaining multiple build systems, this
patch removes autotools support.

https://bugzilla.gnome.org/show_bug.cgi?id=785414
2018-01-18 12:20:08 +01:00
Piotr Drąg
b65e31323a panels: Remove soft hyphens from .desktop files
With the old shell gone, there is no need to work around cut off panel
names (bug #647087). As it stands now, it only confuses translators
(invisible characters are hard to, well, see).

https://bugzilla.gnome.org/show_bug.cgi?id=792629
2018-01-18 00:12:04 -02:00
Iñigo Martínez
32edd6789e build: Port to meson build system
Meson is a build system focused on speed an ease of use, which
helps speeding up the software development. This patch adds meson
support along autotools.

https://bugzilla.gnome.org/show_bug.cgi?id=785414
2018-01-17 20:09:35 -02:00
Allan Day
8a8e53ab8a Standardize vertical spacing of panels
Ensure that the vertical spacing inside each panel is similar.
This makes the transition between each panel smoother and makes
the control center feel more cohesive.

Settings panels are given 32px above and below their content
and 32px vertical space between major sections. 12px space is
placed below headings.

Bluetooth, displays and printers are not addressed.

https://bugzilla.gnome.org/show_bug.cgi?id=786384
2017-08-20 18:38:42 +02:00
Florian Müllner
796981d390 keyboard: Special-case disabling of multi-bindings shortcuts
For shortcuts that support multiple bindings, the disabled state is
expressed as an empty list rather than a list with a single empty
element. While the latter certainly works as expected as far as the
actual keybinding is concerned, the shortcut will show up as modified
even if it is disabled by default. Explicitly setting bindings to the
empty list when a shortcut is disabled fixes this.

https://bugzilla.gnome.org/show_bug.cgi?id=784620
2017-07-24 21:43:24 -03:00
Florian Müllner
30c36d476e keyboard: Consider multiple bindings when resetting
While we are now able to find conflicts for a particular key combo in
non-primary bindings, in the case of resetting a shortcut we need to
check all key combos in case the shortcut itself has multiple bindings
by default.

https://bugzilla.gnome.org/show_bug.cgi?id=673078
2017-07-10 19:31:00 +02:00
Florian Müllner
dd024ae722 keyboard: Consider additional bindings in uniqueness checks
We now have everything in place to extend the uniqueness check to
consider all bindings of an item rather than just the first one.
With this it is finally possible to set Alt+Tab as binding for
"Switch windows" without keeping the hidden Alt+Tab binding of the
"Switch applications" shortcut ...

https://bugzilla.gnome.org/show_bug.cgi?id=673078
2017-07-10 19:31:00 +02:00
Florian Müllner
2e7c9531fa keyboard: Don't handle mask separately
Comparing masks is currently part of the early checks we perform to
determine that two bindings are different. There's some convenience
in that, however logically the mask is part of the binding, and
separating the mask check from comparing the "rest" of the binding
makes it harder to extend the comparison to consider multiple bindings.

https://bugzilla.gnome.org/show_bug.cgi?id=673078
2017-07-10 19:29:46 +02:00
Florian Müllner
ab353591f8 keyboard: Refactor finding of conflicting items
When comparing keys for uniqueness, we currently apply various tests to
check whether shortcuts are different, until we decide that we found a
conflict if none of the tests passed. That approach is a bit weird for
shortcuts that have a reverse item - when comparing a binding to two
different shortcuts, it should always be different from at least one of
them, so there should never be a conflict for any reversible shortcuts.
The reason it does work anyway is that reverse items usually only differ
in modifiers, which is_shortcut_different() currently doesn't consider at
all. We are about to change that however, so refactor the code to set the
conflicting item as soon as we find a match rather than as fall-through.

https://bugzilla.gnome.org/show_bug.cgi?id=673078
2017-07-10 19:29:43 +02:00
Florian Müllner
5e4fa7bd39 keyboard: Track all key combos
For shortcuts that support more than one binding, we currently simply
ignore all but the first. This makes some sense as we only expose a
single binding in the UI anyway, however it means that any extra
bindings are not taken into account for conflict resolution. In order
to address this in the future, start tracking all bindings of an item.

https://bugzilla.gnome.org/show_bug.cgi?id=673078
2017-07-10 19:29:43 +02:00
Florian Müllner
dccf794897 keyboard: Add dedicated key combo type
We currently store keyval, keycode and mask that make up a particular
key combo separately. However as we want to consider multiple bindings
for a single item, it makes more sense to combine them in a dedicated
struct type.

https://bugzilla.gnome.org/show_bug.cgi?id=673078
2017-07-10 19:29:43 +02:00
Florian Müllner
bd54cd1342 keyboard: Clear additional bindings when changing a shortcut
Some shortcuts allow multiple bindings for the same actions, which
we mainly use to keep supporting old settings when changing defaults.
Multiple bindings are not exposed in the interface though, so when
changing a shortcut with multiple bindings, we previously only updated
the first one and left additional bindings untouched. This is confusing
however, precisely because additional bindings are not shown in the
UI - for instance, this makes it impossible to actually disable
such a shortcut completely. The less confusing option is to clear
any additional bindings when changing a shortcut.

https://bugzilla.gnome.org/show_bug.cgi?id=673078
2017-07-10 19:29:43 +02:00
Florian Müllner
84d527645b keyboard: Don't create shortcuts editor twice
We are accidentally creating two editors, leaking the first instance ...

https://bugzilla.gnome.org/show_bug.cgi?id=784391
2017-07-05 09:22:21 -03:00
Florian Müllner
eed74317c4 keyboard: Fix another memory leak
The memory leak fixed in commit 870fb46201 is still present in
a copy-pasted version of the function, apply the same fix there
as well ...

https://bugzilla.gnome.org/show_bug.cgi?id=784356
2017-07-04 22:52:19 -03:00
Florian Müllner
3910b4ac9d keyboard: Follow the usual search pattern for filtering
Filtering on the name currently only matches the string as a whole,
not individual words as expected, for instance "home fo" and "ho fo"
should both match "Home Folder".

https://bugzilla.gnome.org/show_bug.cgi?id=784357
2017-06-29 21:36:30 -03:00
Florian Müllner
870fb46201 keyboard: Fix a memory leak
While the actual strings returned by g_variant_get_strv() are owned
by the variant, we still need to free the container ...

https://bugzilla.gnome.org/show_bug.cgi?id=784356
2017-06-29 21:22:51 -03:00
Georges Basile Stavracas Neto
7c405d77a7 keyboard: Inform that 'backspace' is the clear key
The Keyboard shortcut editor dialog gives no clue on how
to disable a shortcut, and users were confused by this
lack of information.

Fix that by informing the user about the Backspace role
when editing a shortcut.

https://bugzilla.gnome.org/show_bug.cgi?id=777401
2017-05-10 20:45:07 -03:00
Georges Basile Stavracas Neto
f981eb58ac keyboard: Add more key aliases
To improve even more the search feature, add the
following new key aliases:

Option  → Alt
Command → Super
Apple   → Super

https://bugzilla.gnome.org/show_bug.cgi?id=772565
2017-05-04 10:42:14 +02:00
Georges Basile Stavracas Neto
1cb787e8b8 keyboard: Also search shortcut accelerators
When managing the keyboard shortcuts, the user might want
to check for keybindings based on their accelerators, not
only their names. Currently, however, the Keyboard panel
only supports searching for the keybinding description.

Fix that by also considering the normalized keybinding
accelerator when performing the search.

https://bugzilla.gnome.org/show_bug.cgi?id=772565
2017-05-04 10:41:38 +02:00
Georges Basile Stavracas Neto
dce6fe6add keyboard: Move Remove button to the header bar
According to the mockups [1], the Remove button should
be placed at the start of the header bar. Currently,
however, it is positioned below the custom shortcut edit
button.

Fix that by moving the remove button to the header bar.

[1] https://raw.githubusercontent.com/gnome-design-team/gnome-mockups/master/system-settings/keyboard/keyboard-wires.png

https://bugzilla.gnome.org/show_bug.cgi?id=777846
2017-05-02 07:20:29 -03:00
Mohammed Sadiq
eeddf497af keyboard: Discard the added shortcut on Escape
If the user press Escape key after the user have set some shortcut,
don't save the newly set shortcut, and close the dialog.

https://bugzilla.gnome.org/show_bug.cgi?id=778748
2017-04-27 10:20:56 -03:00
Bastien Nocera
59cbe55db9 keyboard: Add many new keywords
Based on the keyboard shortcuts offered for customisation.

https://bugzilla.gnome.org/show_bug.cgi?id=781245
2017-04-13 10:23:39 +02:00
Rui Matos
3ab4b33390 keyboard: Fix check for existing shortcut settings
From a Coverity scan:

panels/keyboard/cc-keyboard-manager.c:208: unreachable: Since the loop
increment "i++;" is unreachable, the loop body will never execute more
than once.

This seems like a logic thinko introduced in commit
3207fe97ec . In practice it was unlikely
to be a problem since we don't have repeated shortcut gsettings key
names in all our KeyListEntries files.
2017-03-23 17:14:29 +01:00
Jeremy Bicha
681f40ca09 keyboard: Use ellipsis for "Reset All"
https://bugzilla.gnome.org/show_bug.cgi?id=778568
2017-02-14 19:09:33 +01:00
Piotr Drąg
555e230508 Remove no longer necessary contexts from translatable strings
These strings changed recently and now their contexts don't disambiguate
anything.
2017-02-12 16:02:22 +01:00
Georges Basile Stavracas Neto
e601ae74ee keyboard: ensure the "Add" button is insensitive when adding shortcut
After successfully editing a default shortcut (and making sure the
"Set" button is sensitive), if the user clicks the '+' row to create
a new custom shortcut, the "Add" button is sensitive even with all
fields empty.

Fix that by ensuring the "Add" button is always insensitive whenever
we add a custom shortcut.

https://bugzilla.gnome.org/show_bug.cgi?id=777842
2017-02-08 14:15:16 -02:00
Georges Basile Stavracas Neto
c57cadf50b keyboard: make the "Set" and "Add" buttons blue
Per the available mockups [1], the "Set" and "Add" buttons
are the suggested action of the dialog and should be blue.

[1] https://raw.githubusercontent.com/gnome-design-team/gnome-mockups/master/system-settings/keyboard/keyboard-wires.png

https://bugzilla.gnome.org/show_bug.cgi?id=777842
2017-02-08 14:15:16 -02:00
Georges Basile Stavracas Neto
818024970c keyboard: add a reset all button
As described in the proposed mockups [1], the Keyboard panel
should have a Reset All button above the list of shortcuts that
allows the user to quickly reset all the shortcuts to their
default keybinding. The current implementation, however, lacks
this button.

Fix that by adding a "Reset All" button, and implementing the
reset all action. A message dialog is shown in order to confirm
the action, and custom shortcuts are not reset (unless the conflict
with the default keybinding of another standard shortcut).

[1] https://raw.githubusercontent.com/gnome-design-team/gnome-mockups/master/system-settings/keyboard/keyboard-wires.png

https://bugzilla.gnome.org/show_bug.cgi?id=777840
2017-01-31 09:57:59 -02:00
Georges Basile Stavracas Neto
83555219bb keyboard: make the entire panel scrollable
The current Keyboard panel allows only the shortcut list to scroll.
Since we want to add more widgets above the list, and we want them
to scroll out of sight per the latest mockups [1], making only the
shortcut list scrollable poses a problem.

Fix that by making the entire panel scrollable.

[1] https://github.com/gnome-design-team/gnome-mockups/blob/master/system-settings/keyboard/keyboard-wires.png

https://bugzilla.gnome.org/show_bug.cgi?id=777840
2017-01-31 09:57:59 -02:00
Georges Basile Stavracas Neto
1e13e97556 keyboard: manage shortcut editor state with pages
The current shortcut editor state is managed by setting and
comparing the page name directly, making the code look more
complicated than it should.

Fix this by introducing the concept of pages, and using this
to set and get the current shortcut editor dialog state.

https://bugzilla.gnome.org/show_bug.cgi?id=777845
2017-01-30 13:26:25 -02:00
Georges Basile Stavracas Neto
147a1e814d keyboard: fix editing of custom shortcuts
After introducing the reset button to match the mockups [1], the
shortcut editor dialog had some issues exposed. This is visible
e.g. when the user tries to edit a custom shortcut's name and
the shortcut is disabled.

This happens because we assume there is always a shortcut set.
When we open the dialog to edit a custom shortcut, however, nothing
is actually set, and we end up saving the disabled shortcut when
editing the shortcut's name or command.

Fix that by initializing the shortcut's accelerators when editing a
shortcut, and correcting the logic to validate the shortcut.

[1] https://raw.githubusercontent.com/gnome-design-team/gnome-mockups/master/system-settings/keyboard/keyboard-wires.png

https://bugzilla.gnome.org/show_bug.cgi?id=777845
2017-01-30 13:26:12 -02:00
Georges Basile Stavracas Neto
20f52da5e2 keyboard: switch to the reset button
Per the mockups [1], when editing a custom shortcut, there is
a reset button right after the current shortcut. When there
is no shortcut set, it shows a "Set Shortcut" button instead.
The current UI to edit a shortcut, however, diverges from
the proposed one since we use an "Edit" button instead.

Fix that by swapping the Edit button with a reset button, and
adapt the code to not depend on the edit button anymore.

[1] https://raw.githubusercontent.com/gnome-design-team/gnome-mockups/master/system-settings/keyboard/keyboard-wires.png

https://bugzilla.gnome.org/show_bug.cgi?id=777845
2017-01-30 13:24:33 -02:00
Georges Basile Stavracas Neto
8200fa860d keyboard: follow mockups for shortcut change button label
Per the mockups [1], this should be "Set Shortcut…".

[1] https://raw.githubusercontent.com/gnome-design-team/gnome-mockups/master/system-settings/keyboard/keyboard-wires.png

https://bugzilla.gnome.org/show_bug.cgi?id=777844
2017-01-30 08:52:37 -02:00
Georges Basile Stavracas Neto
05e03617e1 shortcut-editor: fix headerbar state when adding shortcut
When adding a custom shortcut, the header mode was set to be
only "Cancel". Per mockups, the "Add" button should also be
visible but insensitive.

Fix that by correctly setting the header mode on creation mode.

https://bugzilla.gnome.org/show_bug.cgi?id=777824
2017-01-27 14:20:47 -02:00