1
0
mirror of https://github.com/kepler155c/opus synced 2025-02-28 23:00:02 +00:00

ui improvements - disable shell scrolling

This commit is contained in:
kepler155c@gmail.com 2018-10-24 06:50:16 -04:00
parent adc5eb286d
commit 605e923d48
3 changed files with 8 additions and 2 deletions

View File

@ -3261,6 +3261,8 @@ function UI.Form:save()
if (child.pruneEmpty and type(child.value) == 'string' and #child.value == 0) or if (child.pruneEmpty and type(child.value) == 'string' and #child.value == 0) or
(child.pruneEmpty and type(child.value) == 'boolean' and not child.value) then (child.pruneEmpty and type(child.value) == 'boolean' and not child.value) then
self.values[child.formKey] = nil self.values[child.formKey] = nil
elseif child.validate == 'numeric' then
self.values[child.formKey] = tonumber(child.value)
else else
self.values[child.formKey] = child.value self.values[child.formKey] = child.value
end end

View File

@ -365,7 +365,7 @@ local term = _G.term
local textutils = _G.textutils local textutils = _G.textutils
local terminal = term.current() local terminal = term.current()
Terminal.scrollable(terminal, 100) --Terminal.scrollable(terminal, 100)
terminal.noAutoScroll = true terminal.noAutoScroll = true
local config = { local config = {

View File

@ -32,6 +32,7 @@ local config = {
backgroundColor = colors.gray, backgroundColor = colors.gray,
tabBarBackgroundColor = colors.gray, tabBarBackgroundColor = colors.gray,
focusBackgroundColor = colors.gray, focusBackgroundColor = colors.gray,
errorColor = colors.red,
}, },
color = { color = {
textColor = colors.lightGray, textColor = colors.lightGray,
@ -40,6 +41,7 @@ local config = {
backgroundColor = colors.gray, backgroundColor = colors.gray,
tabBarBackgroundColor = colors.gray, tabBarBackgroundColor = colors.gray,
focusBackgroundColor = colors.gray, focusBackgroundColor = colors.gray,
errorColor = colors.black,
}, },
} }
Config.load('multishell', config) Config.load('multishell', config)
@ -129,6 +131,7 @@ function multishell.openTab(tab)
print('\nPress enter to close') print('\nPress enter to close')
routine.isDead = true routine.isDead = true
routine.hidden = false routine.hidden = false
redrawMenu()
while true do while true do
local e, code = os.pullEventRaw('key') local e, code = os.pullEventRaw('key')
if e == 'terminate' or e == 'key' and code == keys.enter then if e == 'terminate' or e == 'key' and code == keys.enter then
@ -252,8 +255,9 @@ kernel.hook('multishell_redraw', function()
tab.ex = tabX + tab.width tab.ex = tabX + tab.width
tabX = tabX + tab.width tabX = tabX + tab.width
if tab ~= currentTab then if tab ~= currentTab then
local textColor = tab.isDead and _colors.errorColor or _colors.textColor
write(tab.sx, tab.title:sub(1, tab.width - 1), write(tab.sx, tab.title:sub(1, tab.width - 1),
_colors.backgroundColor, _colors.textColor) _colors.backgroundColor, textColor)
end end
end end
end end