GP SoftwareTwitter
Opus FAQsManualCommandsObjects

Autohide folder tree by mouse


#1

I've just create a little tool to show/hide folder tree by mouse.

You need to move mouse to the left border of Opus windows to show/hide folder tree.

You can exit tool by clicking icon in systray.

Include : AutoIt script and executable
Auto Hide Folder Tree Of Directory Opus.zip (239 KB)


#2

Nice tool. Though the timing should be adjusted if that's possible. Holding the mouse on the screen edge for too long makes the tree pop in and out of view repeatedly.

I think this should be built-in to Opus. Well, it would be better if a mouse click could open the tree, like the side bar in Opera.


#3

So don't hold the mouse on the screen edge :wink:
Now, script wait 500ms between each toogle... you can modify script and replace sleep(500) to sleep(2000) for 2s...


#4

Thankx for this nifty little tool; works nicely in DO 10.
I noticed that it only work on a non-maximizied window. Is it my system or is it a known issue?

Thankx
Beechhead


#5

This old tool was create for XP and I'm sure that you have Vista or 7.
On XP, x position of mazimized window is 0, on Vista/7, it's -8. So script doesn't work.

So this line must be change from
If $pos[0] > $size[0] and $pos[0] < $size[0]+6 and $pos[1] > $size[1]+$lister[1]+30 and $pos[1] < $size[1]+$size[3]-30 Then
to
If $pos[0] > $size[0] and $pos[0] < $size[0]+12 and $pos[1] > $size[1]+$lister[1]+30 and $pos[1] < $size[1]+$size[3]-30 Then
Because if $size[0]=-8 then $size[0]+6=-2 and it's not possible to put mouse to x-2 so out of screen.
Auto Hide Folder Tree Of Directory Opus.zip (283 KB)


#6

Pity, It works on a little notebook (1024x600) on W7. Unfortunately not on my desktop.
Thankx for explaining


#7

Edit - Fixed size issues & added delay to the folder tree itself.
Edit - Updated to block being triggered if outside the unmaximized window
This AutoHotkey script I'm working on works for the folder tree + viewer, it will work on all Windows versions that AutoHotkey will run on. :slight_smile:
To use it, just download AutoHotkey at autohotkey.com/
Make a new text file.
Paste the code and save and close it.
Change the extension from .txt to .ahk

  1. Auto show the tree then close once you move outside of it.
  2. Show the viewer if your mouse is in the area for 500MS but it will not close until you move your mouse out of the area and back another 500ms.
#SingleInstance, Force
#Persistent
DetectHiddenWindows, On
#NoTrayIcon
CoordMode, Mouse, Relative
SetTimer, MGP, 50
Return

/*
$ESC:: ;For testing ignore. :P
ToolTip, Closing
Sleep, 1000
ExitApp
*/

MGP: 
DPL = dopus.lister
IfWinActive, ahk_class dopus.lister 
{
        WinGetClass, mC, ahk_id %fID%
        MouseGetPos, fX, fY, fID, fWin
        If(mC < > DPL) {
        Return
    }
    WinGetPos, dX, dY, dW, dH, ahk_classdopus.lister
    Gosub, VT
    ControlGet, CG, Enabled, , SysTreeView321, ahk_classdopus.lister
		If(CG = 1)
{
		ControlGetPos, tX, tY, tW, tH, SysTreeView321, ahk_class dopus.lister
    If(CG = 1 && fX > tW+50) {
        SetTimer, MGP, Off
        Sleep, 100
        SendInput, {F8}
        Sleep, 100
        SetTimer, MGP, On
        Return
    }
}
    If(fX < 8 && fY > 90 && fY < dH - 40) {
        SetTimer, MGP, Off
        Sleep, 375
        MouseGetPos, fX, fY, fID, fWin
        WinGetClass, mCC, ahk_id %fID%
        If(mCC <> DPL) {
        SetTimer, MGP, On
        Return
    }
        MouseGetPos, fX, fY
        Sleep, 125
        If(fX < 8 && fY > 90 && fY < dH - 40) {
        SendInput, {F8}
        }
        MouseGetPos, fX, fY
        Loop, {
            MouseGetPos, fX, fY
            If(fX > 475 && fY > 90) {
                CG = 0
                SetTimer, MGP, On
                Break
            }
            If(fX > 475 && fY < dH - 40) {
                Break
            }
        }
    }
}
Return

VT: 
REV:= dW - 200
IfWinActive, ahk_classdopus.lister 
{
    MouseGetPos, fX, fY, fID, fWin
    ControlGet, CGR, Enabled, , dopus.listerviewpane1, ahk_classdopus.lister
    If(CGR = 1 && fX < REV) {
        SetTimer, MGP, Off
        Sleep, 200
        SetTimer, MGP, On
        Return
    }
    If(fX > dW - 8 && fY > 90 && fY < dH - 40 && fY) {
        SetTimer, MGP, Off
        Sleep, 500
                MouseGetPos, fX, fY, fID, fWin
        WinGetClass, mCC, ahk_id %fID%
        If(mCC <> DPL) {
        SetTimer, MGP, On
        Return
    }
        If(fX > dW - 8 && fY > 90 && fY < dH - 40 && fY) {
            SendInput, {F7}
        }
        MouseGetPos, fX, fY
        Loop, {
            MouseGetPos, fX, fY
            If(fX < REV && fY > 90) {
                SetTimer, MGP, On
                Break
            }

        }
    }
}
Return

#8

As I have not implemented the above code, it may be that I am missing something quite special about its functionality.

However, based on the thread title alone, I thought I'd offer my 'Toggle Tree' button. I say ''my' button, because It is part of my standard layout, but I recall others (possibly Leo and/or Jon) played a part in its development, and perhaps others did too. It was a while ago. Which makes it sound like it must be complex, but nothing could be further from the truth. its main feature is its simplicity.

I have two layouts, one called 'My Default', and one called 'My Default - Tree'. As the names suggest, the only difference between them is the absence or presence of the folder tree. The rest of the layout is exactly the same, and in the same position in both layouts. The button code is:

@ifset:TREE=toggle Prefs LAYOUT "My Default" LAYOUTCLOSELISTERS=yes @ifset:else Prefs LAYOUT "My Default - Tree" LAYOUTCLOSELISTERS=yes

Jon's beautiful @ifset function is the key to achieving this elegant simplicity. I've thought about re-using this technique to toggle between any two layout sets. As yet, I have not actually done so, but it could be useful nonetheless.


#9

Hi

I was looking after some way to autohide the folder tree and found this script, thanks for that :smiley: , I have now tried it out with AutoHotkey and it seems to work.

But I have some issue with it, when Dopus is in fullscreen on my desktop (1920x1080) I cant get the mouse over the left/right border, so I cant view the Folder Tree/Panelview, but if I set Dopus in windowmode it works fine to view/hide, but I want to use Dopus in fullscreen instead.

So is it possible some how change something in the script so its working with Dopus in fullscreen?, scipting is not my cup of tea, Im not good on that :frowning:

Sincerely
Thomas