Page 1 of 1

Making two words align left and right on a Geyser Label

Posted: Sat Jan 04, 2014 12:01 am
by Filion
I want to have a label that contains info e.g. about the primary target. But I want the word primary to be aligned left and the target to be aligned left.

I tried using this
Code: [show] | [select all] lua
statusbar.target1:echo([[<div class= "float: left;text-align:center;">test</div>]])
in order to test if in this way I can align the text to the center, but nothing happened.
(where statusbar.target1 is the name of the label)

Re: Making two words align left and right on a Geyser Label

Posted: Fri Jan 10, 2014 6:38 pm
by Iocun
I don't think normal text-align CSS commands work. You can however use QT alignment properties to set the alignment for an entire label in its style sheet:

statusbar.target1:setStyleSheet([[qproperty-alignment: 'AlignRight']])

I can't think of a way of making one part of a label's text aligned to the left and another aligned to the right though, so you'd probably have to use two labels for this, one with left alignment, one with right alignment.