Bug #7424
openWContainerWidget::setContentAlignment() has no effect when item is hidden
0%
Description
Hi,
I have encountered the following issue:
1. There is a WContainerWidget 'top-div' with WVBoxLayout. Content alignment is 'center'
- Then I create WContainerWidget 'mid-div' within 'top-div'. This widget 'mid-div' is hidden. Content alignment is 'center'
- While 'mid-div' is hidden, I add to 'mid-div' yet another WContainerWidget 'deep-div' and set content alignment to 'left'. Then I add WText 'info-text'.
So the structure is:
'top-div' : WContainerWidget (content alignment = center)
'mid-div' : WContainerWidget (content alignment = center)
'deep-div' : WContainerWidget (expected content alignment = left)
'info-text' : WText
Having this structure, I make 'mid-div' visible and I see 'info-text' in the center - not on the left. The property 'text-align' is not applied by Wt to 'deep-div' (when it or its parent is hidden).
As the workaround, I recall 'deep-div'.setContentAlignment(Left) when I make 'mid-div' visible.
I'm not sure if this is a bug or by design, but it would be nice if Wt would not be forgetting assigned properties while the widget is hidden :)
Kind regards,
Max.
Updated by max p almost 5 years ago
Once again the structure, because white spaces have been removed:
.'top-div' : WContainerWidget (content alignment = center)
...'mid-div' : WContainerWidget (content alignment = center)
......'deep-div' : WContainerWidget (expected content alignment = left)
.........'info-text' : WText
Updated by Roel Standaert almost 5 years ago
I don't immediately see a good reason why we would forget the value of that property, so I don't think that's by design. Thanks for reporting. If you want to speed things along, could you create a test case that reproduces this issue?