Commit graph

548 commits

Author SHA1 Message Date
Jamie Gravendeel
0384e6662e keyboard: Use AdwButtonRow in shortcuts dialog
Ports the "Reset All…" button to AdwButtonRow.
2024-05-28 10:41:19 +00:00
Joshua
074c5fd804 keyboard: Removing unnecessary common_inc include
Removing an unnecessary include to common and some minor adjustments to
better fit existing conventions.
2024-05-27 10:48:21 +00:00
Joshua Dickens
d6aaff9458 keyboard: Share keyboard-shortcuts for use in the Wacom panel
Changes the meson.build files to allow sharing of keyboard-shortcuts
for use in the new wacom stylus keyboard shortcuts feature.
2024-05-27 10:48:21 +00:00
Automeris naranja
231ea8ccb4 keyboard-shortcut-dialog: Port "Reset All Shortcuts?" to AdwAlertDialog
Also:
- Move the dialog to the .ui file, as this dialog is UI-related
- Don't destroy/force close the dialog, as it will be closed
automatically after the responses are triggered
2024-05-17 00:09:26 +00:00
Philip Withnall
ea014f24eb general: Fix various strict-aliasing warnings with g_clear_pointer()
This is just unfortunate. It’s an aliasing violation to cast a pointer
to a pointer (and there’s no way round that), although in practice it
will not cause a problem. People do quite often compile with
`-Werror=strict-aliasing`, though, so fixing the warnings is helpful.

Warnings are of the form:
```
../../source/gnome-control-center/panels/keyboard/cc-keyboard-shortcut-dialog.c: In function ‘cc_keyboard_shortcut_dialog_finalize’:
../../source/gnome-control-center/panels/keyboard/cc-keyboard-shortcut-dialog.c:518:20: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
  518 |   g_clear_pointer ((GtkWindow**)&self->shortcut_editor, gtk_window_destroy);
/opt/gnome/install/include/glib-2.0/glib/gmacros.h:871:47: note: in definition of macro ‘G_STATIC_ASSERT’
  871 | #define G_STATIC_ASSERT(expr) _Static_assert (expr, "Expression evaluates to false")
      |                                               ^~~~
../../source/gnome-control-center/panels/keyboard/cc-keyboard-shortcut-dialog.c:518:3: note: in expansion of macro ‘g_clear_pointer’
  518 |   g_clear_pointer ((GtkWindow**)&self->shortcut_editor, gtk_window_destroy);
      |   ^~~~~~~~~~~~~~~
In file included from /opt/gnome/install/include/glib-2.0/glib/gatomic.h:30,
                 from /opt/gnome/install/include/glib-2.0/glib/gthread.h:34,
                 from /opt/gnome/install/include/glib-2.0/glib/gasyncqueue.h:34,
                 from /opt/gnome/install/include/glib-2.0/glib.h:34:
../../source/gnome-control-center/panels/keyboard/cc-keyboard-shortcut-dialog.c:518:20: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
  518 |   g_clear_pointer ((GtkWindow**)&self->shortcut_editor, gtk_window_destroy);
/opt/gnome/install/include/glib-2.0/glib/glib-typeof.h:39:36: note: in definition of macro ‘glib_typeof’
   39 | #define glib_typeof(t) __typeof__ (t)
      |                                    ^
../../source/gnome-control-center/panels/keyboard/cc-keyboard-shortcut-dialog.c:518:3: note: in expansion of macro ‘g_clear_pointer’
  518 |   g_clear_pointer ((GtkWindow**)&self->shortcut_editor, gtk_window_destroy);
      |   ^~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
```

I believe it’s better to fix these by expanding out the
`g_clear_pointer()` call, than by changing the types of variables — the
latter approach means everything becomes a `GtkWidget` or a `GtkWindow`,
which loses type specificity. So this approach is in contrast to that
taken in commit 1bafd46ea3, for example.

Alternative approaches would be:
 1. Add internal `cc_clear_window()` and `cc_clear_widget()` helpers
    which do this in a single line without aliasing violations.
 2. Enforce compiling with `-Wno-strict-aliasing` if strict aliasing is
    not something that g-c-c maintainers want to care about (which would
    be fine, aliasing checks probably won’t catch any bugs in this kind
    of code).

Signed-off-by: Philip Withnall <pwithnall@gnome.org>

