16.30 - "The Wall of Pictures"

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
klownboy
Posts: 4109
Joined: 28 Feb 2012 19:27

Re: 16.30 - "The Wall of Pictures"

Post by klownboy »

Hi again TheQwerty, I can't believe how nice your script is especially with the CTBstates synced regardless of where the script is implemented. I've set up a CTB as well as a Customized keyboard shortcut. A couple of very minor suggestions or additions:

- Why not take advantage of the different icons established for each thumbconf when the script is implemented by a keyboard shortcut. Your code is there to change the name icon and state but you only use it if implanted by a CTB. What I suggest is determine the CTB index (e.g., $ctbindex) that the user assigned to the CTB based on the ctbname or just have the user provide it in the script, and then use that ctbindex in the code lines below. This way the icon on the CTB changes nicely when you use a customized keyboard shortcut. Though a check should be done if the user doesn't have a CTB assigned and only uses a CKS.

Code: Select all

//	if ($inCTB) {
		CtbName($name,$ctbindex);
		CtbState(GetToken($newState, 3, '|'),$ctbindex);
		CtbIcon(GetToken($newState, 4, '|',,2),$ctbindex);
// }
- The only other thing I did was to throw in a simple check to see if the current view is a thumbnail view. If it isn't just give a status message.

Code: Select all

	  $view = Get('View');
	  if("|4|5|6|" UnLikeI "*|$view|*") {status "Present view is not a thumbnail viewing mode."; end(1);}
Thanks again. Don should really consider having this or something similar as a built in button. :appl:
Windows 11, 22H2 Build 22621.1555 at 100% 2560x1440

TheQwerty
Posts: 4373
Joined: 03 Aug 2007 22:30

Re: 16.30 - "The Wall of Pictures"

Post by TheQwerty »

klownboy wrote:Why not take advantage of the different icons established for each thumbconf when the script is implemented by a keyboard shortcut. Your code is there to change the name icon and state but you only use it if implanted by a CTB. What I suggest is determine the CTB index (e.g., $ctbindex) that the user assigned to the CTB based on the ctbname or just have the user provide it in the script, and then use that ctbindex in the code lines below.
Yes, it's not yet perfect. Off the top of my head there is no good way to determine the former - the only option I can think of is to read <xyini> which I hate doing because then we have to care about how stale it may be.

The latter is an option, but I'm not crazy about it, because it would be easy to move the button and forget to set it. Another thought is to store it as a permanent variable whenever the button is clicked. I'm not a big fan of polluting the PVs but let me think about it.

My thinking here was just allowing the script to work whether the user puts it in a CTB or not - I admittedly did not give much thought to a user doing both. ;)

As an interim workaround how about assigning your shortcut keys (or other ways of triggering this script) to scripts which simulate clicking on the button?

Code: Select all

button 'ctb#', 1);
Of course replace the # with the button's number.
klownboy wrote:The only other thing I did was to throw in a simple check to see if the current view is a thumbnail view. If it isn't just give a status message.
Not a bad idea. Perhaps it would make more sense to have this activate a thumbnail view if the list is not already in one? Though then the question becomes which thumbnail view should it use? Or maybe they should be part of the state definition?

Hmmm... :?

TheQwerty
Posts: 4373
Joined: 03 Aug 2007 22:30

Re: 16.30 - "The Wall of Pictures"

Post by TheQwerty »

Discussion about storing script configurations split to a new topic: http://www.xyplorer.com/xyfc/viewtopic.php?f=3&t=15499

kunkel321
Posts: 645
Joined: 10 Jun 2012 03:45
Location: Near Seattle

Re: 16.30 - "The Wall of Pictures"

Post by kunkel321 »

Heck yea, very cool! I've been needing this!
ste(phen|ve) kunkel

klownboy
Posts: 4109
Joined: 28 Feb 2012 19:27

Re: 16.30 - "The Wall of Pictures"

Post by klownboy »

Another thought...In conjunction with changing of the thumbnail viewing mode, you could also change some other aspects of XY like removing the nav panel, menu bar, tab bar etc as I did in the ThumbnailViewerGallery script. Why not, it's essentially just being used for viewing thumbnails anyway. Though it might be smart to leave the toolbar on in any case if you don't have a KCS assigned. All personal preferences though. That script ran a second instance of XY with a different (XYplorer_Gallery.ini) so in some ways had even more options available, like for example, you could have a completely different set of icon sizes if you desired.

You could change the layout aspects based on your $newState variable. If you're going to the gallery mode or WallPic, use if(get(#663)) {#663;} and if you head back to the Normal mode use: if(!get(#663)) {#663;}
Windows 11, 22H2 Build 22621.1555 at 100% 2560x1440

klownboy
Posts: 4109
Joined: 28 Feb 2012 19:27

Re: 16.30 - "The Wall of Pictures"

Post by klownboy »

The scripts in this thread will likely not work if you don't take into account the new transparency flag for SC thumbsconf. Please refer to this thread viewtopic.php?f=7&t=24105
Windows 11, 22H2 Build 22621.1555 at 100% 2560x1440

Post Reply