One of the small things I meant when I wrote "more fixed and efficient code is needed".fredx181 wrote:There's still one (small) thing that annoys me, it is that sometimes the dialog turns out much wider than intended.
I wanted to fix the same line, but for a different reason.
As you can still see from the comments in the script, this line is a modified and more efficient version of
Code: Select all
NR_CHARS="`echo "$text" | wc -c`"
The modified version attempts to produce the same (wrong) result. A case of bug emulation
Like you I also wondered why all characters and not just those of the longest line were counted but I didn't dig deeper. It seems that you are right and that different counting gives better results. Your code could be made shorter though. Instead of
Code: Select all
NR_CHARS="$(echo -e "$text" | awk '{ print length }' | sort -n | tail -1)"
Code: Select all
NR_CHARS="$(echo "$text"| wc -L )"
You mean vertically? That's intentional, I guess. A spacer is added below the icon to keep it in the upper left cornerArgolance wrote:I'll add another small annoying thing: the icon is not centered horizontally
Just do it! Set -wrap to "false" and see what happens Can have surprising and not always pleasant effects.I wonder if it would not be interesting to disable automatic wraping