How does the SpecialSpacer system work?

Friedrich W. H. Kossebau kossebau at kde.org
Sat Apr 7 13:28:20 UTC 2012


Am Samstag, 7. April 2012, 15:10:02 schrieben Sie:
> On Saturday 07 April 2012 14:56:01 you wrote:
> > Hi,
> > 
> > I fear some of my UI-related commits have ignored the concept of the
> > SpecialSpacer system, as I simply removed that extra widget because it
> > looked like garbage to me and did not result in any visual or functional
> > difference for what I tested (and reviewers have missed this as well :) ).
> > 
> > But I am wondering ATM why the high-priorized stretching bottom spacer is
> > only added if all sub-UIs have a SpecialSpacer, not in any case.
> > KoModeBox.cpp and KoToolDocker.cpp both count the numbers of those
> > 
> >     if (specialCount == optionWidgetList.count()) {
> >     
> >         layout->setRowStretch(cnt, 100);
> >     
> >     }
> > 
> > So e.g. in the tool options docker with the "Draw a path." tool has also
> > the WdgGeometryOptions as sub-UI, which is without a SpecialSpacer, so the
> > bottom stretching spacer is not added.
> > 
> > So:
> > What is the concept behind this?
> > Why is the bottom stretching spacer not added in any case?
> > Should I readd the SpecialSpacer for all cases where I removed it? (need
> > to
> > check)
> 
> The SpecialSpacer means that it should NOT stretch stretch if there are no
> optionwidgets for that tool which can use the extraspace.

Such optionwidgets are e.g. those with list views? Then e.g. 
WdgGeometryOptions (krita/ui/forms/wdgshapeoptions.ui) misses such a 
SpecialSpacer marker, right?

> If no option
> widget can use any space we put all extra space after the final
> optionwidget.
> 
> If we always added the bottom spacer the available space would be share
> between that spacer and the optionwidgets that could actually use it.
> 
> We need the SpecialSpacer to signal to the modebox and tooldocker, that this
> option widget don't want to stretch. However we can't just fix it's size as
> the option widgets needs to be able to strecht in the opposite direction of
> the modebox/tooldocker's main direction.
> 
> Consequently if you remove the SpecialSpacer any extra space will be
> distributed to all those. so yes please add it back in.
> 
> hope this make sense

If my assumptions as given above are correct, than it makes sense for me, yes, 
thanks :)
 
Cheers
Friedrich


More information about the calligra-devel mailing list