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
|
|
|
|
|
|
|
UI.TabBarMenuItem = class(UI.Button)
|
|
|
|
UI.TabBarMenuItem.defaults = {
|
|
|
|
UIElement = 'TabBarMenuItem',
|
|
|
|
event = 'tab_select',
|
2019-11-17 05:12:02 +00:00
|
|
|
}
|
2019-02-06 04:03:57 +00:00
|
|
|
function UI.TabBarMenuItem:draw()
|
|
|
|
if self.selected then
|
2020-04-22 04:40:59 +00:00
|
|
|
self.backgroundColor = self:getProperty('selectedBackgroundColor')
|
|
|
|
self.backgroundFocusColor = self.backgroundColor
|
2020-05-31 02:05:53 +00:00
|
|
|
self.textColor = self:getProperty('selectedTextColor')
|
2019-02-06 04:03:57 +00:00
|
|
|
else
|
2020-04-22 04:40:59 +00:00
|
|
|
self.backgroundColor = self:getProperty('unselectedBackgroundColor')
|
|
|
|
self.backgroundFocusColor = self.backgroundColor
|
2020-05-31 02:05:53 +00:00
|
|
|
self.textColor = self:getProperty('unselectedTextColor')
|
2019-02-06 04:03:57 +00:00
|
|
|
end
|
|
|
|
UI.Button.draw(self)
|
|
|
|
end
|