|
From: Joe E. <jen...@fl...> - 2006-11-18 19:29:48
|
Georgios Petasis wrote:
> I have a small problem with the label frame widget. From what I
> understand, this widget
> has 2 elements: a border & a text element.
>
> Right now, tileqt defines an element only for the border. No element is
> defined for the text (as I will have to do text drawing with Qt). What I
> cannot understand, is why the default text element of the labelframe
> widget does not use the "background" element for drawing the text
> background.
>
> What I observe with the tileqt theme, is that the label widget is always
> drawn with the correct background, as it uses the background element
> tileqt provides. But the labelframe's text does not do the same:
> If I use the "tile::theme::tileqt::setPalette -background white" command
> for changing the palette of Qt, this affects all widgets (including the
> label widget where tileqt does not define any elements) but not the
> labelframe widget. Why is that?
> How can I fix this?
Some background:
The built-in "text" element only draws the text, it doesn't
erase the background first. If this element is used in
a conventional Labelframe layout, the labelframe's border
will be drawn through the middle of the text. Tile defines
a specialized version of the element, "Labelframe.text", that
fills the element's parcel with the -background color before
drawing the text.
What's probably happening in TileQt: it looks like
[tile::theme::tileqt::setPalette] only changes Qt's
system colors, it doesn't update Tile's style settings.
So the Labelframe.text widget picks up the original
setting for -background. To fix this, it should suffice
to just use:
style configure TLabelframe -background [currentThemeColour -background]
after [tile::theme::tileqt::setPalette].
--Joe English
jen...@fl...
|