Rockbox

Tasklist

FS#5899 - Custom List/Menu x/y coordinates and width

Attached to Project: Rockbox
Opened by P.I.Julius (pijulius) - Tuesday, 29 August 2006, 15:23 GMT
Last edited by Paul Louden (Llorean) - Wednesday, 16 January 2008, 06:40 GMT
Task Type Patches
Category Settings
Status Closed
Assigned To No-one
Operating System iPod 5G
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

This patch adds four options to the rockbox wps settings file so you can define a custom x/y coordinate for the list/menu and even a width and a number of lines.

The seetings in the theme.cfg file should look like following:
listxpos: 47
listypos: 47
listlines: 9
listwidth: 210

(these are the settings for the jClix theme for e.g.)

This should help people to create custom wps-es and place the menus anywhere on the screen.
Bests,
Julius
This task depends upon

Closed by  Paul Louden (Llorean)
Wednesday, 16 January 2008, 06:40 GMT
Reason for closing:  Out of Date
Additional comments about closing:  See task number 8457 for a viewports implementation of this being worked on, and feel free to contribute there.
Comment by P.I.Julius (pijulius) - Wednesday, 30 August 2006, 11:56 GMT
Fixes:
* set correct width with icons and/or scrollbar displayed
* restore correct font face/display width when statusbar shown so scrolling text don't get missed up
* reset settings on new theme load
Comment by Max Weninger (maxwen) - Wednesday, 06 September 2006, 09:10 GMT
I now also tried this patch :-)

But it will crash the X5 sim immediately on start :-(
But using lcd_set_custom_width and lcd_get_custom_width
instead of display->set_custom_width and display->get_custom_width solved it

And if you use the setting "Line Selector" with "Pointer" instead of "Bar"
the pointer is displayed at the end of the menu item instead of the beginning

Changing

cursor_pos = global_settings.listxpos/6;

in list.c solved it
Comment by P.I.Julius (pijulius) - Saturday, 30 September 2006, 11:22 GMT
Fixes & improvements:
* Fix quickscreen bugg so it is shown correctly
* Display quickscreen functions in the right place for e.g. if the menu's/list's x coordinate is 50px the quickscreen will start from there too and it will use the list's/menu's width/height to place the other functions too
Comment by Max Weninger (maxwen) - Friday, 06 October 2006, 22:31 GMT
Have you ever enabled "Show Path" in the File View? :-)
You may notice that both the icon and the path is displayed
on the wrong location.

The icon is always on pos 0,0 and the path is part of
the scrollbar which it should not be. Compared to a wps
without listxpos and listypos

