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

21 lines
646 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',
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
2020-05-31 02:05:53 +00:00
self.textColor = self:getProperty('selectedTextColor')
2019-02-06 04:03:57 +00:00
else
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