fix: row titles mean their mnemonics instead of drawing the underscore
Fifteen display strings in the two preference forms were written as GTK mnemonics -- `_Directory`, `_Server`, `Multicast _group`, `_Theme` and the rest -- but the property that makes GTK read them was never set, so GTK drew the underscore literally: `_Directory` in the row, not a D with a line under it. Two switches are involved, FALSE by default in each case. `GtkLabel`/`GtkButton` take `use-underline`; the rows take `AdwPreferencesRow:use-underline`, "whether an embedded underline in the title indicates a mnemonic". The two buttons in the source form already set it (so their mnemonics worked and showed no underscore); the thirteen rows did not. All thirteen now do. The row classes that carry the property are not all related -- AdwEntryRow has its own, while AdwSpinRow, AdwComboRow and AdwSwitchRow get it through AdwActionRow -- so the probe reads it by name on a GObject (g_object_class_find_property, then g_object_get) rather than casting to one row type; a cast to a `GtkWidget*` where the type is only forward-declared does not compile at all. `_Cancel` and `_Connect` both claimed C in the same form, so Alt+C could only reach one of them: that marker was unreachable, which is worse than absent because it is in the source to be trusted. `_Connect` becomes `Conn_ect`, freeing C for Cancel. [prefs-probe] reads the count (4/4) on the real widgets; check_ui validates the property against the GIR for every object in every .ui file, inherited properties included.
This commit is contained in:
1 parent
2d9f327da7
commit
f00d161900
8 files changed
+78
-1
No files matched your search
@@ -1143,3 +1143,16 @@ copy and never writes is exactly the failure this has to catch.
|
||||
default path back into the field and presses *Apply*, and the file must end up with **no**
|
||||
`event_cache_dir` at all. A path in the file is a user's choice, and typing the default is not one --
|
||||
pinning it there would stop the setting following the cache directory it is named after.
|
||||
|
||||
## `mnemonics=` in the two preference probes
|
||||
|
||||
```
|
||||
[prefs-probe] mnemonics=4/4
|
||||
[sources] form mnemonics=8/8
|
||||
```
|
||||
|
||||
How many of the dialog's rows have `use-underline` set -- the property that makes a `_` in a row's title a
|
||||
mnemonic. It is FALSE on `AdwPreferencesRow` by default, which is why these titles were drawn with a
|
||||
literal underscore; anything below the full count is that bug back. Read by property name rather than
|
||||
through one row type, for the reason in `invariants-gtk-and-chrome.md`. The form's line appears only when
|
||||
`UDPSCOPE_PROBE_NEWHOST` drives the form.
|
||||
Reference in new issue
Block a user