opus/sys/modules/opus/ui/components/TabBarMenuItem.lua

20 lines
564 B
Lua
Raw Normal View History

local class = require('opus.class')
local UI = require('opus.ui')
2019-02-06 04:03:57 +00:00
UI.TabBarMenuItem = class(UI.Button)
UI.TabBarMenuItem.defaults = {
UIElement = 'TabBarMenuItem',
event = 'tab_select',
textInactiveColor = 'lightGray',
2019-11-17 05:12:02 +00:00
}
2019-02-06 04:03:57 +00:00
function UI.TabBarMenuItem:draw()
if self.selected then
self.backgroundColor = self:getProperty('selectedBackgroundColor')
self.backgroundFocusColor = self.backgroundColor
2019-02-06 04:03:57 +00:00
else
self.backgroundColor = self:getProperty('unselectedBackgroundColor')
self.backgroundFocusColor = self.backgroundColor
2019-02-06 04:03:57 +00:00
end
UI.Button.draw(self)
end