Making two words align left and right on a Geyser Label

Post Reply
Filion
Posts: 93
Joined: Sat Mar 26, 2011 4:21 pm

Making two words align left and right on a Geyser Label

Post 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)

Iocun
Posts: 174
Joined: Wed Dec 02, 2009 1:45 am

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

Post 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.

Post Reply