Qtopia-interest Archive, February 2008
src/server/phonelauncher.cpp and docking windows
Message 1 in thread
Hey,
I just saw this when reading the code. PhoneLauncher::loadTheme() will dock
the header and the context label. But when grepping for
WindowManagement::dockWindow you will see that ::header()
and ::createContext() have already docked it. It would be better to dock the
window only once, specially as in the worse case some one will only see one
of the two calls, change the position, and wonder why it does not work...
comments?
z.
--
[ signature omitted ]
Message 2 in thread
On Friday 29 February 2008 00:29, Holger Freyther wrote:
> Hey,
> I just saw this when reading the code. PhoneLauncher::loadTheme() will dock
> the header and the context label. But when grepping for
> WindowManagement::dockWindow you will see that ::header()
> and ::createContext() have already docked it. It would be better to dock
> the window only once, specially as in the worse case some one will only see
> one of the two calls, change the position, and wonder why it does not
> work...
loadTheme() is triggered when the user decides to change the theme. A new
theme may have a different header and/or context label height. This has to be
propagated to WindowManagement. You may argue that the dock calls in
createContext() and header() are too much. Technically they are not required
but they avoid a relayout when loadTheme() is triggered. At construction time
there is much less to layout than later on.
--
[ signature omitted ]
Message 3 in thread
On Thursday 28 February 2008 23:35:04 Alexander Blasche wrote:
> On Friday 29 February 2008 00:29, Holger Freyther wrote:
> > Hey,
> > I just saw this when reading the code. PhoneLauncher::loadTheme() will
> > dock the header and the context label. But when grepping for
> > WindowManagement::dockWindow you will see that ::header()
> > and ::createContext() have already docked it. It would be better to dock
> > the window only once, specially as in the worse case some one will only
> > see one of the two calls, change the position, and wonder why it does not
> > work...
>
> loadTheme() is triggered when the user decides to change the theme. A new
> theme may have a different header and/or context label height. This has to
> be propagated to WindowManagement. You may argue that the dock calls in
> createContext() and header() are too much. Technically they are not
> required but they avoid a relayout when loadTheme() is triggered. At
> construction time there is much less to layout than later on.
Hi,
well, loadTheme gets called from the c'tor of of PhoneLauncher, same as
header() and createContext(). So even in the creation you dock them twice and
then it is kind of bad style to hardcode the position of a dock in two
places, one should be more than enough.
Removing the docking from header() and createContext() should do the job, you
dock them anyway in loadTheme which is called from the c'tor.
regards
z.
--
[ signature omitted ]
Message 4 in thread
On Friday 29 February 2008 11:24, Holger Freyther wrote:
> well, loadTheme gets called from the c'tor of of PhoneLauncher, same as
> header() and createContext(). So even in the creation you dock them twice
> and then it is kind of bad style to hardcode the position of a dock in two
> places, one should be more than enough.
>
> Removing the docking from header() and createContext() should do the job,
> you dock them anyway in loadTheme which is called from the c'tor.
You are right. I didn't see the loadTheme() call within the ctor. I removed
the calls from header() and createContext().
Thank you
--
[ signature omitted ]
Message 5 in thread
On Friday 29 February 2008 03:39:25 Alexander Blasche wrote:
> You are right. I didn't see the loadTheme() call within the ctor. I removed
> the calls from header() and createContext().
Thank you for taking care of this!
z.
--
[ signature omitted ]