Fix ui align in distract free mode

This commit is contained in:
Lubos Lenco
2021-04-06 12:14:04 +02:00
parent cb7677df81
commit 5f087ce57e
3 changed files with 22 additions and 1 deletions
+16
View File
@@ -265,6 +265,11 @@ class UINodes {
wy += iron.App.h() - Config.raw.layout[LayoutNodesH];
}
var ww = Config.raw.layout[LayoutNodesW];
if (!UISidebar.inst.show) {
ww += Config.raw.layout[LayoutSidebarW] + UIToolbar.inst.toolbarw;
wx -= UIToolbar.inst.toolbarw;
wy = 0;
}
var mx = mouse.x;
var my = mouse.y;
if (mx < wx || mx > wx + ww || my < wy) return;
@@ -374,6 +379,9 @@ class UINodes {
public function drawGrid() {
var ww = Config.raw.layout[LayoutNodesW];
if (!UISidebar.inst.show) {
ww += Config.raw.layout[LayoutSidebarW] + UIToolbar.inst.toolbarw;
}
var wh = iron.App.h();
var w = ww + 100 * 2;
var h = wh + 100 * 2;
@@ -457,11 +465,19 @@ class UINodes {
ww = Config.raw.layout[LayoutNodesW];
wx = Std.int(iron.App.w()) + UIToolbar.inst.toolbarw;
wy = UIHeader.inst.headerh * 2;
if (!UISidebar.inst.show) {
ww += Config.raw.layout[LayoutSidebarW] + UIToolbar.inst.toolbarw;
wx -= UIToolbar.inst.toolbarw;
wy = 0;
}
var ew = Std.int(ui.ELEMENT_W() * 0.7);
wh = iron.App.h();
if (UIView2D.inst.show) {
wh = Config.raw.layout[LayoutNodesH];
wy = iron.App.h() - Config.raw.layout[LayoutNodesH] + UIHeader.inst.headerh * 2;
if (!UISidebar.inst.show) {
wy -= UIHeader.inst.headerh * 2;
}
}
if (ui.window(hwnd, wx, wy, ww, wh)) {