xTray autosizing.... Thread last updated on 2007-03-23 18:37:03

Posted by member 256241 on 2007-03-22 23:03:40

Hello, I am having trouble making a horizontal xTray autoresize. The issue is that I would like my xTray to remain the same width regardless of how many items are in it, and only change the height when it needs another row (xTrayAutoSize works, except it resizes the width as well).

I have tried:
xTrayOnLineAdd !xTrayResizeBy 0 16
xTrayOnLineRemove !xTrayResizeBy 0 -16
and although the individual bangs WORK (tested with lsxcommand), they are not getting called when they should.


Here is my config:
xTrayx 0
xTrayy 44
xTraywidth 300
xTrayheight 24
xTrayLines 2
xTrayRows 6
xTrayWrapCount 18
xTrayLeftBorder 6
xTrayRightBorder 6
xTrayTopBorder 4
xTrayBottomBorder 4
xTrayPaintingmode .image
xTrayImageMode "stretch"
;xTrayLoadInBox true
xTrayImage "$themedir$images\tray.bmp"
xTraySolidColors 0148AA 0148AA 0148AA
;xTrayAutoSize true
xTrayStartHidden true
xTrayAlwaysOnTop true
xTrayAlwaysFireClickEvents true

;xTrayOnLineAdd !loadhooker
xTrayOnResize !xtrayadjust (this doesnt affect the actuall xTray)
xTrayOnLineAdd !xTrayResizeBy 0 16
xTrayOnLineRemove !xTrayResizeBy 0 -16




Thanks for reading, help would be appreciated.

(It's mildly embaressing how many threads I've created recently, but I'm almost there!)

Posted by member 256241 on 2007-03-22 23:13:19 link

Sorry, I just figured out (a workaround at least) - I looked for where to delete the thread but couldn't see how....

Anyway, I just did this:

xTrayOnAdd !sizing
xTrayOnRemove !sizing

*script bang !sizing
*Script exec !If ["%#xTrayCurrentIconCount%#" > "18"] [!xTrayResize 300 40] [!xTrayResize 300 24]
*script ~bang

A bit shoddy, but hey, it work's and I doubt anyone has more than 36 tray icons.




Sorry for wasting space :$

Posted by member 93947 on 2007-03-23 18:37:03 link

you dont need scripting, just a clever layout.
My Tray grows from *right* to *left* with a constant *height* of 2 icons. Changing the code to your particular needs is left as an excercise to the reader.

xTrayLayout ".vertical"
xTrayDirection ".left"
xTrayWrapDirection ".left"
xTrayWrapCount 2