I am currently trying to fix this but maybe you are faster :-)
Comment by Joe Termini (joetermini) - Thursday, 16 November 2006, 21:13 GMT
you need to resync
Comment by Max Weninger (maxwen) - Sunday, 28 January 2007, 17:37 GMT
first try to adapt to new config settings code
ATTENTION: this patch depends on the multifont patches (FB 4733)
applied before at the moment
Comment by Travis Tooke (tdtooke) - Wednesday, 30 May 2007, 23:01 GMT
@Max, on your version of this patch I noticed that it just went out of sync with some recent changes to apps/gui/list.c. 3 hunks failed that were putting the code based around the bool use_custom_list in the scroll up, scroll down, select previous methods. I found that by just searching out int nb_lines = gui_list->display->nb_lines; in list.c (only one occurence now) and placing that code there it works. I've compiled it and tested it on my iPod. I would up a synced version here but with all the patches I have on my build I don't trust myself to sync it properly and I'm unsure if what you have has any other dependencies than what is here.
Comment by Max Weninger (maxwen) - Thursday, 31 May 2007, 09:13 GMT
Thanks. I will look into it asap
Comment by Max Weninger (maxwen) - Friday, 22 June 2007, 14:54 GMT
quick and dirty sync
Comment by Travis Tooke (tdtooke) - Wednesday, 18 July 2007, 09:10 GMT
I have a question for you Max. I'm working on the scroll-acceleration patch for the iPod at http://www.rockbox.org/tracker/task/5594 and at present I'm using a helper patch that I have posted there to add a custom list check for those that use this patch. I'm thinking about completely getting rid of that helper by calling select_at_offset instead of select_above, or select_below since that method already has a custom list check. What I'm wanting to know is if you think I should leave it as is with the helper patch since that would involve less steps or change it? (I'd have to go to the handle_accleration method, then select_at_offset, and then selece_above or below instead of handle acceleration and then straight to select above or below. I'm thinking I want to keep it with the helper patch since that'd take less processor time but there has been some confusion about the helper patch and the need to apply it so I was thinking about that slight rewrite to avoid any confusion. Thoughts?
Comment by Travis Tooke (tdtooke) - Wednesday, 18 July 2007, 09:11 GMT
Oh, if you can look at that, just look at the most recent patches, my earlier ones are an embarrassment.;-)
Comment by Max Weninger (maxwen) - Wednesday, 18 July 2007, 09:19 GMT
My experiences with patch users shows that having as less patches as possible is the best solution :)
You could also create a new function that does only the custom list check to menu.c
or I can add such a function to the patch if that helps. Then any custom list check
can be done also from the "outside". Does that answer your question?
Comment by Travis Tooke (tdtooke) - Wednesday, 18 July 2007, 10:25 GMT
I wish I had read this first; I went ahead and rewrote it calling select at offset.:) As far as adding that function I'm all for it, I just don't know how to check for custom list without using global_settings.listlines. I'm nowhere near as knowledgeable on custom list.
Comment by Max Weninger (maxwen) - Wednesday, 18 July 2007, 10:29 GMT
that is the only way to check
the advantage would that it is then encapsulated inside menu.c
Comment by Max Weninger (maxwen) - Wednesday, 18 July 2007, 10:31 GMT
AFAIKS you need only the correct nb_lines right?
So we should also add another function that simply returns the correct value
Comment by Travis Tooke (tdtooke) - Wednesday, 18 July 2007, 10:41 GMT
Yeah, that's all I need, the reason I made that helper was because if somebody tried to compile a patch with the check included that did not use custom_list_position it would fail because global_settings wouldn't have listlines.
Comment by Max Weninger (maxwen) - Wednesday, 18 July 2007, 10:45 GMT
thats always a problem with patches that depend on each other
you are free to add any functions to this patch if you want
cause I dont know when I will have time to do it
Comment by Travis Tooke (tdtooke) - Wednesday, 18 July 2007, 10:47 GMT
Thanks for your time Max, I think I will add that to menu.c on this patch so I can get scroll-acceleration back a little leaner the way I liked it.
Comment by Travis Tooke (tdtooke) - Sunday, 23 September 2007, 19:08 GMT
sync
Comment by Travis Tooke (tdtooke) - Thursday, 04 October 2007, 05:55 GMT
fix line selector extending out too far in list. I only did this for lcd-16bit.c so if you need this done for other bit depths then just let me know, I just figured for the most part only people with a 16 bit depth lcd would use this anyway.
Comment by Travis Tooke (tdtooke) - Thursday, 04 October 2007, 10:18 GMT
Really fix it ;-)
Comment by Thomas Martitz (kugel.) - Monday, 08 October 2007, 08:20 GMT
I've synced the patch, but when a WPS uses a custom line with scrolling, the scrolling line shows the gradient bar selector.
Comment by Thomas Martitz (kugel.) - Monday, 08 October 2007, 08:20 GMT
Oops, wrong task, you might delete my above comment (and this one). Meant to post in custom line
Comment by Travis Tooke (tdtooke) - Friday, 12 October 2007, 08:30 GMT
just a few minor adjustments.
Comment by Travis Tooke (tdtooke) - Tuesday, 16 October 2007, 04:18 GMT
sync
Comment by Travis Tooke (tdtooke) - Saturday, 27 October 2007, 03:43 GMT
This fixes the quickscreen not putting things within what you defined as your customlist.
Comment by Travis Tooke (tdtooke) - Saturday, 27 October 2007, 03:44 GMT
Probably help if I actually attach the file ;-)
Comment by Thomas Martitz (kugel.) - Saturday, 27 October 2007, 22:44 GMT
Ok guys, I've fixed some issues:

1) The right margin of the text is now equal at any times. It's indepent of you using list title or not, icons or not, or which of the line selector types.
2) I've fixed that when you use the pointer line selector type there were some empty pixels between the icons and the text. This was caused by the though, that the line selector is right of the icons. But as it is actually left to the scrollbar, so I removed that empty spot.
3)I've made lists having an indent of the scrollbar width, even if there is no scrollbar. Now the icons aren't jumping around anymore depending of the scrollbar (this only applies when not using a list title).

Works fine with the Sansa e200 sim.
Comment by Travis Tooke (tdtooke) - Sunday, 28 October 2007, 14:48 GMT
Thanks
Comment by Thomas Martitz (kugel.) - Saturday, 03 November 2007, 23:15 GMT
I've fixed a glitch, when custom line was not used, but icons and cursor line selector (the text and the icons overlapped).

TODO: I've noticed another glitch. In lists, which don't use icons at all(such as the list where you select the line selector in the settings), show a glitch (cursor and text overlap) when you use cursor. I'm to busy to fix that now.
Comment by Konstanin (eK3eKyToPa) - Saturday, 10 November 2007, 11:46 GMT
need to be resynced
Please do it
Comment by Dave (dberg918) - Monday, 26 November 2007, 15:17 GMT
I gave it a shot, but I wasn't able to resync this patch. It looks like there's been some changes to a few of these files that are outside of my basic coding knowledge.

