From 0656b92f77467bdf92e56b2f3fb5c78a489ce0b9 Mon Sep 17 00:00:00 2001 From: Gabriel Moreira Minossi Date: Mon, 11 Jan 2021 16:50:06 -0300 Subject: [PATCH] Addind button layout --- Programs/monitor-system/api/gui/page/init.lua | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/Programs/monitor-system/api/gui/page/init.lua b/Programs/monitor-system/api/gui/page/init.lua index 9e0b8c3..f09e4f3 100644 --- a/Programs/monitor-system/api/gui/page/init.lua +++ b/Programs/monitor-system/api/gui/page/init.lua @@ -73,11 +73,21 @@ end local function drawPanelSection(index, title) local width = math.floor(0.6 * Constants.baseWidth) local height = math.floor(0.6 * Constants.baseHeight) - local x = (Constants.baseWidth - width) / 2 + local x = math.floor((Constants.baseWidth - width) / 2) local y = (index - 1) * Constants.baseHeight + math.floor((Constants.baseHeight - height) / 2) Widget.drawBaseWidget(x, y, width, height, title) end +local function drawNavigationButtons() + local width = math.floor(0.3 * Constants.baseWidth) + local height = math.floor(0.6 * Constants.baseHeight) + local x = math.floor(2.8 * Constants.baseWidth) + math.floor((Constants.baseWidth - width) / 2) + local y = 4 * Constants.baseHeight + math.floor((Constants.baseHeight - height) / 2) + Widget.drawBaseWidget(x, y, width, height, "<") + x = math.floor(3.2 * Constants.baseWidth) + math.floor((Constants.baseWidth - width) / 2) + Widget.drawBaseWidget(x, y, width, height, ">") +end + function page.create(element) drawTitle(element.title) @@ -95,6 +105,8 @@ function page.create(element) end end + drawNavigationButtons() + elements[4.5] = { onClick = function() Computer.shutdown(true)