Support and General Use > Theming and Appearance Customization
Progress Bar with no bmp
(1/1)
PaulF:
I have been scaling a theme for different size SDL screens To save scaling a bmp, I have been trying to follow the example WPS guide where they use a dash instead of bmp name..
The bar is on a black background and it has white frame that is filled in with white as the playing time increases. It works fine, but I don't know where the frame is coming from. I like the frame except the frame has three sides and the bottom line is missing. I tried a lot of different widths for the view and the bar. I have feeling I am doing something stupid.
__________
| |
--- Code: ---# Conditional viewports - volume change
%?mv(2)<%Vd(vpVolume)|%Vd(vpNowPlaying)%Vd(vpTime)>
#
# Volume bar
%Vl(vpVolume,98,225,283,10,-)
%pv(-,-,-,6,-)
#
# Progress bar
%Vl(vpNowPlaying,98,225,283,10,-)
%pb(-,-,-,6,-)
#
# Time playing
%Vl(vpTime,0,256,87,15,2)
%ac%pc
#
# Time remaining
%Vl(vpTime,392,256,87,15,2)
%ac%pr
#
# Volume
%Vl(vpVolume,98,228,283,27,1)
%ac%pv dB
--- End code ---
Frankenpod:
Why is the pb viewport 10 units thick when the pb is only 6 thick?
Do you want the pb in the middle of the view port?
Depending on where you want the pb relative to the viewport, it should work if you change pb(-,-...) to pb(0,0,...). Or pb(0,2,...) depending on where you want the progress bar. Or just change the pb viewport to be the same thickness as the pb (and also change the -,- to 0,0).
PaulF:
Frankenpod, we think alike. I am pretty sure I tried your method. I resized the bar and moved it up and down in the view port several different ways. I'll give more info this time.
from autoconfig.h
/* lcd dimensions for application builds from configure */
#define LCD_WIDTH 480
#define LCD_HEIGHT 272
Full wps:
--- Code: ---# THIN Mod Theme
# by Michael Huth
#
# Based on code and artwork originally created by Drew Vosburg:
# http://themes.rockbox.org/index.php?themeid=1180
#
%wd
#
# 2nd font
%Fl(2,10-Artwiz-Snap.fnt)
#
# Conditional viewports - Album art
%?C<%Vd(vpArt)|%Vd(vpNoArt)>
#
# Playback actions
%V(21,15,26,17,-)
%xl(A,actions.bmp,0,0,5)
%?mp<|%xd(Ac)|%xd(Ab)|%xd(Ad)|%xd(Ae)>
#
# Shuffle
%V(21,61,26,17,-)
%xl(S,shuffle.bmp,0,0)
%?ps<%xd(S)>
#
# Repeat
%V(0,108,69,17,2)
%ac%?mm<|All|One|Rnd|A-B>
#
# Time
%V(401,15,-,15,2)
%?cf<%cH|%cI>:%cM
#
# Battery bar
%V(414,61,43,10,-)
%xl(B,battery.bmp,0,0,17)
%?bl<%xd(Bq)|%xd(Bp)|%xd(Bo)|%xd(Bn)|%xd(Bm)|%xd(Bl)|%xd(Bk)|%xd(Bj)|%xd(Bi)|%xd(Bh)|%xd(Bg)|%xd(Bf)|%xd(Be)|%xd(Bd)|%xd(Bc)|%xd(Bb)|%xd(Ba)>
#
# Battery %
%V(414,77,-,15,2)
%bl%%
#
# Playlist position
%V(397,108,82,46,2)
%ac%pp
%ac%Sx(of)
%ac%pe
#
# Conditional viewports - volume change
%?mv(2)<%Vd(vpVolume)|%Vd(vpNowPlaying)%Vd(vpTime)>
#
# Volume bar
%Vl(vpVolume,98,256,283,10,-)
%xl(V,barbg.bmp)
%pv(0,0,-,-)
#
# Progress bar
%Vl(vpNowPlaying,98,256,283,10,-)
%pb(0,0,-,-)
#
# Time playing
%Vl(vpTime,0,256,87,15,2)
%ac%pc
#
# Time remaining
%Vl(vpTime,392,256,87,15,2)
%ac%pr
#
# Volume
%Vl(vpVolume,98,228,283,27,1)
%ac%pv dB
#
# Art - Now Playing
%Vl(vpNowPlaying,17,228,445,27,1)
%?C<%s%ac%?ia<%ia: >%?it<%it|%fn>>
#
# No Art - Now Playing
%Vl(vpNoArt,87,77,305,139,1)
%s%ac%?it<%it|%fn>
%s%ac%ia
%s%ac%id
%s%ac%iy
#
# Speaker icon
%Vl(vpVolume,414,241,43,30,-)
%x(I,speaker.bmp,0,0)
#
# Album art
%Vl(vpArt,137,7,216,216,-)
%Cl(0,0,216,216,c,c)
%Cd
--- End code ---
Frankenpod:
Well it works for me when I use
# Progress bar
%Vl(vpNowPlaying,98,256,283,10,-)
%pb(0,0,-,10)
#
Not sure what the '- ' in place of the '10' is intended to do, but it doesn't give the result you want (perhaps a rockbox theme engine glitch?), so just put the '10' in there.
...or
# Progress bar
%Vl(vpNowPlaying,98,256,283,6,-)
%pb(0,0,-,6)
#
...or
# Progress bar
%Vl(vpNowPlaying,98,256,283,6,-)
%pb(0,2,-,6)
#
...depending on which you want.
PaulF:
Frankenpod, your first example worked! :-) Thank you.
Navigation
[0] Message Index
Go to full version