Rockbox

Tasklist

FS#7013 - loadable icons

Attached to Project: Rockbox
Opened by Jonathan Gordon (jdgordon) - Wednesday, 11 April 2007, 12:51 GMT
Last edited by Jonathan Gordon (jdgordon) - Wednesday, 11 April 2007, 13:07 GMT
Task Type Patches
Category User Interface
Status Closed
Assigned To No-one
Operating System All players
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

This patch allows the user to load a bmp with a new iconset to use in the lists.
Its not 100% finished but I wanted to get it out so people can start drawing so we can have some nice ones for the commit.
attached is the patch as well as the default icons which are needed.
put remote_default_icons into apps/bitmaps/remote_native and the other two in apps/bitmaps/native.

The format for the iconset is exactly the same as the attached bmps.
A single horizontal strip with all icons in the order they appear in apps/gui/icon.h with no space between icons (and all are the same width).

charcell has not been handled yet, not has the viewers.config icons.

edit: forgot to mention that you need to add the line "iconset: /.rockbox/icons/<your iconset>.bmp" to config.cfg to get it to load an iconset
This task depends upon

Closed by  Jonathan Gordon (jdgordon)
Monday, 16 April 2007, 09:09 GMT
Reason for closing:  Accepted
Additional comments about closing:  Anyone feel like making a nice wiki page for these sets?
Comment by Pascal Briehl (ColdSphinX) - Wednesday, 11 April 2007, 15:10 GMT
It seems as you forgot an remote_default_icons.6x8x2.bmp :)
Comment by Jonathan Gordon (jdgordon) - Thursday, 12 April 2007, 08:58 GMT
And this version has working viewers.config and a proper ui to make it all work.
I thing to note, because the number of icons in the bmp isnt know, there is a setting under "[remote] lcd settings" "icon height" which needs to be set to the correct value or the icons wont be shown correctly (themers should handle this so it wont be a problem for regular users).

now, to set an icon in the viewers.config file, you index it from the end of the icon.h enum (icon 0 is the folder icon, 1 is chip8, etc). to use one of the builtin icons do "b6" (without the quotes) to get the font icon. use "-" for no icon.

The bmp format has changed to vertical, so grab new ones...

charcell isnt done yet, all other targets should work correctly.
Comment by Jonathan Gordon (jdgordon) - Thursday, 12 April 2007, 11:40 GMT
this fixes icons on the charcell, you cant load a new icon set yet, use the bmps from the above comment
Comment by Jonathan Gordon (jdgordon) - Thursday, 12 April 2007, 12:33 GMT
lastly, this little addition allows you to change the icon for any extension that rockbox supports!
to do that have a file named /.rockbox/icons/<your theme>.icons where <your theme> is the same name as the .bmp file for the theme (e.g gant.bmp and gant.icons).
The .icons file is in the format
<extension>: <icon> (<icon> being the same format as used by viewers.config)

e.g "mp3: b5" or "wav: -" or "mpg: 2"

