Ui enhancements 2.0 (#31)
* canvas overhaul * minor tweaks * list mode for overview * bugfixes + tweaks for editor 2.0 * minor tweaks * more editor work * refactor + new transitions * use layout() where appropriate and cleanup * mouse triple click + textEntry scroll ind * cleanup * cleanup + theme editor * color rework + cleanup * changes for deprecated ui methods * can now use named colors
This commit was merged in pull request #31.
This commit is contained in:
@@ -1,27 +1,19 @@
|
||||
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',
|
||||
textInactiveColor = 'lightGray',
|
||||
}
|
||||
function UI.TabBarMenuItem:draw()
|
||||
if self.selected then
|
||||
self.backgroundColor = self.selectedBackgroundColor
|
||||
self.backgroundFocusColor = self.selectedBackgroundColor
|
||||
self.backgroundColor = self:getProperty('selectedBackgroundColor')
|
||||
self.backgroundFocusColor = self.backgroundColor
|
||||
else
|
||||
self.backgroundColor = self.unselectedBackgroundColor
|
||||
self.backgroundFocusColor = self.unselectedBackgroundColor
|
||||
self.backgroundColor = self:getProperty('unselectedBackgroundColor')
|
||||
self.backgroundFocusColor = self.backgroundColor
|
||||
end
|
||||
UI.Button.draw(self)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user