mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-07-29 22:03:40 -06:00
*CtrlLib: Fix in problem with DisplayPopup sometimes popping up on focus change wrongly
git-svn-id: svn://ultimatepp.org/upp/trunk@3459 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
52c85f6a32
commit
facb657ddb
1 changed files with 13 additions and 11 deletions
|
|
@ -487,18 +487,20 @@ void DisplayPopup::Sync()
|
|||
if(top && top->HasFocusDeep()) {
|
||||
Size sz = display->GetStdSize(value);
|
||||
if(sz.cx + 2 * margin > item.GetWidth() || sz.cy > item.GetHeight()) {
|
||||
Rect wa = GetWorkArea();
|
||||
slim = item + ctrl->GetScreenView().TopLeft();
|
||||
Rect r = item;
|
||||
r.right = max(r.right, r.left + sz.cx + 2 * margin);
|
||||
r.bottom = max(r.bottom, r.top + sz.cy);
|
||||
r.Inflate(1, 1);
|
||||
r.Offset(ctrl->GetScreenView().TopLeft());
|
||||
SetRect(r);
|
||||
if(!IsOpen())
|
||||
Ctrl::PopUp(ctrl, true, false, false);
|
||||
Refresh();
|
||||
return;
|
||||
if(slim.Contains(GetMousePos())) {
|
||||
Rect wa = GetWorkArea();
|
||||
Rect r = item;
|
||||
r.right = max(r.right, r.left + sz.cx + 2 * margin);
|
||||
r.bottom = max(r.bottom, r.top + sz.cy);
|
||||
r.Inflate(1, 1);
|
||||
r.Offset(ctrl->GetScreenView().TopLeft());
|
||||
SetRect(r);
|
||||
if(!IsOpen())
|
||||
Ctrl::PopUp(ctrl, true, false, false);
|
||||
Refresh();
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue