mirror of
https://github.com/kepler155c/opus
synced 2025-10-21 10:47:40 +00:00
canvas use in UI overhaul
This commit is contained in:
@@ -72,6 +72,31 @@ local page = UI.Page {
|
||||
autospace = true,
|
||||
},
|
||||
},
|
||||
help = UI.SlideOut {
|
||||
backgroundColor = colors.cyan,
|
||||
x = 5, ex = -5, height = 8, y = -8,
|
||||
titleBar = UI.TitleBar {
|
||||
title = 'Network Help',
|
||||
event = 'slide_hide',
|
||||
},
|
||||
text = UI.TextArea {
|
||||
x = 2, y = 2,
|
||||
backgroundColor = colors.cyan,
|
||||
value = [[
|
||||
|
||||
In order to connect to another computer:
|
||||
|
||||
1. The target computer must have a password set (run 'password' from the shell prompt).
|
||||
|
||||
2. From this computer, click trust and enter the password for that computer.
|
||||
|
||||
This only needs to be done once.
|
||||
]],
|
||||
},
|
||||
accelerators = {
|
||||
q = 'slide_hide',
|
||||
}
|
||||
},
|
||||
notification = UI.Notification { },
|
||||
accelerators = {
|
||||
t = 'telnet',
|
||||
@@ -180,27 +205,9 @@ function page:eventHandler(event)
|
||||
sendCommand(t.id, 'shutdown')
|
||||
end
|
||||
end
|
||||
|
||||
if event.type == 'help' then
|
||||
UI:setPage(UI.Dialog {
|
||||
title = 'Network Help',
|
||||
height = 10,
|
||||
backgroundColor = colors.white,
|
||||
text = UI.TextArea {
|
||||
x = 2, y = 2,
|
||||
backgroundColor = colors.white,
|
||||
value = [[
|
||||
In order to connect to another computer:
|
||||
|
||||
1. The target computer must have a password set (run 'password' from the shell prompt).
|
||||
2. From this computer, click trust and enter the password for that computer.
|
||||
|
||||
This only needs to be done once.
|
||||
]],
|
||||
},
|
||||
accelerators = {
|
||||
q = 'cancel',
|
||||
}
|
||||
})
|
||||
self.help:show()
|
||||
|
||||
elseif event.type == 'ports' then
|
||||
self.ports.grid:update()
|
||||
|
@@ -106,6 +106,7 @@ local page = UI.Page {
|
||||
}
|
||||
},
|
||||
editor = UI.SlideOut {
|
||||
y = -12, height = 12,
|
||||
backgroundColor = colors.cyan,
|
||||
titleBar = UI.TitleBar {
|
||||
title = 'Edit Application',
|
||||
|
@@ -8,7 +8,7 @@ UI:configure('System', ...)
|
||||
|
||||
local systemPage = UI.Page {
|
||||
tabs = UI.Tabs {
|
||||
settings = UI.Window {
|
||||
settings = UI.Tab {
|
||||
tabTitle = 'Category',
|
||||
grid = UI.Grid {
|
||||
y = 2,
|
||||
|
@@ -1,7 +1,7 @@
|
||||
local Config = require('config')
|
||||
local UI = require('ui')
|
||||
|
||||
local aliasTab = UI.Window {
|
||||
local aliasTab = UI.Tab {
|
||||
tabTitle = 'Aliases',
|
||||
description = 'Shell aliases',
|
||||
alias = UI.TextEntry {
|
||||
|
@@ -4,7 +4,7 @@ local Util = require('util')
|
||||
local fs = _G.fs
|
||||
local os = _G.os
|
||||
|
||||
local labelTab = UI.Window {
|
||||
local labelTab = UI.Tab {
|
||||
tabTitle = 'Label',
|
||||
description = 'Set the computer label',
|
||||
labelText = UI.Text {
|
||||
|
@@ -3,7 +3,7 @@ local UI = require('ui')
|
||||
|
||||
local device = _G.device
|
||||
|
||||
local tab = UI.Window {
|
||||
local tab = UI.Tab {
|
||||
tabTitle = 'Network',
|
||||
description = 'Networking options',
|
||||
form = UI.Form {
|
||||
@@ -40,7 +40,7 @@ function tab:enable()
|
||||
local config = Config.load('os')
|
||||
self.form.modem.value = config.wirelessModem or 'auto'
|
||||
|
||||
UI.Window.enable(self)
|
||||
UI.Tab.enable(self)
|
||||
end
|
||||
|
||||
function tab:eventHandler(event)
|
||||
|
@@ -2,7 +2,7 @@ local Security = require('security')
|
||||
local SHA1 = require('sha1')
|
||||
local UI = require('ui')
|
||||
|
||||
local passwordTab = UI.Window {
|
||||
local passwordTab = UI.Tab {
|
||||
tabTitle = 'Password',
|
||||
description = 'Wireless network password',
|
||||
oldPass = UI.TextEntry {
|
||||
|
@@ -2,7 +2,7 @@ local Config = require('config')
|
||||
local UI = require('ui')
|
||||
local Util = require('util')
|
||||
|
||||
local pathTab = UI.Window {
|
||||
local pathTab = UI.Tab {
|
||||
tabTitle = 'Path',
|
||||
description = 'Set the shell path',
|
||||
tabClose = true,
|
||||
|
@@ -3,7 +3,6 @@ local UI = require('ui')
|
||||
local settings = _G.settings
|
||||
|
||||
if settings then
|
||||
|
||||
local values = { }
|
||||
for _,v in pairs(settings.getNames()) do
|
||||
local value = settings.get(v)
|
||||
@@ -16,11 +15,11 @@ if settings then
|
||||
})
|
||||
end
|
||||
|
||||
local settingsTab = UI.Window {
|
||||
local settingsTab = UI.Tab {
|
||||
tabTitle = 'Settings',
|
||||
description = 'Computercraft configurable settings',
|
||||
grid = UI.Grid {
|
||||
y = 1,
|
||||
y = 2,
|
||||
values = values,
|
||||
autospace = true,
|
||||
sortColumn = 'name',
|
||||
|
@@ -9,7 +9,7 @@ if turtle then
|
||||
local values = { }
|
||||
Config.load('gps', values.home and { values.home } or { })
|
||||
|
||||
local gpsTab = UI.Window {
|
||||
local gpsTab = UI.Tab {
|
||||
tabTitle = 'GPS',
|
||||
labelText = UI.Text {
|
||||
x = 3, y = 2,
|
||||
|
Reference in New Issue
Block a user