mirror of
https://github.com/kepler155c/opus
synced 2025-11-05 01:53:00 +00:00
canvas overhaul
This commit is contained in:
@@ -20,7 +20,7 @@ local aliasTab = UI.Tab {
|
||||
},
|
||||
},
|
||||
grid = UI.Grid {
|
||||
y = 5,
|
||||
x = 2, y = 5, ex = -2, ey = -2,
|
||||
sortColumn = 'alias',
|
||||
columns = {
|
||||
{ heading = 'Alias', key = 'alias' },
|
||||
|
||||
@@ -22,20 +22,19 @@ local tab = UI.Tab {
|
||||
disableHeader = true,
|
||||
columns = {
|
||||
{ key = 'file' },
|
||||
}
|
||||
},
|
||||
getRowTextColor = function(self, row)
|
||||
if row == self.values[1] then
|
||||
return colors.yellow
|
||||
end
|
||||
return UI.Grid.getRowTextColor(self, row)
|
||||
end,
|
||||
},
|
||||
statusBar = UI.StatusBar {
|
||||
values = 'Double-click to set as preferred'
|
||||
},
|
||||
}
|
||||
|
||||
function tab.choices:getRowTextColor(row)
|
||||
if row == self.values[1] then
|
||||
return colors.yellow
|
||||
end
|
||||
return UI.Grid.getRowTextColor(self, row)
|
||||
end
|
||||
|
||||
function tab:updateChoices()
|
||||
local app = self.apps:getSelected().name
|
||||
local choices = { }
|
||||
|
||||
@@ -4,16 +4,17 @@ local UI = require('opus.ui')
|
||||
|
||||
local colors = _G.colors
|
||||
|
||||
-- -t80x30
|
||||
|
||||
if _G.http.websocket then
|
||||
local config = Config.load('cloud')
|
||||
|
||||
local tab = UI.Tab {
|
||||
tabTitle = 'Cloud',
|
||||
description = 'Cloud Catcher options',
|
||||
[1] = UI.Window {
|
||||
x = 2, y = 2, ex = -2, ey = 4,
|
||||
},
|
||||
key = UI.TextEntry {
|
||||
x = 3, ex = -3, y = 2,
|
||||
x = 3, ex = -3, y = 3,
|
||||
limit = 32,
|
||||
value = config.key,
|
||||
shadowText = 'Cloud key',
|
||||
@@ -22,13 +23,14 @@ if _G.http.websocket then
|
||||
},
|
||||
},
|
||||
button = UI.Button {
|
||||
x = 3, y = 4,
|
||||
text = 'Update',
|
||||
x = -8, ex = -2, y = -2,
|
||||
text = 'Apply',
|
||||
event = 'update_key',
|
||||
},
|
||||
labelText = UI.TextArea {
|
||||
x = 3, ex = -3, y = 6,
|
||||
x = 2, ex = -2, y = 6, ey = -4,
|
||||
textColor = colors.yellow,
|
||||
backgroundColor = colors.black,
|
||||
marginLeft = 0, marginRight = 0,
|
||||
value = string.format(
|
||||
[[Use a non-changing cloud key. Note that only a single computer can use this session at one time.
|
||||
|
||||
@@ -20,8 +20,8 @@ local tab = UI.Tab {
|
||||
description = 'Visualise HDD and disks usage',
|
||||
|
||||
drives = UI.ScrollingGrid {
|
||||
x = 2, y = 1,
|
||||
ex = '47%', ey = -7,
|
||||
x = 2, y = 2,
|
||||
ex = '47%', ey = -8,
|
||||
columns = {
|
||||
{ heading = 'Drive', key = 'name' },
|
||||
{ heading = 'Side' ,key = 'side', textColor = colors.yellow }
|
||||
@@ -30,7 +30,7 @@ local tab = UI.Tab {
|
||||
},
|
||||
infos = UI.Grid {
|
||||
x = '52%', y = 2,
|
||||
ex = -2, ey = -4,
|
||||
ex = -2, ey = -8,
|
||||
disableHeader = true,
|
||||
unfocusedBackgroundSelectedColor = colors.black,
|
||||
inactive = true,
|
||||
@@ -40,18 +40,23 @@ local tab = UI.Tab {
|
||||
{ key = 'value', align = 'right', textColor = colors.yellow },
|
||||
}
|
||||
},
|
||||
|
||||
[1] = UI.Window {
|
||||
x = 2, y = -6, ex = -2, ey = -2,
|
||||
backgroundColor = colors.black,
|
||||
},
|
||||
progress = UI.ProgressBar {
|
||||
x = 11, y = -2,
|
||||
ex = -2,
|
||||
x = 11, y = -3,
|
||||
ex = -3,
|
||||
},
|
||||
percentage = UI.Text {
|
||||
x = 11, y = -3,
|
||||
ex = '47%',
|
||||
align = 'center',
|
||||
y = -4, width = 5,
|
||||
x = 12,
|
||||
--align = 'center',
|
||||
backgroundColor = colors.black,
|
||||
},
|
||||
icon = UI.NftImage {
|
||||
x = 2, y = -5,
|
||||
x = 2, y = -6, ey = -2,
|
||||
backgroundColor = colors.black,
|
||||
image = NFT.parse(NftImages.blank)
|
||||
},
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ local tab = UI.Tab {
|
||||
tabTitle = 'Kiosk',
|
||||
description = 'Kiosk options',
|
||||
form = UI.Form {
|
||||
x = 2, ex = -2,
|
||||
x = 2, y = 2, ex = -2, ey = 5,
|
||||
manualControls = true,
|
||||
monitor = UI.Chooser {
|
||||
formLabel = 'Monitor', formKey = 'monitor',
|
||||
@@ -22,11 +22,12 @@ local tab = UI.Tab {
|
||||
},
|
||||
help = 'Adjust text scaling',
|
||||
},
|
||||
labelText = UI.TextArea {
|
||||
x = 2, ex = -2, y = 5,
|
||||
textColor = colors.yellow,
|
||||
value = 'Settings apply to kiosk mode selected during startup'
|
||||
},
|
||||
},
|
||||
labelText = UI.TextArea {
|
||||
x = 2, ex = -2, y = 7, ey = -2,
|
||||
textColor = colors.yellow,
|
||||
backgroundColor = colors.black,
|
||||
value = 'Settings apply to kiosk mode selected during startup'
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
@@ -8,19 +8,22 @@ local labelTab = UI.Tab {
|
||||
tabTitle = 'Label',
|
||||
description = 'Set the computer label',
|
||||
labelText = UI.Text {
|
||||
x = 3, y = 2,
|
||||
x = 3, y = 3,
|
||||
value = 'Label'
|
||||
},
|
||||
label = UI.TextEntry {
|
||||
x = 9, y = 2, ex = -4,
|
||||
x = 9, y = 3, ex = -4,
|
||||
limit = 32,
|
||||
value = os.getComputerLabel(),
|
||||
accelerators = {
|
||||
enter = 'update_label',
|
||||
},
|
||||
},
|
||||
[1] = UI.Window {
|
||||
x = 2, y = 2, ex = -2, ey = 4,
|
||||
},
|
||||
grid = UI.ScrollingGrid {
|
||||
y = 3,
|
||||
x = 2, y = 6, ex = -2, ey = -2,
|
||||
values = {
|
||||
{ name = '', value = '' },
|
||||
{ name = 'CC version', value = Util.getVersion() },
|
||||
@@ -30,10 +33,11 @@ local labelTab = UI.Tab {
|
||||
{ name = 'Computer ID', value = tostring(os.getComputerID()) },
|
||||
{ name = 'Day', value = tostring(os.day()) },
|
||||
},
|
||||
disableHeader = true,
|
||||
inactive = true,
|
||||
columns = {
|
||||
{ key = 'name', width = 12 },
|
||||
{ key = 'value' },
|
||||
{ key = 'value', textColor = colors.yellow },
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
@@ -9,12 +9,15 @@ local config = Config.load('multishell')
|
||||
local tab = UI.Tab {
|
||||
tabTitle = 'Launcher',
|
||||
description = 'Set the application launcher',
|
||||
[1] = UI.Window {
|
||||
x = 2, y = 2, ex = -2, ey = 5,
|
||||
},
|
||||
launcherLabel = UI.Text {
|
||||
x = 3, y = 2,
|
||||
x = 3, y = 3,
|
||||
value = 'Launcher',
|
||||
},
|
||||
launcher = UI.Chooser {
|
||||
x = 13, y = 2, width = 12,
|
||||
x = 13, y = 3, width = 12,
|
||||
choices = {
|
||||
{ name = 'Overview', value = 'sys/apps/Overview.lua' },
|
||||
{ name = 'Shell', value = 'sys/apps/ShellLauncher.lua' },
|
||||
@@ -22,17 +25,18 @@ local tab = UI.Tab {
|
||||
},
|
||||
},
|
||||
custom = UI.TextEntry {
|
||||
x = 13, ex = -3, y = 3,
|
||||
x = 13, ex = -3, y = 4,
|
||||
limit = 128,
|
||||
shadowText = 'File name',
|
||||
},
|
||||
button = UI.Button {
|
||||
x = 3, y = 5,
|
||||
text = 'Update',
|
||||
x = -8, ex = -2, y = -2,
|
||||
text = 'Apply',
|
||||
event = 'update',
|
||||
},
|
||||
labelText = UI.TextArea {
|
||||
x = 3, ex = -3, y = 7,
|
||||
x = 2, ex = -2, y = 7, ey = -4,
|
||||
backgroundColor = colors.black,
|
||||
textColor = colors.yellow,
|
||||
value = 'Choose an application launcher',
|
||||
},
|
||||
|
||||
@@ -2,24 +2,29 @@ local Ansi = require('opus.ansi')
|
||||
local Config = require('opus.config')
|
||||
local UI = require('opus.ui')
|
||||
|
||||
local colors = _G.colors
|
||||
local device = _G.device
|
||||
|
||||
local tab = UI.Tab {
|
||||
tabTitle = 'Network',
|
||||
description = 'Networking options',
|
||||
info = UI.TextArea {
|
||||
x = 3, y = 4,
|
||||
x = 2, y = 6, ex = -2, ey = -2,
|
||||
backgroundColor = colors.black,
|
||||
value = string.format(
|
||||
[[%sSet the primary modem used for wireless communications.%s
|
||||
|
||||
Reboot to take effect.]], Ansi.yellow, Ansi.reset)
|
||||
},
|
||||
[1] = UI.Window {
|
||||
x = 2, y = 2, ex = -2, ey = 4,
|
||||
},
|
||||
label = UI.Text {
|
||||
x = 3, y = 2,
|
||||
x = 3, y = 3,
|
||||
value = 'Modem',
|
||||
},
|
||||
modem = UI.Chooser {
|
||||
x = 10, ex = -3, y = 2,
|
||||
x = 10, ex = -3, y = 3,
|
||||
nochoice = 'auto',
|
||||
},
|
||||
}
|
||||
|
||||
@@ -7,6 +7,9 @@ local colors = _G.colors
|
||||
local passwordTab = UI.Tab {
|
||||
tabTitle = 'Password',
|
||||
description = 'Wireless network password',
|
||||
[1] = UI.Window {
|
||||
x = 2, y = 2, ex = -2, ey = 4,
|
||||
},
|
||||
newPass = UI.TextEntry {
|
||||
x = 3, ex = -3, y = 3,
|
||||
limit = 32,
|
||||
@@ -17,12 +20,13 @@ local passwordTab = UI.Tab {
|
||||
},
|
||||
},
|
||||
button = UI.Button {
|
||||
x = 3, y = 5,
|
||||
text = 'Update',
|
||||
x = -8, ex = -2, y = -2,
|
||||
text = 'Apply',
|
||||
event = 'update_password',
|
||||
},
|
||||
info = UI.TextArea {
|
||||
x = 3, ex = -3, y = 7,
|
||||
x = 2, ex = -2, y = 6, ey = -4,
|
||||
backgroundColor = colors.black,
|
||||
textColor = colors.yellow,
|
||||
inactive = true,
|
||||
value = 'Add a password to enable other computers to connect to this one.',
|
||||
|
||||
@@ -6,8 +6,11 @@ local tab = UI.Tab {
|
||||
tabTitle = 'Path',
|
||||
description = 'Set the shell path',
|
||||
tabClose = true,
|
||||
[1] = UI.Window {
|
||||
x = 2, y = 2, ex = -2, ey = 4,
|
||||
},
|
||||
entry = UI.TextEntry {
|
||||
x = 2, y = 2, ex = -2,
|
||||
x = 3, y = 3, ex = -3,
|
||||
limit = 256,
|
||||
shadowText = 'enter new path',
|
||||
accelerators = {
|
||||
@@ -16,7 +19,7 @@ local tab = UI.Tab {
|
||||
help = 'add a new path',
|
||||
},
|
||||
grid = UI.Grid {
|
||||
y = 4, ey = -3,
|
||||
x = 2, y = 6, ex = -2, ey = -3,
|
||||
disableHeader = true,
|
||||
columns = { { key = 'value' } },
|
||||
autospace = true,
|
||||
|
||||
@@ -7,7 +7,7 @@ if settings then
|
||||
tabTitle = 'Settings',
|
||||
description = 'Computercraft configurable settings',
|
||||
grid = UI.Grid {
|
||||
y = 2,
|
||||
x = 2, y = 2, ex = -2, ey = -2,
|
||||
autospace = true,
|
||||
sortColumn = 'name',
|
||||
columns = {
|
||||
|
||||
@@ -42,25 +42,23 @@ local tab = UI.Tab {
|
||||
tabTitle = 'Shell',
|
||||
description = 'Shell options',
|
||||
grid1 = UI.ScrollingGrid {
|
||||
y = 2, ey = -10, x = 3, ex = -16,
|
||||
y = 2, ey = -10, x = 2, ex = -17,
|
||||
disableHeader = true,
|
||||
columns = { { key = 'name' } },
|
||||
values = allSettings,
|
||||
sortColumn = 'name',
|
||||
},
|
||||
grid2 = UI.ScrollingGrid {
|
||||
y = 2, ey = -10, x = -14, ex = -3,
|
||||
y = 2, ey = -10, x = -14, ex = -2,
|
||||
disableHeader = true,
|
||||
columns = { { key = 'name' } },
|
||||
values = allColors,
|
||||
sortColumn = 'name',
|
||||
},
|
||||
directoryLabel = UI.Text {
|
||||
x = 2, y = -2,
|
||||
value = 'Display directory',
|
||||
},
|
||||
directory = UI.Checkbox {
|
||||
x = 20, y = -2,
|
||||
x = 2, y = -2,
|
||||
labelBackgroundColor = colors.black,
|
||||
label = 'Directory',
|
||||
value = config.displayDirectory
|
||||
},
|
||||
reset = UI.Button {
|
||||
@@ -74,7 +72,7 @@ local tab = UI.Tab {
|
||||
event = 'update',
|
||||
},
|
||||
display = UI.Window {
|
||||
x = 3, ex = -3, y = -8, height = 5,
|
||||
x = 2, ex = -2, y = -8, height = 5,
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user