mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-08-21 22:04:56 -06:00
CtrlCore: GTK primary work area issue #640
git-svn-id: svn://ultimatepp.org/upp/trunk@6761 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
07bec4fbe7
commit
36db54e794
1 changed files with 7 additions and 3 deletions
|
|
@ -290,9 +290,11 @@ Rect Ctrl::GetVirtualScreenArea()
|
|||
|
||||
Rect Ctrl::GetPrimaryWorkArea()
|
||||
{
|
||||
GuiLock __;
|
||||
int primary = gdk_screen_get_primary_monitor(gdk_screen_get_default());
|
||||
Array<Rect> rc;
|
||||
GetWorkArea(rc);
|
||||
return rc.GetCount() ? rc[0] : GetVirtualScreenArea();
|
||||
return primary < rc.GetCount() ? rc[primary] : GetVirtualScreenArea();
|
||||
}
|
||||
|
||||
Rect Ctrl::GetPrimaryScreenArea()
|
||||
|
|
@ -453,14 +455,16 @@ void Ctrl::WndUpdate()
|
|||
Rect Ctrl::GetDefaultWindowRect()
|
||||
{
|
||||
GuiLock __;
|
||||
Size sz = GetPrimaryWorkArea().GetSize();
|
||||
Rect r = GetPrimaryWorkArea();
|
||||
Size sz = r.GetSize();
|
||||
|
||||
static int pos = min(sz.cx / 10, 50);
|
||||
pos += 10;
|
||||
int cx = sz.cx * 2 / 3;
|
||||
int cy = sz.cy * 2 / 3;
|
||||
if(pos + cx + 50 > sz.cx || pos + cy + 50 > sz.cy)
|
||||
pos = 0;
|
||||
return RectC(pos + 20, pos + 20, cx, cy);
|
||||
return RectC(r.left + pos + 20, r.top + pos + 20, cx, cy);
|
||||
}
|
||||
|
||||
ViewDraw::ViewDraw(Ctrl *ctrl)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue