Display appropriate strings for shortcuts

This commit is contained in:
airstruck
2016-01-28 13:47:11 -05:00
parent d1501fca41
commit b0614e67f1
3 changed files with 46 additions and 13 deletions

View File

@@ -10,6 +10,7 @@ not be explicitly created.
local ROOT = (...):gsub('[^.]*.[^.]*.[^.]*$', '')
local Backend = require(ROOT .. 'backend')
local Shortcut = require(ROOT .. 'shortcut')
local Layout, Event
@@ -176,9 +177,7 @@ local function initialize (self)
shortcut = ' '
edgeType = 'menu.expander'
else
--TODO: only displays first of multiple shortcuts, change this?
if type(shortcut) == 'table' then shortcut = shortcut[1] end
shortcut = shortcut:gsub('%f[%w].', string.upper) -- :gsub('-', '+')
shortcut = Shortcut.stringify(shortcut)
end
self.height = font:getLineHeight() + pad * 2
self.flow = 'x'