[Kstars-devel] info boxes
Lukas Middendorf
lukas.middendorf at freenet.de
Sat Dec 5 23:57:31 CET 2009
Am Saturday 05 December 2009 schrieb Khudyakov Alexey:
> В сообщении от Суббота 05 декабря 2009 21:11:39 Lukas Middendorf написал:
> > Hi,
> >
> > I have messed around with the info boxes a bit and would like to have
> > some feedback.
> >
> > I implemented some code to use the "sticky" integers from options to
> > prevent the info boxes from floating in the center of the skymap or
> > outside of visible range after window resize. I have attached my
> > result,u the debug-patch shows the stickyness of the info boxes through
> > their background colors. I guess there is something terribly wrong with
> > my approach, please tell me what it is.
>
> Unfortunately. I already implemented stickyness. So it was wasted work.
At least I have learned something about the code.
I think you should not call adjust() in InfoBoxWidget::InfoBoxWidget() through
updateSize(). The sky map seems to be created with a size smaller than the
window and its size is only adjusted after the info boxes are created. If one
info box is placed somewhere outside the initial region of the sky map but
inside the final region of the sky map, it will be made sticky. adjust() should
be called for the first time when the resize of the sky map takes place (or the
sky map should be resized before the info boxes are created).
And also at some time during initialization the geo box seems to touch the
right and lower edges and is set to be sticking there, even if its starting
position is set to (0,0). If adjust() does not modify the m_anchor this does
not happen. I didn't find out when this happens though.
More information about the Kstars-devel
mailing list