Support and General Use > Theming and Appearance Customization

Statusbar top/bottom [may be noob question]

(1/1)

HornetMaX:
Hi all,
I'm trying to define a status bar (via a .sbs) that honors the off/top/bottom setting.
Let's say (to keep the example code simple) the only thing it does is to show the text "STATUS BAR".

I managed to define the UI View port correctly (i.e. accordingly to the status bar setting).
However, the best I've been able to come up is this:

--- Code: ---# Conditionally define UI area view port.
%Vi(t,0,8,-,-,1) # Top
%Vi(b,0,0,-,-8,1) # Bottom
%Vi(o,0,0,-,-,1) # Off
%?if(%St(statusbar), =,top)<%VI(t)|%?if(%St(statusbar), =,bottom)<%VI(b)|%VI(o)>>

# Conditionally activate top or bottom status bar.
%?if(%St(statusbar), =,top)<%Vd(x)|%?if(%St(statusbar), =,bottom)<%Vd(y)>>

%Vl(x,0,0,-,8,0)
STATUS BAR

%Vl(y,0,-8,-,8,0)
STATUS BAR

--- End code ---
What's annoying in the above is that I have to repeat twice the definition of my status bar objects, once for view port "x" (top one) and once for view port "y".

I tried to define a single view port with it's coord conditionally defined, but that didn't work:

--- Code: ---%Vd(z)
%Vl(z,0,%?if(%St(statusbar), =,top)<8|-8>,-,8,0)
STATUS BAR
--- End code ---

Anybody has an idea on how to do this without duplicating the code (which is doable but annoying) ?

MaX.

[Saint]:
Why not just do:


--- Code: ---%?if(%St(statusbar), =,top)<%VI(t)Vd(x)|%?if(%St(statusbar), =,bottom)<%VI(b)Vd(y)|%VI(o)>>
--- End code ---

It is important to note, and I feel I should mention, that the UI viewports (presently) are not really designed to be switched conditionally insofar as it can create some really ugly artefacts left on screen from the previous UI viewport position until the next fullscreen redraw.


[St.]

HornetMaX:

--- Quote from: [St.] on April 12, 2011, 06:42:21 PM ---Why not just do:


--- Code: ---%?if(%St(statusbar), =,top)<%VI(t)Vd(x)|%?if(%St(statusbar), =,bottom)<%VI(b)Vd(y)|%VI(o)>>
--- End code ---

--- End quote ---
Hmmm ... unless I'm missing something this doesn't solve my issue.
In your line you still have two separate viewports (x and y) for the same status bar (one on top one on bottom).
Hence I still need to duplicate the code (i.e. I need to define viewports x and y, they only differ in terms of viewport origin but I do have to write the code twice).


--- Quote from: [St.] on April 12, 2011, 06:42:21 PM ---It is important to note, and I feel I should mention, that the UI viewports (presently) are not really designed to be switched conditionally insofar as it can create some really ugly artefacts left on screen from the previous UI viewport position until the next fullscreen redraw.

--- End quote ---
OK, but then how does the default theme works ? Because it has a status bar that honors the top/bottom setting and the UI viewport is defined accordingly ...

MaX.

[Saint]:
It works because there is no screen left for there to display artefacts, the entire screen is covered by either the statusbar or the UI viewport.

If this was not the case, you'll get nasty artefacts left over from the previous screen before the UI viewport changed.

AFAIK the only way to make sure you don't see these issues is if the entire screen is redrawn during the UI viewport transition.


[St.]

HornetMaX:

--- Quote from: [St.] on April 13, 2011, 06:08:10 AM ---It works because there is no screen left for there to display artefacts, the entire screen is covered by either the statusbar or the UI viewport.

If this was not the case, you'll get nasty artefacts left over from the previous screen before the UI viewport changed.

AFAIK the only way to make sure you don't see these issues is if the entire screen is redrawn during the UI viewport transition.

--- End quote ---
Yeah, I noticed that, but it is often possible to position the stuff so that there's no impact.
The other issue (having to duplicate code) is more annoying.

BTW, is the default theme hardcoded into rockbox ?
I'm asking because I do see the rockbox_failsafe.cfg poiting to a .sbs, a .wps and a .fms file, but these files are essentially empty. There's a classic_statusbar.sbs (and an identical .rsbs ?!), but I;m not sure if it is really used to define the default statusbar, as I don't see it handling the top/bottom stuff (things that is done by the default theme).

MaX.

Navigation

[0] Message Index

Go to full version