dev builds
themes manual
device status forums
mailing lists
IRC bugs
dev guide

Rockbox mail archive

Subject: the UI viewport logic.. someone please help my understanding?

the UI viewport logic.. someone please help my understanding?

From: Jonathan Gordon <>
Date: Tue, 27 Oct 2009 20:11:45 -0700

Firstly, Kugel, dont take this as a personal insult...

I'm trying my best to see the logic in the current implementation of
the UI viewport and how it mixes with themes and custom statusbar
(sbs) and the wps and well, imo it's broken...

This is how it currently works:
* The UI (lists/menus/etc) can be told where to draw in... there are
two ways that gets done now, with the "ui viewport" setting (which is
a "secret" setting in that it can only be set in the .cfg file), and
using the %Vi tag in the sbs
* If the setting is there, then %Vi is ignored by the lists which will
draw into the viewport set by the setting... if the setting doesn't
exist then the viewport set by %Vi is used
* In the WPS, the setting is *always* ignored, if no sbs is loaded
(and the built in statusbar is disabled) then the default viewport
(where stuff gets drawn in before the first %V line) is the full
screen (0,0,LCD_WIDTH, LCD_HEIGHT)... If a sbs *is* loaded then the
default viewport will be the viewport from the sbs's %Vi tag (!)
* In the WPS again, the %we (enable statusbar) tag right now is hard
coded to only work with the "classic" inbuilt statusbar, so full width
and 8 pixels at the top or bottom of the screen

My problem is that there doesn't seem to be any consistency there.

My proposal is the following:
* The "ui viewport" setting is *only* used when no sbs is loaded (or
the sbs doesnt specify a %Vi), otherwise %Vi is always used, including
in the wps (where you could have the sbs and the wps being displayed
* %we in the would force the sbs enabled, and if one isnt loaded, then
it would use the "ui viewport" setting.

My reasoning is this:
1) The sbs knows where it draws into and where the UI should sit so it
doesnt overlap
2) The wps knows where it wants to draw in, and can easily work with a
sbs, or disabled it and have the whole screen
3) The UI/lists are designed to draw in any viewport and know nothing
about any other viewport...

Apparently the argument against this (other than "dont change the
current behaviour") is sbs' and wps' shouldn't be linked to themes..
Fine, I can accept that, but imo having the setting overwrite the sbs'
%Vi ties it to a .cfg even more than the other way.
If someone were to take a sbs from a theme without taking the setting
line one of two things will happen, either the sbs will take the
entire screen because the artist never put a %Vi in because its
redundant, or there will be redraw issues because the theme its copied
into has a "ui viewport" setting already which completly overlaps the
sbs. (Or the 3rd option is that it does work by fluke or miracle!)

If the sbs takes priority and someone copies the sbs it *will* work
(*at least with the lists)... if however the user wanted a smaller ui
area they could easily modify one number in the sbs.

If you really want to read the IRC logs about this it starts at and continues ...

Received on 2009-10-28

Page template was last modified "Tue Sep 7 00:00:02 2021" The Rockbox Crew -- Privacy Policy