This is now at a state where I believe its commitable. The only thing missing is customizable icons for charcell...
Comment by Eric Linenberg (elinenbe) - Thursday, 12 April 2007, 14:07 GMT
What about adding different size icons? Truly theme-able menus would be nice.
Comment by Jonathan Gordon (jdgordon) - Thursday, 12 April 2007, 14:16 GMT
bah,
I explained it better in the forum thread.
you can load any size icons up to 24x24 in full 16bit colour!
Comment by Eli Sherer (elisherer) - Thursday, 12 April 2007, 17:46 GMT
in that case
Comment by Eli Sherer (elisherer) - Thursday, 12 April 2007, 17:47 GMT
this patch is very important to advance to the next graphical interface!!!
next step maybe enlarging the statusbar for 24bit bmps there...
Comment by denis (perldiver) - Thursday, 12 April 2007, 19:46 GMT
Eli, aww, that looks nice!
Comment by Bobby Graese (TrueJournals) - Friday, 13 April 2007, 02:36 GMT
Just one problem: I get the error "Data abort at 00028BD4" when trying to apply an icon set. This is using a H10, and latest SVN.
Comment by Jonathan Gordon (jdgordon) - Friday, 13 April 2007, 03:09 GMT
Eli, Those icons look amazing!
The only problem is that the bmp's use the wps icon (which isnt your fault, and easy to get around).
There was a bug in the code which stopped almost all icons being displayed (and the list code needs a bit of tweaking to display right), so hopefully ill update the patch a bit later..
but untill then
http://jdgordon.mine.nu:8080/jonno/rockbox/ has screenshots of the h300 using Eli's icons.
In that folder also has two files (elisherer.bmp and .icons) put them both in /.rockbox/icons/ and run the theme.cfg file and it will load his themes with the correct icon for the bmps.
Comment by Jonathan Gordon (jdgordon) - Friday, 13 April 2007, 05:09 GMT
new version. Everything should be working correctly. i.e ready to commit.....
Comment by Pascal Briehl (ColdSphinX) - Friday, 13 April 2007, 08:07 GMT
I hope you enjoy them
Comment by Linus Nielsen Feltzing (linusnielsen) - Friday, 13 April 2007, 08:26 GMT
I think this patch looks really good. What is the binary size impact on the Archos targets?
Comment by Steve Bavin (pondlife) - Friday, 13 April 2007, 08:26 GMT
Hi jdgordon,

I get a failure to build if I just apply this patch:
make[2]: *** No rule to make target `default_icons.6x8x16.bmp', needed by `/home/Steve/rockbox/build/apps/bitmaps/native/default_icons.6x8x16.c'. Stop.
...
gui/icon.c:35:27: default_icons.h: No such file or directory
gui/icon.c:37:34: remote_default_icons.h: No such file or directory
gui/icon.c:55: error: `default_icons' undeclared here (not in a function)
gui/icon.c:55: error: initializer element is not constant
gui/icon.c:55: error: (near initialization for `inbuilt_icons[0]')
...
Comment by Pascal Briehl (ColdSphinX) - Friday, 13 April 2007, 08:54 GMT
you forgot the bitmaps. look at the 2nd comment
Comment by Steve Bavin (pondlife) - Friday, 13 April 2007, 09:02 GMT
Ah, where do I put the bitmaps? The patch needs to contain at least a default set.

Also I'm fairly sure that default_icons.h and remote_default_icons.h should have been included.
Comment by Pascal Briehl (ColdSphinX) - Friday, 13 April 2007, 09:06 GMT
put "default_icons.6x8x1.bmp" and "default_icons.6x8x16.bmp" into "apps/bitmaps/native" and "remote_default_icons.6x8x1.bmp" and "remote_default_icons.6x8x2.bmp" into "apps/bitmaps/remote_native".
Comment by Pascal Briehl (ColdSphinX) - Friday, 13 April 2007, 09:07 GMT
that .h files will be generated by bmp2rb from the bitmaps while you compile.
Comment by Will Robertson (aliask) - Friday, 13 April 2007, 16:44 GMT
Here's a set I knocked up from the tango icon library.
I didn't make an icon for wavview but will icons for files with inbuilt icons be needed anyway (ie mp3 is inbuilt to display the audio icon, but is also assigned the vbrfix icon as well, but only the inbuilt icon is shown).
I made it 20x16 because I like a little gap between the icon and the menu item text.
Comment by Bobby Graese (TrueJournals) - Saturday, 14 April 2007, 02:31 GMT
I keep getting a Data abort error when trying to apply an icon set. This time, with a build with this being the only patch applied, the error is "Data abort at 00028CF4". Using SVN revision 13152 on an iriver H10. Is anyone else experiencing a data abort or am I the only one?
Comment by Jonathan Gordon (jdgordon) - Saturday, 14 April 2007, 09:02 GMT
Linus, bin size depends on the iconset being loaded into the core (obviously), with the current icons ondioSP is up 1100 and h300 is 1300 up. BUT, there was talk last night before i had to ggo that the context menu items to load the bmps should be removed (so 200bytes less maybe), and the viewer icons should be removed, so another few hundred down.. we'll see..

