From b62a03d38cba009a522270efc570b0abf18d2e9c Mon Sep 17 00:00:00 2001 From: Cooldude2606 Date: Thu, 28 Dec 2017 16:39:32 +0000 Subject: [PATCH] Added colour change to the current tab --- ExpCore/GuiParts/center.lua | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/ExpCore/GuiParts/center.lua b/ExpCore/GuiParts/center.lua index 34d829cc..fa58961d 100644 --- a/ExpCore/GuiParts/center.lua +++ b/ExpCore/GuiParts/center.lua @@ -90,9 +90,10 @@ function center._center:draw(frame) local first_tab = nil for name,button in pairs(self.tabs) do first_tab = first_tab or name - button:draw(tab_bar_scroll_flow) + button:draw(tab_bar_scroll_flow).style.font_color = defines.color.white end self._tabs[self.name..'_'..first_tab](tab_scroll) + tab_bar_scroll_flow.children[1].style.font_color = defines.color.orange tab_scroll.style.height = 300 tab_scroll.style.width = 500 tab_bar_scroll.style.minimal_height = 40 @@ -121,6 +122,13 @@ function center._center:add_tab(name,caption,tooltip,callback) local _center = Gui._get_data('center')[frame_name] local _tab = _center._tabs[event.element.name] if is_type(_tab,'function') then + for _,button in pairs(event.element.parent.children) do + if button.name == event.element.name then + button.style.font_color = defines.color.orange + else + button.style.font_color = defines.color.white + end + end local success, err = pcall(_tab,tab) if not success then error(err) end end