2019-06-28 17:50:02 +00:00
|
|
|
local class = require('opus.class')
|
|
|
|
local UI = require('opus.ui')
|
2019-02-06 04:03:57 +00:00
|
|
|
|
|
|
|
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,
|
|
|
|
}
|
2019-11-17 05:12:02 +00:00
|
|
|
UI.TabBarMenuItem.inherits = {
|
|
|
|
selectedBackgroundColor = 'selectedBackgroundColor',
|
|
|
|
}
|
2019-02-06 04:03:57 +00:00
|
|
|
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
|