TruJournals: data aborts are useless in custom builds without your rockbox.map file in the <build dir>/apps/ folder, please attach that so we can actually figure out the problem.

Those icons look great :)

hopefully ill attach a new version tonight which will hopefully be the final one :p
Comment by Dominik Riebeling (bluebrother) - Saturday, 14 April 2007, 09:53 GMT
TrueJournals: did you ensure a current svn runs on your player? I.e. your standard build isn't affected by the old bootloader / new build issue? Just asking for the case ...
Comment by Jonathan Gordon (jdgordon) - Saturday, 14 April 2007, 11:56 GMT
new version.
This one goes back to seperate buffers for the viewers and inbuilt icons, so, you need to remove the viewer icons before loading the above iconsets or they wont display correctly. (attached is new bmps for the inbuilt icons)
player needs to be checked, i think its possible this version breaks it, but not sure
Comment by Jonathan Gordon (jdgordon) - Saturday, 14 April 2007, 13:26 GMT
copy+paste mistake was breaking the icons for charcell.. all fixed. hopefully we can commit this one

deltas:
player - down by less than 100bytes
ondioSP - +1kb
h300 - +4700b ! (16bit colour bmps being built in...)
Comment by Will Robertson (aliask) - Saturday, 14 April 2007, 14:08 GMT
New icons to match the reduced set.
Comment by Pascal Briehl (ColdSphinX) - Saturday, 14 April 2007, 16:12 GMT
I think there shold be new bitmaps with the default viewericons, because I don't think mpgs, bmps, jpgs, ... should have only icons if you load an custom viewers iconset.
Comment by Pascal Briehl (ColdSphinX) - Saturday, 14 April 2007, 16:18 GMT
And there are some of my custom icons.
Comment by Will Robertson (aliask) - Sunday, 15 April 2007, 01:36 GMT
And here are the viewers icons I forgot last time.
Comment by Will Robertson (aliask) - Sunday, 15 April 2007, 01:57 GMT
Here's a better version, removed duplicates.
To use this iconset for the viewers you must be using the attached viewers.config file

jdgordon edit: This bmp is compatable with the .patch in the next comment. (in the future please dont supply a viewers.config, but a <your filename>.icons
Comment by Jonathan Gordon (jdgordon) - Sunday, 15 April 2007, 01:59 GMT
very minor change in the code so the chip8 icon is the first in the viewers bmp and not the folder icon.

it seems i didnt explain the viewers.config (and .icons and viewers.bmp) files very well..
The viewers bmp can have up to the same amount of icons as the main iconset file (and they must be the same dimensions).
the 3rd field in viewers.config is either "b<num>", "<num>, or "-", where <num> is the index of the icon you want to use (starts at 0). the "b" means to use the builtin icons (well, the iconset for the main icons.. got a better idea for this letter?), and the - means no icon.

now, if your viewers bmp is called my_viewers.bmp (in /.rockbox/icons) then the file my_viewers.icons is read which has the format "<extension>: <icon>" where <extension> is the file extensions icon you want to change, and <icon> is the same format as viewers.config ("b<num>", "<num>, or "-")

and lastly, if you are going to upload bmps, please attach the .cfg for it as well, (and the .icons if you want also).

edit: Aliask beat me to the comment, please dont edit viewers.config... always supply a .icons file
Comment by Eli Sherer (elisherer) - Sunday, 15 April 2007, 04:38 GMT
here is my compatable version! enjoy.
Comment by Jonathan Gordon (jdgordon) - Sunday, 15 April 2007, 04:56 GMT
eli: nice, but as i said above.. the folder icon shouldnt be in the viewers bmp..

Loading...