Open manuel-192 opened 4 years ago
If you make all the strings the same length and force Monospace font they will align to the left.
#!/bin/bash
for word in Emacs Mousepad Leafpad
do
len=${#word}
if (( len > longest ))
then
longest=$len
longword=$word
fi
done
yad --form --field="$(printf "<tt> %-${longest}s</tt>%s" "Emacs" "!emacs!")":fbtn "emacs" \
--field="$(printf "<tt> %-${longest}s</tt>%s" "Mousepad" "!mousepad!")":fbtn "mousepad" \
--field="$(printf "<tt> %-${longest}s</tt>%s" "Leafpad" "!leafpad!")":fbtn "leafpad"
If you make all the strings the same length and force Monospace font they will align to the left.
Thanks! That's a nice and working idea (although the <tt>
tag is deprecated and not available in HTML5).
But for my rather complex forms (in a notebook) this would require quite much additional work.
I'm hoping for a solution that would involve support from yad, for example a form option --button-text-align=left or something similar for fields of fbtn.
Thanks! That's a nice and working idea (although the
<tt>
tag is deprecated and not available in HTML5).
If you are using HTML dialogs (yad --html) I can imagine the code. alarm script Javascript, HTML, CSS ans bash. :grinning:
\ tags are in the Pango Markup Language used in yad and gtk+ apps.
But for my rather complex forms (in a notebook) this would require quite much additional work.
I understand that. It would be easier and the form buttons would look better with the system font. :+1:
Hi! Again about yad 5.0. This is not really an issue but more of a feature request!
Example:
yad --form --field=' Emacs!emacs!':fbtn emacs --field=' Mousepad!mousepad!':fbtn mousepad --field=' Leafpad!leafpad!':fbtn leafpad
Here the icons and text on the buttons are not vertically aligned, but e.g. left-aligning both icons and text would make them look better.