Browse Source

Add tab-spacing tag to MoveableTabBars

TheSumm 6 years ago
parent
commit
8e5bbcd3a1

+ 6
- 3
modules/corelib/ui/uimovabletabbar.lua View File

@@ -6,7 +6,7 @@ local function onTabClick(tab)
6 6
   tab.tabBar:selectTab(tab)
7 7
 end
8 8
 
9
-local function updateMargins(tabBar, ignored)
9
+local function updateMargins(tabBar)
10 10
   if #tabBar.tabs == 0 then return end
11 11
 
12 12
   local currentMargin = 0
@@ -309,8 +309,11 @@ function UIMoveableTabBar:moveTab(tab, units)
309 309
 end
310 310
 
311 311
 function UIMoveableTabBar:onStyleApply(styleName, styleNode)
312
-  if styleNode['moveable'] then
313
-    self.tabsMoveable = styleNode['moveable']
312
+  if styleNode['movable'] then
313
+    self.tabsMoveable = styleNode['movable']
314
+  end
315
+  if styleNode['tab-spacing'] then
316
+    self:setTabSpacing(styleNode['tab-spacing'])
314 317
   end
315 318
 end
316 319
 

+ 0
- 1
modules/game_console/console.lua View File

@@ -105,7 +105,6 @@ function init()
105 105
   consoleContentPanel = consolePanel:getChildById('consoleContentPanel')
106 106
   consoleTabBar = consolePanel:getChildById('consoleTabBar')
107 107
   consoleTabBar:setContentWidget(consoleContentPanel)
108
-  consoleTabBar:setTabSpacing(-1)
109 108
   channels = {}
110 109
 
111 110
   consolePanel.onKeyPress = function(self, keyCode, keyboardModifiers)

+ 2
- 1
modules/game_console/console.otui View File

@@ -81,7 +81,8 @@ Panel
81 81
     margin-left: 5
82 82
     margin-top: 3
83 83
     margin-right: 5
84
-    moveable: true
84
+    tab-spacing: 2
85
+    movable: true
85 86
 
86 87
   TabButton
87 88
     id: nextChannelButton

Loading…
Cancel
Save