Handle content type and input hints#12
Conversation
|
cc @pvuorela |
pvuorela
left a comment
There was a problem hiding this comment.
One comment but generally looking good. Could approve already.
|
|
||
| g_variant_dict_insert(&dict, WIDGET_INFO_CONTENT_TYPE, "i", content_type); | ||
| g_variant_dict_insert(&dict, WIDGET_INFO_AUTOCAPITALIZATION_ENABLED, "b", | ||
| !!(hints & (GTK_INPUT_HINT_UPPERCASE_WORDS | |
There was a problem hiding this comment.
Autocapitalization on maliit is only for sentences, though I guess this doesn't per se do much harm.
Then again to me this seems like almost useless flag. Could be used for titles if always checking on app side that the locale is in english, and for pleasant use the virtual keyboard would allow forcing it off in case the content is anyway non-english. And even then it would be wrong for english title case lowercasing some words.
Maybe just skip it?
There was a problem hiding this comment.
That's a good point, I haven't actually seen any app setting UPPERCASE_WORDS. The UPPERCASE_SENTENCES flag also doesn't seem to be widely used, but it seems better to have autocapitalization depend on this flag than to keep it on in some cases where it might not be desired.
For some reason, autocapitalization was on by default when the plugin didn't set "autocapitalizationEnabled".
| g_variant_dict_insert(&dict, WIDGET_INFO_AUTOCAPITALIZATION_ENABLED, "b", | ||
| !!(hints & GTK_INPUT_HINT_UPPERCASE_SENTENCES)); | ||
| g_variant_dict_insert(&dict, WIDGET_INFO_PREDICTION_ENABLED, "b", | ||
| !!(hints & GTK_INPUT_HINT_WORD_COMPLETION)); |
There was a problem hiding this comment.
Maybe this should be using also GTK_INPUT_HINT_SPELLCHECK?
On maliit side and Qt hints there's just one thing to control the prediction.
As side-note the gtk way of opting in for basic features is interesting.
There was a problem hiding this comment.
I also wasn't sure about this at first, but then noticed that gedit sets WORD_COMPLETION "for on screen keyboards": https://gitlab.gnome.org/World/gedit/gedit/-/blob/97164e6113fd469cfaf3dc31a635a1203f01c9da/gedit/gedit-view.c#L605
No description provided.