Page 1 of 1

Script to toggle "large icons" ON/OFF for toolbar buttons?

Posted: 03 May 2013 22:45
by ghost zero
Does anyone know how to make a script to toggle "large icons" ON/OFF for toolbar buttons?

Re: Script to toggle "large icons" ON/OFF for toolbar button

Posted: 03 May 2013 22:55
by serendipity
ghost zero wrote:Does anyone know how to make a script to toggle "large icons" ON/OFF for toolbar buttons?
toolbar( , 1);//Large
toolbar( , 0);//Small

Re: Script to toggle "large icons" ON/OFF for toolbar button

Posted: 03 May 2013 23:00
by serendipity
Sorry thats not complete as its not a toggle:
One way is to have an ini file with toggle info.
Another way would be use save settings and retrieve key ToolbarLarge from ini and set the other size automatically. Second one has the disadvantage of settings being saved each time to retrieve that info.

Re: Script to toggle "large icons" ON/OFF for toolbar button

Posted: 03 May 2013 23:11
by highend
Just use a permanent variable...

E.g.:

Code: Select all

	if (isset($P_ICON_TOGGLE_LARGE)) {
		toolbar(, "0");
		unset $P_ICON_TOGGLE_LARGE;
	} else {
		toolbar( , "1");
		perm $P_ICON_TOGGLE_LARGE = "True";
	}
	

Re: Script to toggle "large icons" ON/OFF for toolbar button

Posted: 03 May 2013 23:13
by serendipity
highend wrote:Just use a permanent variable...
Oh yes, i keep forgetting about PVs. :lol:

Re: Script to toggle "large icons" ON/OFF for toolbar button

Posted: 03 May 2013 23:22
by ghost zero
highend wrote:Just use a permanent variable...

E.g.:

Code: Select all

	if (isset($P_ICON_TOGGLE_LARGE)) {
		toolbar(, "0");
		unset $P_ICON_TOGGLE_LARGE;
	} else {
		toolbar( , "1");
		perm $P_ICON_TOGGLE_LARGE = "True";
	}
	
unfortunately, that requires a second click before it starts working during the session. is there a smoother solution?

Re: Script to toggle "large icons" ON/OFF for toolbar button

Posted: 03 May 2013 23:53
by serendipity
ghost zero wrote:unfortunately, that requires a second click before it starts working during the session. is there a smoother solution?
XY will remember permanent variable for you if you enable:
Configuration | Refresh, Icons, History | Remember permanent variables

Re: Script to toggle "large icons" ON/OFF for toolbar button

Posted: 05 May 2013 07:03
by ghost zero
thanks