Customize folder tree pane autohide on window resize

When I resize an opus window horizontally making it smaller, the the file/folder pane first collapses before the folder tree, and then the folder tree will remain at a minimal collapsed state (not hidden).

is there a way to customize these behaviors? generally when im shrinking a window, the first thing i want to go is the folder tree, and if i keep shrinking i dont need to see the tree at all. Ive looked around but cant find anything around the horizontal sizing of the folder tree. id love to be able to customize these aspects

1 Like

There isn't a setting to change that at the moment.

Scripts have an OnListerResize [Directory Opus Manual] event but I'm not sure how well that would work for this.

if i resize shrink horizontally the window, could this onlisterresize be set to hide the folder tree when it the window reached a certain percentage width? (assuming different resolutions % would be better than fixed width)
and then show the tree when the window is resize back above the set width value

Yes a script could definitely do something like that.

Try this add-in.

function OnInit(initData) {
    initData.name = 'ToggleTree';
    initData.version = '2024-08-14';
    initData.url = 'https://resource.dopus.com/t/customize-folder-tree-pane-autohide-on-window-resize/52224';
    initData.desc = 'Toggle folder tree by width/height ratio';
    initData.default_enable = true;
    initData.min_version = '12.0';
}

function OnListerResize(listerResizeData) {
    if (listerResizeData.action != 'resize') return;
    var cmd = DOpus.Create().Command();
    var ratio = listerResizeData.width / listerResizeData.height;
    cmd.RunCommand('Set TREE=' + (ratio < 1.5 ? 'off' : 'on'));
    // DOpus.Output(ratio);
}

EventToggleTree.opusscriptinstall

1 Like

Thank you sooo much Ixp! I really appreciate this. Ive looked in dopus help docs before and i find it rather difficult to understand all the scripting through the help docs as they seem quite minimalistic for my beginner needs.

This is works so well, and feels so intuitive i hope its added into dopus officially at some point. I amended it a little to only toggle based on the width of 800 (pixels?) on my 4k monitor, instead of ratio. Im attaching my updated script here for others.

function OnInit(initData) {
    initData.name = 'ToggleTree';
    initData.version = '2024-08-14';
    initData.url = 'https://resource.dopus.com/t/customize-folder-tree-pane-autohide-on-window-resize/52224';
    initData.desc = 'Toggle folder tree by width/height ratio';
    initData.default_enable = true;
    initData.min_version = '12.0';
}

function OnListerResize(listerResizeData) {
    if (listerResizeData.action != 'resize') return;
    var cmd = DOpus.Create().Command();
   // var ratio = listerResizeData.width / listerResizeData.height;
   // cmd.RunCommand('Set TREE=' + (ratio < 1.5 ? 'off' : 'on'));
   // DOpus.Output('Ratio: ' + ratio);
	width = listerResizeData.width
   	cmd.RunCommand('Set TREE=' + (width < 800 ? 'off' : 'on'));
//	DOpus.Output('Width: ' + listerResizeData.width);
}

EventToggleTree_v2.opusscriptinstall (957 Bytes)