Also, from what I saw in /apps/gui/list.c (compared to what I saw in the patch file), there are some changes that I couldn't track in the list of revisions. Maybe this is from old dependencies this patch had? Hopefully someone with greater skills than mine will come along soon and sync this guy. Now that album art has been committed, this might be the only patch I use in my build!
Comment by Thomas Martitz (kugel.) - Monday, 26 November 2007, 15:23 GMT
You need to apply the rightmargins patch (last attached file in the scrollmargins patch "thread").
Comment by Travis Tooke (tdtooke) - Monday, 26 November 2007, 20:37 GMT
Believe it or not I really am going to dig the scroll-margins dependencies out of these patches, just been tied up with the holidays and would you believe it..jury duty!
Comment by Dave (dberg918) - Wednesday, 12 December 2007, 04:48 GMT
Thanks for committing to working on this Travis!
Is there anything I can do to help get this synched any faster? Haven't updated my build since album art was committed to svn...
Comment by Dave (dberg918) - Saturday, 05 January 2008, 05:10 GMT
Any progress on this patch, Travis? I'm a few days away from modifying my theme so I won't need this anymore. Sorry if I'm being pushy, especially if you're still busy.
Comment by Travis Tooke (tdtooke) - Saturday, 05 January 2008, 07:52 GMT
I hate to say it, but you probably should go ahead and modify your theme. I do have a working copy of this at http://home.centurytel.net/tdtooke/patches.zip with all the dependencies you'll need included, but since viewports is becoming a reality now it's only a matter of time before this patch is closed altogether.
Comment by Dave (dberg918) - Saturday, 05 January 2008, 14:06 GMT
Does that mean viewports would be capable of performing the function of this patch, or that this patch is simply becoming obsolete?
Comment by Thomas Martitz (kugel.) - Saturday, 05 January 2008, 15:47 GMT
I don't get what viewports has to do with this patch. This patch doesn't even touch the WPS, or something done by viewports. Viewports can't rearrange the menus AFAIK, so I don't think that this one will be closed.
Comment by Dave Chapman (linuxstb) - Sunday, 06 January 2008, 00:26 GMT
The viewports patch currently in the tracker (#8385) adds viewport capabilities to the low-level LCD drivers in Rockbox, plus adds the ability to use viewports in the WPS.

So the viewports patch itself doesn't make this patch obsolete, but it means that this feature should be reimplemented to take advantage of the viewport feature in the LCD drivers.

The intention (discussed amongst the devs on IRC a few weeks ago) is that the list widget should be implemented using a number of viewports to contain the various elements - title, icons, scrollbar, main content and cursor (if the user is using the arrow cursor). This should simplify the code, and also allow things like moving the icons to the right-side for RTL text. It should also be possible to give the list widget a custom size/position (similar to what this patch does).

Comment by Thomas Martitz (kugel.) - Thursday, 10 January 2008, 00:00 GMT
Here's a version sync'd with viewports. Not dependant of any other patch, except multifont a little. Expect this to be closed soon, as viewport will bring it's own implementation of this features. However, my patch uses viewports quite a bit.
Comment by Thomas Martitz (kugel.) - Thursday, 10 January 2008, 00:36 GMT
Oh, two notes I forget to add.

a)For compability reasons, I didn't take out the listlines stuff yet. It could be definitely better using vp->hight/font_height or something.
b)It's not extended to remote screens yet.
Comment by Travis Tooke (tdtooke) - Thursday, 10 January 2008, 01:46 GMT
I was thinking about having the .cfg define the viewport. You could have backwards compatability since listlines is height/fontheight, you'd just have to have it convert the lines back into actual height. That way you don't have to have all that code dealing with nb_lines and whatnot. It might be a good idea to define the viewport with the actual content in it with that, and add to the settings to define the viewports for icons and the scrollbar to minus out some of the code dealing with that. Not sure how all of that would work in actual practice though.
Comment by Travis Tooke (tdtooke) - Thursday, 10 January 2008, 01:47 GMT
Now that I'm thinking about it, backwards compatibility with listlines would probably be problematic, it might be best to just go with a height setting.
Comment by Thomas Martitz (kugel.) - Thursday, 10 January 2008, 01:55 GMT
Sure. My primary object with the latest patch was to sync it to viewports, so that we can use custom list features until viewports is ported to list (refering to the current discussion in  FS#8385  ). This will just get closed soon anyway.
Comment by Travis Tooke (tdtooke) - Thursday, 10 January 2008, 02:16 GMT
My mistake. One would think I of all people would understand keeping this alive while we wait..:-)
Comment by Thomas Martitz (kugel.) - Thursday, 10 January 2008, 04:29 GMT
Well, I laughed too early. Testing on sim isn't enough sometimes. Real targets will crash when a line scrolls. Besides there're issues with the line selector types. So, I wouldn't recommend this patch yet. I will have a look tomorrow.
Comment by Thomas Martitz (kugel.) - Thursday, 10 January 2008, 18:37 GMT
This version actually works. There's just is a problem problem when a line scrolls. It simply ignores the list width.

Test on real target. I'm not sure, however I noticed bad performace of my e200. Might be other patches I've applied though.

Loading...