Project

General

Profile

Actions

Bug #7424

open

WContainerWidget::setContentAlignment() has no effect when item is hidden

Added by max p about 4 years ago. Updated about 4 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Target version:
-
Start date:
01/25/2020
Due date:
% Done:

0%

Estimated time:

Description

Hi,

I have encountered the following issue:

1. There is a WContainerWidget 'top-div' with WVBoxLayout. Content alignment is 'center'

  1. Then I create WContainerWidget 'mid-div' within 'top-div'. This widget 'mid-div' is hidden. Content alignment is 'center'
  2. 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.

Actions #1

Updated by max p about 4 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

Actions #2

Updated by Roel Standaert about 4 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?

Actions

Also available in: Atom PDF