button keyboard shortcuts by underscores doesnt work in combination with button text with underscore

180 views
Skip to first unread message

ladiko

unread,
May 9, 2017, 4:37:42 AM5/9/17
to yad-common
I use button shortcuts in Xubuntu 16.04 with yad 0.38.2-1 (Ubuntu 17.04 version) like this:

yad --button "_whatever"

So the button shows "whatever" and if I press Alt, it changes to "whatever" and i can press W as a keyboard shortcut. This is fine. It also works to show underscores by doubling them as in:

yad --button "what__ever"

and the button is labeled with "what_ever" - regardless if i press Alt or not (which is also fine). What doesnt work is to combine both features by executing:

yad --button "_what__ever"

It shows "whatever" normally (which is wrong) and "what_ever" when Alt is pressed (which is right).

Милош Павловић

unread,
May 9, 2017, 5:17:26 PM5/9/17
to yad-common
To display as a single character '_', you tried to escape the mnemonic character with
__
instead, there is an underline in ever.
Interesting behaviour.
yad --button $(printf "%b\n"  "_what__\u00A0__ever\u2028_what__\u1680ever\u2028_what__\u200Bever") --button $(echo -e '__e') --button $(echo -e "__a__b__c__d")
This way there is no underline untill Alt keypress.
yad --button $(printf "%b\n"  "_what__\u200Bever")
\u200B - zero width space

Милош Павловић

unread,
May 9, 2017, 8:27:02 PM5/9/17
to yad-common
This trick with Pango markup works: <u>\u2002</u>
yad --button $(echo -e "_what<u>\u2002</u>ever")


уторак, 09. мај 2017. 10.37.42 UTC+2, ladiko је написао/ла:

ladiko

unread,
May 12, 2017, 4:37:42 AM5/12/17
to yad-common
Great it works, thanks!

Милош Павловић

unread,
May 12, 2017, 7:16:55 PM5/12/17
to yad-common
No problem.
It works in case you don't need '--no-markup'.
If you however need that option, next line will do the job.
yad --button "_what__ever" --no-markup
Reply all
Reply to author
Forward
0 new messages