use layout() where appropriate and cleanup
This commit is contained in:
@@ -133,6 +133,12 @@ page = UI.Page {
|
||||
},
|
||||
},
|
||||
},
|
||||
accelerators = {
|
||||
['shift-right'] = 'size',
|
||||
['shift-left' ] = 'size',
|
||||
['shift-up' ] = 'size',
|
||||
['shift-down' ] = 'size',
|
||||
},
|
||||
eventHandler = function (self, event)
|
||||
if event.type == 'focus_change' and isRelevant(event.focused) then
|
||||
focused = event.focused
|
||||
@@ -168,6 +174,19 @@ page = UI.Page {
|
||||
|
||||
elseif event.type == 'editor_apply' then
|
||||
self.editor:hide()
|
||||
|
||||
elseif event.type == 'size' then
|
||||
local sizing = {
|
||||
['shift-right'] = { 1, 0 },
|
||||
['shift-left' ] = { -1, 0 },
|
||||
['shift-up' ] = { 0, -1 },
|
||||
['shift-down' ] = { 0, 1 },
|
||||
}
|
||||
self.ox = math.max(self.ox + sizing[event.ie.code][1], 1)
|
||||
self.oy = math.max(self.oy + sizing[event.ie.code][2], 1)
|
||||
UI.term.device.clear()
|
||||
self:resize()
|
||||
self:draw()
|
||||
end
|
||||
|
||||
return UI.Page.eventHandler(self, event)
|
||||
|
||||
Reference in New Issue
Block a user