1
0
mirror of https://github.com/kepler155c/opus synced 2024-06-14 01:16:52 +00:00
opus/sys/modules/opus/ui/components/TabBarMenuItem.lua
kepler155c@gmail.com a3a8c64be8 UI docs
2019-11-16 22:12:02 -07:00

28 lines
782 B
Lua

local class = require('opus.class')
local UI = require('opus.ui')
local colors = _G.colors
UI.TabBarMenuItem = class(UI.Button)
UI.TabBarMenuItem.defaults = {
UIElement = 'TabBarMenuItem',
event = 'tab_select',
textColor = colors.black,
selectedBackgroundColor = colors.cyan,
unselectedBackgroundColor = colors.lightGray,
backgroundColor = colors.lightGray,
}
UI.TabBarMenuItem.inherits = {
selectedBackgroundColor = 'selectedBackgroundColor',
}
function UI.TabBarMenuItem:draw()
if self.selected then
self.backgroundColor = self.selectedBackgroundColor
self.backgroundFocusColor = self.selectedBackgroundColor
else
self.backgroundColor = self.unselectedBackgroundColor
self.backgroundFocusColor = self.unselectedBackgroundColor
end
UI.Button.draw(self)
end