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

Discuss and share scripts and script files...
Post Reply
ghost zero
Posts: 842
Joined: 26 Apr 2010 17:48

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

Post by ghost zero »

Does anyone know how to make a script to toggle "large icons" ON/OFF for toolbar buttons?

serendipity
Posts: 3360
Joined: 07 May 2007 18:14
Location: NJ/NY

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

Post 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

serendipity
Posts: 3360
Joined: 07 May 2007 18:14
Location: NJ/NY

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

Post 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.

highend
Posts: 14940
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

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

Post 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";
	}
	
One of my scripts helped you out? Please donate via Paypal

serendipity
Posts: 3360
Joined: 07 May 2007 18:14
Location: NJ/NY

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

Post by serendipity »

highend wrote:Just use a permanent variable...
Oh yes, i keep forgetting about PVs. :lol:

ghost zero
Posts: 842
Joined: 26 Apr 2010 17:48

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

Post 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?

serendipity
Posts: 3360
Joined: 07 May 2007 18:14
Location: NJ/NY

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

Post 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

ghost zero
Posts: 842
Joined: 26 Apr 2010 17:48

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

Post by ghost zero »

thanks

Post Reply