Fixes: #2563
2024-05-16 14:01:02 +00:00
Sam Hewitt
1e56c48f33 Unify elements in the icon assets to shrink their file size 2024-04-29 11:01:18 -02:30
Automeris naranja
a462ca6e48 xkb-modifier-dialog: Remove activatable=false in "switch_row"
This row already uses the "activatable-widget" property,
so using activatable=false doesn't make sense.
2024-04-26 10:03:01 +00:00
Automeris naranja
e33bbec7e9 input-list-box: Use a GtkListBox placeholder widget
Use a GtkListBox placeholder widget to show the
"No input source selected" message. Also, remove the
hexpand and vexpand properties from the list box, which
currently aren't doing anything.
2024-04-26 10:00:34 +00:00
Automeris naranja
2e1d669a57 keyboard-shortcut-dialog: Set the GtkSearchBar capture widget in the .ui file
Closes https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/2743
2024-04-26 08:49:57 +00:00
Automeris naranja
69a5fcaa51 input-chooser: Remove content-height property
Doing so, this dialog won't display a scrollbar that scrolls
just a little bit (when the list box isn't expanded), as this
is unnecessary.
2024-04-09 00:35:04 -03:00
Automeris naranja
372b9f8b0c keyboard-shortcut-dialog: Use "No Results Found" in empty_results_page
This will be consistent with the status page from the Settings
sidebar, which shows "No Results Found" when searching for panels
(if the search term doesn't return anything).

Also, use header capitalization, as advised by HIG.
2024-04-03 07:59:56 +00:00
Automeris naranja
3b1bebe1d2 keyboard-shortcut-dialog: Minor cleanup in shortcut_dialog_row_new
- Set the "show-arrow" and "title" properties directly in
"g_object_new"
- Remove "gtk_list_box_row_set_activatable" because
CcListRow is activatable by default
2024-04-02 20:46:34 +00:00
Automeris naranja
09e533d645 input-chooser: Tweak search entry placeholder text
Use "Search languages and countries" as the
search entry placeholder, like in the latest
mockups[1].

[1] 1855a1ecbe
2024-04-02 16:21:47 +00:00
Automeris naranja
3e7eedcb98 input-chooser: Port to AdwPreferencesPage/Group 2024-04-02 16:21:47 +00:00
Automeris naranja
5b55700eec input-chooser: Port to AdwDialog 2024-04-02 16:21:47 +00:00
Automeris naranja
3f3327a9f3 xkb-modifier-dialog: Remove custom CSS
.xkb-option-button style class is no longer used,
so remove the custom CSS that was made for it.
2024-04-02 16:07:11 +00:00
Automeris naranja
3741baceba xkb-modifier-dialog: Port to AdwDialog 2024-04-02 16:07:11 +00:00
Automeris naranja
542cd4e0a6 keyboard-shortcut-row: Tweak the reset button
- Reword tooltip to follow HIG guidelines[1]
- Remove the a11y because Orca also reads
tooltips
- Remove the "reset-shortcut-button" style class
because it's unused

[1] https://developer.gnome.org/hig/patterns/feedback/tooltips.html
2024-03-12 12:51:45 +00:00
Automeris naranja
59ff136095 keyboard-shortcut-row: Add an edit icon
Shortcut rows don't indicate that a window will
be opened. Add an edit icon to fix that.

Closes https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/2814
2024-03-12 12:51:45 +00:00
Automeris naranja
4b56c8b666 keyboard-shortcut-dialog: Fix typo in function name 2024-03-01 09:45:42 +00:00
Automeris naranja
0aeb0b55a7 general: Add translator comments about the "Search" term
Clarify in which occasions this term should be
phrased as a verb or as a noun.

Partially fixes https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/2903
2024-02-29 13:48:20 +00:00
Automeris naranja
1978468396 general: Remove a11y label from some search entries
These search entries have placeholder texts,
which are also read by Orca. Therefore, using
an a11y label is redundant.

Partially fixes https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/2903
2024-02-29 13:48:20 +00:00
Automeris naranja
d997c6e0fa general: Remove "activatable" property from some CcListRows
The CcListRow template already sets the row
as activatable[1].

[1] https://gitlab.gnome.org/GNOME/gnome-control-center/-/blob/gnome-45/panels/common/cc-list-row.ui?ref_type=heads#L4
2024-02-20 07:32:37 +00:00
Matthijs Velsink
3a253bc4b1 general: Use g_clear_handle_id to remove GSources
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.
2024-02-06 09:22:07 +00:00
Monster
d2abde0349 keyboard: Remove periods in descriptions 2024-02-05 10:57:11 +00:00
Automeris naranja
b1d1302053 general: Remove a11y labels from buttons that have tooltips
Orca also reads tooltips, so having both a11y labels
and tooltips is redundant.

See https://gitlab.gnome.org/GNOME/gnome-control-center/-/merge_requests/2023#note_1915854
2024-01-30 13:28:48 +00:00
Automeris naranja
735e12ada6 xkb-modifier-dialog: Use AdwActionRow to show the key options
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.
2024-01-25 12:58:00 +00:00
Bharat
19e75e0fb0 Keyboard: Add title to AdwNavigationPage
Add blank title to AdwNavigationPage
in the cc-keyboard-shortcut-dialog.ui

Fixes #2850
2024-01-22 14:10:12 +00:00
Automeris naranja
af72bcaabd xkb-modifier-dialog: Port to AdwPreferencesPage
Also, use `<property name="content">` to put the
content widgets.
2024-01-18 12:07:53 +00:00
Automeris naranja
ae73d2d324 input-chooser: Reduce window width
The input chooser window width is unnecessarily
big, so this change reduces it to avoid unused space.
2023-12-21 09:30:06 +00:00
Automeris naranja
5cf922a24e keyboard-shortcut-dialog: Add mnemonic to the "Reset All" button
Also, organize the properties (from the "Reset All" button)
together in the .ui file instead of mixing them with the signal name.
2023-12-14 16:46:34 -03:00
Kevin Bullock
f19a7abf59 keyboard: Add Left Ctrl to Compose Key options 2023-11-29 19:37:47 +00:00
Automeris naranja
f15d260323 input-row: Add tooltip to the ellipsis button from CCInputRow
Closes https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/605
2023-11-29 10:12:30 +00:00
Automeris naranja
a0d7c2b13f keyboard-shortcut-dialog: Make search entry smaller
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.
2023-11-27 09:54:02 +00:00
Automeris naranja
3416dab979 keyboard-shortcut-dialog: Tweak reset shortcuts confirmation dialog
Properly explain what resetting shortcuts actually does.
String reference:
https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/2669#note_1921867

Partially fixes https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/2669
2023-11-27 09:54:02 +00:00
Automeris naranja
5611dd2fc5 keyboard-shortcut-dialog: Tweak Reset button
Move the Reset button to the bottom add
.pill and .destructive-style classes to it. Also,
remove its tooltip.

Partially fixes https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/2669
2023-11-27 09:54:02 +00:00
Marcos Miller
2e96b6d8cd keyboard: port ShortcutEditor from GtkDialog for AdwWindow/AdwToolbarView
See https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/2624
2023-11-24 10:26:31 +00:00
Automeris naranja
8322ccf6c1 input-chooser: Rename "Add an Input Source" to "Add Input Source"
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).
2023-11-24 09:41:33 +00:00
Automeris naranja
3c0c5b7423 keyboard: Add missing mnemonics
Partially fixes https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/2541

Part-of: <https://gitlab.gnome.org/GNOME/gnome-control-center/-/merge_requests/2049>
2023-11-24 00:23:21 +00:00
Automeris naranja
ea31bb091e keyboard-shortcut-editor: Add mnemonic to the "Set Shortcut" button
Partially fixes https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/2541

Part-of: <https://gitlab.gnome.org/GNOME/gnome-control-center/-/merge_requests/2049>
2023-11-24 00:23:21 +00:00
Automeris naranja
c961832741 keyboard-shortcut-dialog: Add missing mnemonics
Partially fixes https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/2541

Part-of: <https://gitlab.gnome.org/GNOME/gnome-control-center/-/merge_requests/2049>
2023-11-24 00:23:21 +00:00
Lukáš Tyrychtr
536612b00e keyboard: Add Insert as a choice for the compose key
Fixes #2765
2023-11-23 12:34:04 +00:00
Maximiliano Sandoval R
6121bb0a49
input-chooser: Only capture input while visible
Otherwise writing in the dialog would filter it even if the search bar
is not visible.
2023-11-19 20:48:26 +01:00
Maximiliano Sandoval R
769287a59b
input-chooser: Port to AdwWindow 2023-11-19 20:48:26 +01:00
Automeris naranja
20fe6f3895 input-list-box: Add ellipsis to add_input_row label
"Use an ellipsis (…) at the end of a label if further input or
confirmation is required from the user before the action can be carried out".

https://developer.gnome.org/hig/guidelines/writing-style.html
2023-10-27 12:55:49 +00:00
Maximiliano Sandoval R
549496f68f
keyboard: Add back close buttons to dialogs 2023-10-26 18:00:20 +02:00
Felipe Borges
958024a7ec meson: Replace deprecated meson.{source|build}_root functions
https://mesonbuild.com/Reference-manual_builtin_meson.html#mesonbuild_root
2023-10-25 15:49:13 +02:00
Maximiliano Sandoval R
abab4956ad
xkb-modifier-dialog: Port to AdwWindow
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
2023-10-22 10:19:39 +02:00
Maximiliano Sandoval R
526217badb keyboard-shortcut-dialog: Allow escape to close
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.
2023-10-20 10:55:01 +00:00
Maximiliano Sandoval R
2e12bf3bbe input-list-box: Add a label to the add button
This way it looks a bit more full and helps with a11y. Values taken from
the app Secrets.
2023-10-20 08:58:35 +00:00