Page 1 of 1

Labels and CSS

Posted: Mon Mar 23, 2015 10:40 am
by Narnai
Hi, hello.

So, I've made a chat window using Geyser; I have 5 different labels that when clicked, they switch the whole thing to their respective miniconsole - awesome. I've been using label.setStyleSheet to style them and all labels look the same, but I want to change, lets say, the colour of the border of the one that's clicked on. Also, when another label is clicked, I'd like the colour of the first one to go back to its original colour.
I found a way to do that, but it involves changing StyleSheets of all labels each time new label is clicked and it all looks pretty messy and honestly, it seems like that's the most complicated way to do something so simple.

My question here being: is there a another way to do that?

Re: Labels and CSS

Posted: Mon Mar 23, 2015 3:56 pm
by Akaya
I would check out Vadi's CSS Manager. You can find it here

Re: Labels and CSS

Posted: Mon Mar 23, 2015 11:57 pm
by Angie
You don't need to change style for all labels, just the newly clicked one and the one that was active before. I have a similar function that looks like this:
Code: [show] | [select all] lua
function tab_menu(clicked_tab)
	if CURRENT_TAB ~= clicked_tab then
		hideWindow("GUI.Tab"..CURRENT_TAB)
		showWindow("GUI.Tab"..clicked_tab)
		setLabelStyleSheet("GUI.TabMenu"..CURRENT_TAB, [[ CSS for inactive tab ]])
		setLabelStyleSheet("GUI.TabMenu"..clicked_tab, [[ CSS for active tab ]])
		CURRENT_TAB = clicked_tab
	end
end