Home » U++ Library support » U++ Library : Other (not classified elsewhere) » Issue in docking example application
Issue in docking example application [message #43700] |
Mon, 22 September 2014 23:01 |
frankdeprins
Messages: 99 Registered: September 2008 Location: Antwerp - Belgium
|
Member |
|
|
Hello Mirek,
In the docking example application, there is an issue.
Well, the issue is not exactly in that example or the docking library, but in CtrlLib.
Here is what I noticed:
- When you minimize a docked window and then hover the tab, the docked window will reveal itself (expand). So far, so good.
- But when you move the mouse back out of the window and it's tab, there is something wrong with the auto-hiding: the window hides itself indeed, but then briefly flashes to it's full size once again.
After some digging, I found the cause to be in the Animate procedure in CtrlUtil.cpp.
The following change made the issue go away:
void Animate(Ctrl& c, const Rect& target, int type)
{
if(type < 0)
type = GUI_PopUpEffect();
Rect r0 = c.GetRect();
dword time0 = GetTickCount();
int anitime = 150;
#ifdef SLOWANIMATION
anitime = 1500;
#endif
if(type)
for(;;) {
int t = int(GetTickCount() - time0);
if(t > anitime)
break;
if(type == GUIEFFECT_SLIDE) {
Rect r = r0;
if(r.left != target.left)
r.left -= ((r.left - target.left)* t) / anitime;
if(r.top != target.top)
r.top -= ((r.top - target.top) * t) / anitime;
if(r.right != target.right)
r.right += ((target.right - r.right) * t) / anitime;
if(r.bottom != target.bottom)
r.bottom += ((target.bottom - r.bottom) * t) / anitime;
c.SetRect(r);
}
else
if(type == GUIEFFECT_FADE)
c.SetAlpha((byte)(255 * t / anitime));
else
break;
c.Sync();
Sleep(0);
#ifdef SLOWANIMATION
Sleep(100);
#endif
}
c.SetRect(target);
c.SetAlpha(255);
}
Could you please review this change and, if OK, apply it?
I know this function is used a lot for all animations, so I guess some care will be needed.
Regards,
Frank
|
|
|
Goto Forum:
Current Time: Thu Mar 28 18:43:27 CET 2024
Total time taken to generate the page: 0.01301 seconds
|