Re: [UFO-devel] ULabel
Status: Beta
Brought to you by:
schmidtjf
From: Johannes S. <sch...@us...> - 2005-07-20 10:16:31
|
Am Samstag 16 Juli 2005 20:45 schrieb Andreas Beckermann: > On Saturday 16 July 2005 20:01, Johannes Schmidt wrote: > > On Saturday 16 July 2005 19:35, Andreas Beckermann wrote: > > > Hi > > > ufo::ULabel::getPreferredSize() now uses getContentsSize() to calculate > > > its size, which in turn uses ufo::UStyle::getCompoundPreferredSize(). > > > > > > I can change the outlook of the ufo::ULabel class by reimplementing > > > ufo::UStyle::paintComponent(). However then I also need to reimplement > > > the preferred size calculation of the ufo::ULabel. > > > But by reimplementing ufo::UStyle::getCompoundPreferredSize(), I also > > > change the behaviour of ufo::UButton. Any way around this? > > > > > > I am probably going to subclass the ufo::ULabel class, but I think > > > that's a suboptimal solution only, as I have to make sure that no plain > > > ufo::ULabel objects are created anymore. > > > Providing either a ufo::UCompound pointer or a > > > ufo::UStyle::ComponentElement in > > > ufo::UStyle::getCompoundPreferredSize() would fix the problem. > > > > I assume that this covers the multline label problem. > > Yep, but I consider this a general problem. It'll probably come up again, > if I ever write custom layouts for the sake of look and feel. [...] Okay, I'll add a style type (CE_Label bla) or a widget pointer (or both). Have to take some closer look before. cu, Johannes |