Ok, so I don’t like how you can only resize with respect to one particular edge/corner of the window. I want a resize function that detects which edge you are closest to and resizes in that direction. That is what the following functions accomplish. Unfortunately, this method is quite a bit laggy. I also use ResizeOpaque on almost all my windows, and with this MyResize function the window that you are resizing does not refresh very well during the resize.
Any ideas on how I can make this more efficient?
[code]DestroyFunc MyResize
AddToFunc MyResize
#+ I resize direction SE
- I PipeRead
‘if [ $[pointer.wx] -lt $(($[w.width]/3)) ]; then
echo ResizeLeft;
elif [ $[pointer.wx] -lt $((2*$[w.width]/3)) ]; then
echo ResizeMiddle;
else echo ResizeRight; fi’ - I Resize $[direction]
– helper functions
DestroyFunc ResizeLeft
AddToFunc ResizeLeft
- I PipeRead
‘if [ $[pointer.wy] -lt $(($[w.height]/3)) ]; then
echo CursorStyle RESIZE top_left_corner;
echo SetEnv direction ‘“direction NW”’;
elif [ $[pointer.wy] -lt $((2*$[w.height]/3)) ]; then
echo CursorStyle RESIZE left_side;
echo SetEnv direction ‘“direction W”’;
else echo CursorStyle RESIZE bottom_left_corner;
echo SetEnv direction ‘“direction SW”’; fi’
DestroyFunc ResizeMiddle
AddToFunc ResizeMiddle
- I PipeRead
‘if [ $[pointer.wy] -lt $(($[w.height]/3)) ]; then
echo CursorStyle RESIZE top_side;
echo SetEnv direction ‘“direction N”’;
elif [ $[pointer.wy] -lt $((2*$[w.height]/3)) ]; then
echo CursorStyle RESIZE cross;
echo SetEnv direction;
else echo CursorStyle RESIZE bottom_side;
echo SetEnv direction ‘“direction S”’; fi’
DestroyFunc ResizeRight
AddToFunc ResizeRight
- I PipeRead
‘if [ $[pointer.wy] -lt $(($[w.height]/3)) ]; then
echo CursorStyle RESIZE top_right_corner;
echo SetEnv direction ‘“direction NE”’;
elif [ $[pointer.wy] -lt $((2*$[w.height]/3)) ]; then
echo CursorStyle RESIZE right_side;
echo SetEnv direction ‘“direction E”’;
else echo CursorStyle RESIZE bottom_right_corner;
echo SetEnv direction ‘“direction SE”’; fi’[/code]