centering the taskbar Thread last updated on 2003-11-11 04:43:59

Posted by member 51864 on 2003-11-08 12:35:22

i know how to center something, but how would one go about making a taskbar that is always centered, no matter how many tasks. would i have to change the position variable when one is added then reload the module or what? im in the process of making my first theme, so i am a noob to a lot of it.

Posted by member 1 on 2003-11-08 12:56:11 link

TaskbarX $ResolutionX$ / 2

I think thats right...but I am probably wrong...I hate the math stuff...

Posted by member 2018 on 2003-11-08 13:24:23 link

TaskBarX $ResolutionX/2$ is the correct syntax.
the problem with this approach is it only works when LS starts or recycles so if you have a dynamic sized taskbar( ie the size grows everytime you run a new task) it won't work to keep it centered.
taskbarx $ResolutionX/2$
TaskbarOnAdd !tbca
TaskbarOnDel !tbcd

MzScript vars
TaskBarSize 0

Mzscript
*Script bang !tbcd
*Script exec !TaskbarSize 0 -20
*Script exec !varsub Taskbarsize 20
*Script exec !TaskbarMoveBy 0 20
*Script ~bang

*Script bang !tbca
*Script exec !TaskbarSize 0 20
*Script exec !varadd Taskbarsize 20
*Script exec !TaskbarMoveBy 0 -20
*Script ~bang

this should work although i havn't tested it.
good luck

Posted by member 51864 on 2003-11-09 21:04:35 link

thanks guys, i got another question
i have meters for RAM and SWAP and i want them positioned based on the center of the screen, but i cant use variables in the rainmeter.ini file, is there another way to position it?

Posted by member 37809 on 2003-11-10 07:22:34 link

try using mzscript's (*script start) facility to !rainmetermove it there

Posted by member 51864 on 2003-11-10 16:07:58 link

well, i tried it, but it wont move it when i put it with *script start

*script start !RainmeterMove $CenterX+134$ -75

does not move it, but if i put it in an action that is called when something is clicked on it does

*script bang !deskone
*script exec !VWMDesk 1
*script exec !RainmeterMove $CenterX+134$ -75
*script ~bang

but other actions such as !msgbox work with *script start. i tried loading the script file after the rainmeter is loaded but it still doesnt move it

Posted by member 36955 on 2003-11-10 17:50:01 link

make sure the module mzscript is loaded after the rainmeter module, since all *script start commands are executed when mzscript is loaded. its generally a good idea to load mzscript last in all themes unless there is some reason not to because of this

Posted by member 51864 on 2003-11-10 19:10:11 link

thanks! that did it, i had loaded it right before the rainmeter. thanks all for your help.

Posted by member 7 on 2003-11-11 04:43:59 link

If the module uses GetRCCoordinate you can append a 'c' to the coordinate and it'll be relative to the center of the screen. 10c would be 10 pixels to the right of the center, -10c would be 10 pixels to the left.