Rockbox.org home
Downloads
Release release
Dev builds dev builds
Extras extras
themes themes
Documentation
Manual manual
Wiki wiki
Device Status device status
Support
Forums forums
Mailing lists mailing lists
IRC IRC
Development
Bugs bugs
Patches patches
Dev Guide dev guide
Search



Donate

Rockbox Technical Forums


Login with username, password and session length
Home Help Search Staff List Login Register
News:

Thank You for your continued support and contributions!

+  Rockbox Technical Forums
|-+  Support and General Use
| |-+  Theming and Appearance Customization
| | |-+  Statusbar top/bottom [may be noob question]
« previous next »
  • Print
Pages: [1]

Author Topic: Statusbar top/bottom [may be noob question]  (Read 1182 times)

Offline HornetMaX

  • Member
  • *
  • Posts: 27
Statusbar top/bottom [may be noob question]
« on: April 11, 2011, 05:06:29 PM »
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: [Select]
# 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
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: [Select]
%Vd(z)
%Vl(z,0,%?if(%St(statusbar), =,top)<8|-8>,-,8,0)
STATUS BAR

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

MaX.
Logged

Offline [Saint]

  • Rockbox Expert
  • Member
  • *
  • Posts: 1662
  • Hayden Pearce
    • Google+
Re: Statusbar top/bottom [may be noob question]
« Reply #1 on: April 12, 2011, 06:42:21 PM »
Why not just do:

Code: [Select]
%?if(%St(statusbar), =,top)<%VI(t)Vd(x)|%?if(%St(statusbar), =,bottom)<%VI(b)Vd(y)|%VI(o)>>

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.]

Logged
Using PMs to annoy devs about bugs/patches is not a good way to have the issue looked at.

Offline HornetMaX

  • Member
  • *
  • Posts: 27
Re: Statusbar top/bottom [may be noob question]
« Reply #2 on: April 12, 2011, 07:26:33 PM »
Quote from: [St.] on April 12, 2011, 06:42:21 PM
Why not just do:

Code: [Select]
%?if(%St(statusbar), =,top)<%VI(t)Vd(x)|%?if(%St(statusbar), =,bottom)<%VI(b)Vd(y)|%VI(o)>>
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.
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.
Logged

Offline [Saint]

  • Rockbox Expert
  • Member
  • *
  • Posts: 1662
  • Hayden Pearce
    • Google+
Re: Statusbar top/bottom [may be noob question]
« Reply #3 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.


[St.]
Logged
Using PMs to annoy devs about bugs/patches is not a good way to have the issue looked at.

Offline HornetMaX

  • Member
  • *
  • Posts: 27
Re: Statusbar top/bottom [may be noob question]
« Reply #4 on: April 13, 2011, 07:25:37 AM »
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.
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.
Logged

  • Print
Pages: [1]
« previous next »
+  Rockbox Technical Forums
|-+  Support and General Use
| |-+  Theming and Appearance Customization
| | |-+  Statusbar top/bottom [may be noob question]
 

  • SMF 2.0.17 | SMF © 2019, Simple Machines
  • Rockbox Privacy Policy
  • XHTML
  • RSS
  • WAP2

Page created in 0.066 seconds with 15 queries.