mirror of
https://github.com/IgorTimofeev/MineOS.git
synced 2025-12-20 11:09:21 +01:00
Experimental feature: hides all UI elements in Fullscreen apps mode. EXTREME performance!
This commit is contained in:
parent
c4a3e9305b
commit
623d9d49bb
Binary file not shown.
@ -18,7 +18,7 @@ local lines = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
local treePanel = window:addChild(GUI.panel(1, 1, 22, 3, 0x2D2D2D))
|
local treePanel = window:addChild(GUI.panel(1, 1, 22, 3, 0x2D2D2D))
|
||||||
local tree = window:addChild(GUI.tree(1, 4, treePanel.width, 1, 0x2D2D2D, 0xE1E1E1, 0x969696, 0x696969, 0xE1E1E1, 0x2D2D2D, 0x696969, 0x696969, 0x4B4B4B, 0x696969, GUI.IO_MODE_BOTH, GUI.IO_MODE_BOTH))
|
local tree = window:addChild(GUI.tree(1, 4, treePanel.width, 1, 0x2D2D2D, 0xD2D2D2, 0x878787, 0x696969, 0xE1E1E1, 0x2D2D2D, 0x696969, 0x696969, 0x4B4B4B, 0x696969, GUI.IO_MODE_BOTH, GUI.IO_MODE_BOTH))
|
||||||
|
|
||||||
local textBox = window:addChild(GUI.textBox(1, 2, 1, 1, nil, 0x3C3C3C, lines, 1, 0, 0, true))
|
local textBox = window:addChild(GUI.textBox(1, 2, 1, 1, nil, 0x3C3C3C, lines, 1, 0, 0, true))
|
||||||
textBox.passScreenEvents = true
|
textBox.passScreenEvents = true
|
||||||
|
|||||||
@ -120,7 +120,7 @@ local function request(url, postData, headers)
|
|||||||
|
|
||||||
return data
|
return data
|
||||||
else
|
else
|
||||||
GUI.alert("Failed to perform internet request: ")
|
GUI.alert("Failed to perform internet request: " .. tostring(reason))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -1661,7 +1661,7 @@ local function login()
|
|||||||
passwordInput.onInputFinished = usernameInput.onInputFinished
|
passwordInput.onInputFinished = usernameInput.onInputFinished
|
||||||
|
|
||||||
loginButton.onTouch = function()
|
loginButton.onTouch = function()
|
||||||
local result, reason = request("https://oauth.vk.com/token?grant_type=password&client_id=3697615&client_secret=AlVXZFMUqyrnABp8ncuU&username=" .. usernameInput.text .. "&password=" .. passwordInput.text .. "&v=" .. VKAPIVersion)
|
local result, reason = request("https://oauth.vk.com/token?grant_type=password&client_id=3697615&client_secret=AlVXZFMUqyrnABp8ncuU&username=" .. internet.encode(usernameInput.text) .. "&password=" .. internet.encode(passwordInput.text) .. "&v=" .. VKAPIVersion)
|
||||||
if result then
|
if result then
|
||||||
if result.access_token then
|
if result.access_token then
|
||||||
currentAccessToken = result.access_token
|
currentAccessToken = result.access_token
|
||||||
|
|||||||
@ -4206,30 +4206,32 @@ local function windowCheck(window, x, y)
|
|||||||
end
|
end
|
||||||
|
|
||||||
local function windowEventHandler(workspace, window, e1, e2, e3, e4, ...)
|
local function windowEventHandler(workspace, window, e1, e2, e3, e4, ...)
|
||||||
if e1 == "touch" then
|
if window.movingEnabled then
|
||||||
if not windowCheck(window, e3, e4) then
|
if e1 == "touch" then
|
||||||
window.lastTouchX, window.lastTouchY = e3, e4
|
if not windowCheck(window, e3, e4) then
|
||||||
end
|
window.lastTouchX, window.lastTouchY = e3, e4
|
||||||
|
|
||||||
if window ~= window.parent.children[#window.parent.children] then
|
|
||||||
window:moveToFront()
|
|
||||||
|
|
||||||
if window.onFocus then
|
|
||||||
window.onFocus(workspace, window, e1, e2, e3, e4, ...)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
workspace:draw()
|
if window ~= window.parent.children[#window.parent.children] then
|
||||||
end
|
window:moveToFront()
|
||||||
elseif e1 == "drag" and window.lastTouchX and not windowCheck(window, e3, e4) then
|
|
||||||
local xOffset, yOffset = e3 - window.lastTouchX, e4 - window.lastTouchY
|
|
||||||
if xOffset ~= 0 or yOffset ~= 0 then
|
|
||||||
window.localX, window.localY = window.localX + xOffset, window.localY + yOffset
|
|
||||||
window.lastTouchX, window.lastTouchY = e3, e4
|
|
||||||
|
|
||||||
workspace:draw()
|
if window.onFocus then
|
||||||
|
window.onFocus(workspace, window, e1, e2, e3, e4, ...)
|
||||||
|
end
|
||||||
|
|
||||||
|
workspace:draw()
|
||||||
|
end
|
||||||
|
elseif e1 == "drag" and window.lastTouchX and not windowCheck(window, e3, e4) then
|
||||||
|
local xOffset, yOffset = e3 - window.lastTouchX, e4 - window.lastTouchY
|
||||||
|
if xOffset ~= 0 or yOffset ~= 0 then
|
||||||
|
window.localX, window.localY = window.localX + xOffset, window.localY + yOffset
|
||||||
|
window.lastTouchX, window.lastTouchY = e3, e4
|
||||||
|
|
||||||
|
workspace:draw()
|
||||||
|
end
|
||||||
|
elseif e1 == "drop" then
|
||||||
|
window.lastTouchX, window.lastTouchY = nil, nil
|
||||||
end
|
end
|
||||||
elseif e1 == "drop" then
|
|
||||||
window.lastTouchX, window.lastTouchY = nil, nil
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -4242,7 +4244,7 @@ local function windowResize(window, width, height)
|
|||||||
return window
|
return window
|
||||||
end
|
end
|
||||||
|
|
||||||
local function windowMaximize(window)
|
function GUI.windowMaximize(window)
|
||||||
if window.maximized then
|
if window.maximized then
|
||||||
window.localX, window.localY = window.oldGeometryX, window.oldGeometryY
|
window.localX, window.localY = window.oldGeometryX, window.oldGeometryY
|
||||||
window:resize(window.oldGeometryWidth, window.oldGeometryHeight)
|
window:resize(window.oldGeometryWidth, window.oldGeometryHeight)
|
||||||
@ -4255,7 +4257,7 @@ local function windowMaximize(window)
|
|||||||
window.maximized = not window.maximized
|
window.maximized = not window.maximized
|
||||||
end
|
end
|
||||||
|
|
||||||
local function windowMinimize(window)
|
function GUI.windowMinimize(window)
|
||||||
window.hidden = not window.hidden
|
window.hidden = not window.hidden
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -4265,10 +4267,11 @@ function GUI.window(x, y, width, height)
|
|||||||
window.passScreenEvents = false
|
window.passScreenEvents = false
|
||||||
|
|
||||||
window.resize = windowResize
|
window.resize = windowResize
|
||||||
window.maximize = windowMaximize
|
window.maximize = GUI.windowMaximize
|
||||||
window.minimize = windowMinimize
|
window.minimize = GUI.windowMinimize
|
||||||
window.eventHandler = windowEventHandler
|
window.eventHandler = windowEventHandler
|
||||||
window.draw = windowDraw
|
window.draw = windowDraw
|
||||||
|
window.movingEnabled = true
|
||||||
|
|
||||||
return window
|
return window
|
||||||
end
|
end
|
||||||
|
|||||||
@ -1485,7 +1485,26 @@ local function updateMenu()
|
|||||||
desktopMenu.children = focusedWindow and focusedWindow.menu.children or system.menuInitialChildren
|
desktopMenu.children = focusedWindow and focusedWindow.menu.children or system.menuInitialChildren
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local function setWorkspaceHidden(state)
|
||||||
|
dockContainer.hidden = state
|
||||||
|
desktopIconField.hidden = state
|
||||||
|
desktopBackground.hidden = state
|
||||||
|
end
|
||||||
|
|
||||||
|
local function windowMaximize(window, ...)
|
||||||
|
window.movingEnabled = window.maximized
|
||||||
|
setWorkspaceHidden(not window.maximized)
|
||||||
|
GUI.windowMaximize(window, ...)
|
||||||
|
end
|
||||||
|
|
||||||
|
local function windowMinimize(...)
|
||||||
|
setWorkspaceHidden(false)
|
||||||
|
GUI.windowMinimize(...)
|
||||||
|
end
|
||||||
|
|
||||||
local function windowRemove(window)
|
local function windowRemove(window)
|
||||||
|
setWorkspaceHidden(false)
|
||||||
|
|
||||||
if window.dockIcon then
|
if window.dockIcon then
|
||||||
-- Удаляем ссылку на окно из докиконки
|
-- Удаляем ссылку на окно из докиконки
|
||||||
window.dockIcon.windows[window] = nil
|
window.dockIcon.windows[window] = nil
|
||||||
@ -1582,6 +1601,8 @@ function system.addWindow(window, dontAddToDock, preserveCoordinates)
|
|||||||
|
|
||||||
-- "Закрытие" акошычка
|
-- "Закрытие" акошычка
|
||||||
window.remove = windowRemove
|
window.remove = windowRemove
|
||||||
|
window.maximize = windowMaximize
|
||||||
|
window.minimize = windowMinimize
|
||||||
|
|
||||||
-- Кнопочкам тоже эту хуйню пихаем
|
-- Кнопочкам тоже эту хуйню пихаем
|
||||||
if window.actionButtons then
|
if window.actionButtons then
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user