mirror of
https://github.com/kepler155c/opus
synced 2025-01-16 02:15:42 +00:00
minor bugfixes - cleanup
This commit is contained in:
parent
7224d441ca
commit
b0d2ce0199
@ -138,19 +138,6 @@ function page:eventHandler(event)
|
|||||||
self:executeStatement('_ENV')
|
self:executeStatement('_ENV')
|
||||||
command = nil
|
command = nil
|
||||||
|
|
||||||
elseif event.type == 'hide_output' then
|
|
||||||
self.output:disable()
|
|
||||||
|
|
||||||
self.titleBar.oy = -1
|
|
||||||
self.titleBar.event = 'show_output'
|
|
||||||
self.titleBar.closeInd = '^'
|
|
||||||
self.titleBar:resize()
|
|
||||||
|
|
||||||
self.grid.ey = -2
|
|
||||||
self.grid:resize()
|
|
||||||
|
|
||||||
self:draw()
|
|
||||||
|
|
||||||
elseif event.type == 'tab_select' then
|
elseif event.type == 'tab_select' then
|
||||||
self:setFocus(self.prompt)
|
self:setFocus(self.prompt)
|
||||||
|
|
||||||
@ -201,7 +188,7 @@ function page:eventHandler(event)
|
|||||||
command = nil
|
command = nil
|
||||||
self.grid:setValues(t)
|
self.grid:setValues(t)
|
||||||
self.grid:setIndex(1)
|
self.grid:setIndex(1)
|
||||||
self:draw()
|
self.grid:draw()
|
||||||
end
|
end
|
||||||
return true
|
return true
|
||||||
|
|
||||||
@ -247,7 +234,7 @@ function page:setResult(result)
|
|||||||
end
|
end
|
||||||
self.grid:setValues(t)
|
self.grid:setValues(t)
|
||||||
self.grid:setIndex(1)
|
self.grid:setIndex(1)
|
||||||
self:draw()
|
self.grid:draw()
|
||||||
end
|
end
|
||||||
|
|
||||||
function page.grid:eventHandler(event)
|
function page.grid:eventHandler(event)
|
||||||
|
@ -136,6 +136,19 @@ function tab:enable()
|
|||||||
self:updateDrives()
|
self:updateDrives()
|
||||||
self:updateInfo()
|
self:updateInfo()
|
||||||
UI.Tab.enable(self)
|
UI.Tab.enable(self)
|
||||||
|
self.handler = Event.on({ 'disk', 'disk_eject' }, function()
|
||||||
|
os.sleep(1)
|
||||||
|
if tab.enabled then
|
||||||
|
tab:updateDrives()
|
||||||
|
tab:updateInfo()
|
||||||
|
tab:sync()
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
end
|
||||||
|
|
||||||
|
function tab:disable()
|
||||||
|
Event.off(self.handler)
|
||||||
|
UI.Tab.disable(self)
|
||||||
end
|
end
|
||||||
|
|
||||||
function tab:eventHandler(event)
|
function tab:eventHandler(event)
|
||||||
@ -147,11 +160,4 @@ function tab:eventHandler(event)
|
|||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
|
||||||
Event.on({ 'disk', 'disk_eject' }, function()
|
|
||||||
os.sleep(1)
|
|
||||||
tab:updateDrives()
|
|
||||||
tab:updateInfo()
|
|
||||||
tab:sync()
|
|
||||||
end)
|
|
||||||
|
|
||||||
return tab
|
return tab
|
||||||
|
@ -361,7 +361,8 @@ function Canvas:__renderLayers(device, offset, doubleBuffer)
|
|||||||
y = region[2] - offset.y,
|
y = region[2] - offset.y,
|
||||||
ex = region[3] - offset.x,
|
ex = region[3] - offset.x,
|
||||||
ey = region[4] - offset.y },
|
ey = region[4] - offset.y },
|
||||||
{ x = region[1], y = region[2] }, doubleBuffer)
|
{ x = region[1], y = region[2] },
|
||||||
|
doubleBuffer)
|
||||||
end
|
end
|
||||||
self.regions = nil
|
self.regions = nil
|
||||||
|
|
||||||
|
@ -12,6 +12,7 @@ UI.Checkbox.defaults = {
|
|||||||
textColor = 'white',
|
textColor = 'white',
|
||||||
backgroundColor = 'black',
|
backgroundColor = 'black',
|
||||||
backgroundFocusColor = 'lightGray',
|
backgroundFocusColor = 'lightGray',
|
||||||
|
event = 'checkbox_change',
|
||||||
height = 1,
|
height = 1,
|
||||||
width = 3,
|
width = 3,
|
||||||
accelerators = {
|
accelerators = {
|
||||||
@ -52,7 +53,7 @@ end
|
|||||||
function UI.Checkbox:eventHandler(event)
|
function UI.Checkbox:eventHandler(event)
|
||||||
if event.type == 'checkbox_toggle' then
|
if event.type == 'checkbox_toggle' then
|
||||||
self.value = not self.value
|
self.value = not self.value
|
||||||
self:emit({ type = 'checkbox_change', checked = self.value, element = self })
|
self:emit({ type = self.event, checked = self.value, element = self })
|
||||||
self:draw()
|
self:draw()
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
@ -77,9 +77,7 @@ function UI.TitleBar.example()
|
|||||||
x = 2, y = 3,
|
x = 2, y = 3,
|
||||||
text = 'Press',
|
text = 'Press',
|
||||||
},
|
},
|
||||||
focus = function (self)
|
focus = UI.Window.raise,
|
||||||
self:raise()
|
|
||||||
end,
|
|
||||||
},
|
},
|
||||||
draw = function(self, isBG)
|
draw = function(self, isBG)
|
||||||
for i = 1, self.height do
|
for i = 1, self.height do
|
||||||
|
Loading…
Reference in New Issue
Block a user