mirror of
https://github.com/kepler155c/opus
synced 2025-11-26 12:04:52 +00:00
ui overhaul
This commit is contained in:
25
sys/apis/ui/components/TabBarMenuItem.lua
Normal file
25
sys/apis/ui/components/TabBarMenuItem.lua
Normal file
@@ -0,0 +1,25 @@
|
||||
local class = require('class')
|
||||
local UI = require('ui')
|
||||
|
||||
local colors = _G.colors
|
||||
|
||||
--[[-- TabBarMenuItem --]]--
|
||||
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,
|
||||
}
|
||||
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
|
||||
Reference in New Issue
Block a user