diff --git a/Programs/monitor-system/api/gui/page/init.lua b/Programs/monitor-system/api/gui/page/init.lua index 0d413b1..eeab951 100644 --- a/Programs/monitor-system/api/gui/page/init.lua +++ b/Programs/monitor-system/api/gui/page/init.lua @@ -65,7 +65,7 @@ Event.listen( local function drawTitle(title) local x = Constants.baseWidth local y = 1 - local width = 3 * Constants.baseWidth + local width = math.floor(2.5 * Constants.baseWidth) local height = math.floor(0.8 * Constants.baseHeight) Widget.drawBaseWidget(x, y, width, height, title) end @@ -88,6 +88,14 @@ local function drawNavigationButton(self, index) end end +local function drawRebootButton() + local width = math.floor(0.3 * Constants.baseWidth) + local height = math.floor(0.6 * Constants.baseHeight) + local x = math.floor(3.25 * Constants.baseWidth) + math.floor((Constants.baseWidth - width) / 2) + local y = math.floor((Constants.baseHeight - height) / 2) + Widget.drawBaseWidget(x, y, width, height, "Restart") +end + local function clickNavigationButton(self) if not self.active then return @@ -135,6 +143,7 @@ function page.create(element) for i = 1, 9 do elements.machineWidgets.active[i] = elements.machineWidgets[9 * (elements.machineWidgets.active.index - 1) + i] end + elements.navigationButtons[1] = { title = "◀", active = true, @@ -154,11 +163,14 @@ function page.create(element) draw = drawNavigationButton } - elements[4.5] = { + elements.rebootButton = { onClick = function() Computer.shutdown(true) end } + drawRebootButton() + + elements[4.5] = elements.rebootButton elements[6] = elements.machineWidgets.active[1] elements[7] = elements.machineWidgets.active[2] diff --git a/Programs/monitor-system/api/gui/panel.lua b/Programs/monitor-system/api/gui/panel.lua deleted file mode 100644 index 6db0328..0000000 --- a/Programs/monitor-system/api/gui/panel.lua +++ /dev/null @@ -1,27 +0,0 @@ --- Import section -Page = require("api.gui.page") -Graphics = require("graphics.graphics") -Colors = require("colors") -Component = require("component") -GPU = Component.gpu --- - -local panel = { - currentPage = Page.overview -} - -function panel.render() - Graphics.rectangle(GPU, 0, 0, 20, 160, Colors.background) - for index, page in ipairs(Page) do - if page ~= panel.currentPage then - Graphics.text(GPU, 0, 10 * (index - 1), Colors.labelColor, panel.title) - end - end -end - -function panel.navigate(page) - panel.findText(page.title) - page.render() -end - -return panel