Theme design issue Thread last updated on 2004-07-08 21:47:06

Posted by member 95693 on 2004-07-03 11:12:52

I am working on tweaking my first theme and I'm having some problems trying to get the theme to be resolution independent. The problem that I'm having is that I have 3 xLabels along the top and a systray... when the theme is used on small resolutions the middle label, which is set to display system information or winamp information, will sometimes overlap the systray if there are a lot of icons... I have the middle label set to autowidth and I was wondering if there is anyway to get the width of the systray, using systray2, so I can use that to tell xLabel dynamically what the max auto width is? Everything else is pretty much done. The theme has a variable font size depending on the rez and the size of the systray icons also change. Also I have the spacing of the other 2 labels set based upon their widths for each rez dynamically and the third is centered in the top of the screen so if there's any way to fix this last problem I should theoretically be done with making my theme resolution independent. Any help would be appreciated

Posted by member 57005 on 2004-07-04 22:59:52 link

Why don't you just use make it easy for yourself:

If ResolutionX = 640
Systray2 something =)
ElseIf ResolutionX = 800
Systray2 something else
ElseIf ResolutionX = 1024
Systray2 something else
Else
Systray2 if resolution not defined
EndIf


You can use "ResolutionY" in the same way...

Posted by member 95693 on 2004-07-04 23:15:23 link

if I'm understanding what you're suggesting it's not really going to work for me... I'm trying to keep everything to one line along the top of the screen otherwise I would have already set a max width and had the icons wrap around... the issue only occurs on low rez and with a lot of systray icons and a very long song name but I am well... anal at times with trying to make sure everything works and I want to make sure that if I ever do release my theme to the public that anyone using any rez I tested it on will have 0 problems reading everything

Posted by member 57005 on 2004-07-05 11:46:39 link

I read your first post a bit more in depth and well, it's a pain in the *** (a$$) making a res independent theme. I found this in the xlabel docs though:

"AutoWidthMode "left", "right", or "center"
Sets the horizontal auto adjusting method of the label.
"Left" keeps the x-coordinate given in (label-name)X constant (grows only right).
"Right" adjusts the the x-coordinate to keep the right coordinate (respective to initial (label-name)X and (label-name)Width) constant (grows only left).
"Center" adjusts the the x-coordinate to hold label centered to initial centerposition [(label-name)X+(label-name)Width/2] ((grows left and right identically)."

Maybe you could do something nice with it. =)

Posted by member 95693 on 2004-07-06 13:15:16 link

Sorry... I probably should have posted some of my existing code with my post so I could show what I meant... I'm already using autowidth for the three xlabels... the first two in the upper left corner are autowidth and the positioning is based on the width of the previous label... but the center one is autowidth from the center. My problem is that when I have a low rez or a very long winamp song name with a lot of systray icons the label will overlap the systray. I know I can get the positioning of the other xlabels so it doesn't overlap them but I'm trying to figure out a way to prevent the overlap of the systray

WinampX $ResolutionX/2$
WinampY "0"
WinampAutoHeightMode "top"
WinampAutoMaxHeight "2%"
WinampAutoWidthMode "center"
WinampAutoMaxWidth "$xwidth$"

xwidth $ResolutionX-((ClockCurrentWidth+UptimeCurrentWidth)*2)$


I'm hoping there's some code that I'm missing that I can get the width of the systray dynamically so I can put that into the code and then whichever is great sets the max width of the center label

Posted by member 125450 on 2004-07-06 21:20:59 link

I use ResolutionX in an equation to size and position
the taskbar

TaskWide $ResolutionX-682+trayx+mailx+ampx+vwmx$
TaskposX $424-ampx-mailx$

where trayx, ampx etc.. is the width of compononts
that way it should always fit

Posted by member 125450 on 2004-07-06 21:44:45 link

Posted by member 95693 on 2004-07-06 21:57:17 link

yeah but that's based on knowing the width of the other features... that's what I'm trying to add I just don't know how to get the width of the systray when it loads up... like with xlabel I can use LabelCurrentWidth and use that as part of my formula but I'd like to have one for SystrayCurrentWidth to use since the systray is autosized

Posted by member 125450 on 2004-07-06 22:15:58 link

try something like this
TaskbarX $ResolutionX-LabelCurrentWidth+systrayx$

Posted by member 95693 on 2004-07-06 22:41:52 link

that wouldn't work either b/c I have it on the right side and growing to the left... systrayx is -68... I think I'm just going to leave it as is and move on... b/c I think I'm just starting to get difficult... :p it's not a huge problem since it only happens with very low rez or HUGE song titles and I've set up a rather silly way of getting it done which seems to have done the trick for now...

thanks for all the help though...

Posted by member 12025 on 2004-07-07 06:02:44 link

Use VTray and XLabel. !ParseEvars is your friend. Or was if they changed that, too (I'm still using 3.0).
(systray count * (icon width + spacing X)) - spacing X + 2 * (border width) gives you the width, assuming it does not wrap.

Posted by member 37809 on 2004-07-07 07:12:22 link

what Cerbie said could also be referenced through $VTrayCurrentWidth$ or $SystrayCurrentWidth$, depending on the VTraySettingsCompatibility setting

[Edited]

Posted by member 95693 on 2004-07-07 10:30:53 link

excellent... thanks tnl... so there was an existing var for the systray width... this will be a big help with redoing the code for my theme... thanks for the help everyone

Posted by member 12025 on 2004-07-08 21:47:06 link

Yes, but not Systray2, unless there's been some major update recently :)