Commit graph

94 commits

Author SHA1 Message Date
Frank Gevaerts
680c6fcde1 Store listitem_viewport_cfg->label as skinoffset instead of raw pointer
This fixes the case where some blocks got relocated and the skin render
code couldn't find the matching viewports any more.

Change-Id: I4394444fb139ee5bc986f374dba82a104013e354
Reviewed-on: http://gerrit.rockbox.org/112
Reviewed-by: Frank Gevaerts <frank@gevaerts.be>
2012-02-22 01:15:42 +01:00
Frank Gevaerts
1a4da5961e Make skinned lists handle the "0 items" case without crashing
Change-Id: Iaf69c93727e0f0e2a48b44c330883f7a620c4d99
2012-02-21 01:29:12 +01:00
Frank Gevaerts
9c3ce33d4e Fix another skinned list buflib issue
Change-Id: Ib0eebf56b1bf4f4119ebfd21679f6cd9c8986ea4
2012-02-19 21:06:03 +01:00
Frank Gevaerts
46285e7c2f Fix a nullpointer dereference in skinned lists.
Unfortunately this doesn't seem to be the only problem with skinned
lists. Fixing this still doesn't make them work right.

Change-Id: Ibf80eb2a4fa4eb392e2f3ea9744aec68c6181961
2012-02-19 20:52:06 +01:00
Bertrik Sikken
f81100efd2 make local variable current_list static
Change-Id: Ibe3536a4865c12160e933d3696af4b5507713ffe
2012-02-19 12:12:40 +01:00
Jonathan Gordon
9e07ef2b0a Use buflib for all skin engine allocations.
Massive thanks to Michael Chicoine and other testers for finding the early bugs.

This removes all skin memory limitations

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30991 a1c6a512-1295-4272-9138-f99709370657
2011-11-15 14:11:08 +00:00
Thomas Martitz
3b12634e6b Commit FS#12321 - Touchscreen: List line padding, to more easily select lines
This adds line padding to lists on touchscreens,
in order to make lists reasonably useful without huge fonts.

It's configurable:
* Automatic (default, line height calculated using a lcd dpi aware function)
* Off (status quo, line height = font height)
* X pixels (from 2 to 50 in even steps)

The automatic setting should/aims to Just Work Out Of The Box on all targets

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30773 a1c6a512-1295-4272-9138-f99709370657
2011-10-17 17:38:10 +00:00
Björn Stenberg
0942e2a0f7 Changed the FOR_NB_SCREENS macro to always be a for loop that declares its own loop variable. This removes the need to declare this variable in the outer scope.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30756 a1c6a512-1295-4272-9138-f99709370657
2011-10-15 19:35:02 +00:00
Thomas Martitz
2a04202ffa Fix touchscreen behavior in time&date screen.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30725 a1c6a512-1295-4272-9138-f99709370657
2011-10-07 22:30:09 +00:00
Frank Gevaerts
28d5f2aa57 Add "%LN" tag to retrieve the list item number of the current item. This allows e.g. putting item numbers in skinned lists.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30568 a1c6a512-1295-4272-9138-f99709370657
2011-09-18 12:35:32 +00:00
Jonathan Gordon
3d0317a273 Rework how the skin gets the list item text to save some ram. Also allow the %LI and %LT tags to take 2 optional parameters to get a different items text/icon:
%LT(offset, nowrap) - get the text for the "being drawn"+offset item (offset being + or -). if the second param is "nowrap" (Without quotes) the text will be blank if the item would need to wrap. Same for the icon
e.g:
%LT(-1)
%LT <<
%LT(1, nowrap)

will display:
Four
Five <<
Six (or nothing if Five is the last item)

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30502 a1c6a512-1295-4272-9138-f99709370657
2011-09-11 10:44:17 +00:00
Jonathan Gordon
63a379c64c Add the new file and fix the compile error
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30462 a1c6a512-1295-4272-9138-f99709370657
2011-09-06 13:53:46 +00:00
Thomas Martitz
b22b0dc101 Touchscreen: Fix minor redraw after entering the context menu.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29193 a1c6a512-1295-4272-9138-f99709370657
2011-02-02 18:39:04 +00:00
Thomas Martitz
430ada0864 Redo r29168. Use similar but existing mechanism in the action system which seems to work better.
Don't eat buttons on context change if it was waiting for button release (you did need another release).

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29192 a1c6a512-1295-4272-9138-f99709370657
2011-02-02 18:30:10 +00:00
Thomas Martitz
7436e7ab41 Touchscreen/lists: Hopefully fix glitchy behavior that happened after opening the context menu.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29168 a1c6a512-1295-4272-9138-f99709370657
2011-01-29 16:33:25 +00:00
Thomas Martitz
33af0dec28 Touchscreen: Improved scroll threshold
Remove the hardcoded (and way too small) scroll threshold (the distance moved in pixels before we think the users wants to scroll) and replace it with something based on the actual DPI of the screen.
On Android we call the API for that, on other touchscreens we reimplemented Android's formula (as of 2.2) and calculate it.

Flyspray: 11727

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28548 a1c6a512-1295-4272-9138-f99709370657
2010-11-10 15:25:15 +00:00
Thomas Martitz
12f5a1e60e Make the context menu pop up instantly after the long press timeout when holding a list item instead of just after the thumb/styles left the screen.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28499 a1c6a512-1295-4272-9138-f99709370657
2010-11-05 19:23:34 +00:00
Thomas Martitz
b673ae2c46 FS#11686 - Kinetic list scrolling for touchscreen
This adds kinetic scrolling to to lists on touchscreen targets and RaaA, like all other OSes on touchscreens have.
It's only enabled in the absolute point mode, so for non-touchscreen and in grid mode nothing changes.

Kinetic scrolling means that the list keeps scrolling (but is decelerating) after you leave the touchscreen with the finger.
Redraw interval and deceleration is hardcoded for now but could be made configurable if desired.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28408 a1c6a512-1295-4272-9138-f99709370657
2010-10-31 11:11:46 +00:00
Teruaki Kawashima
a900a29091 fix that disktidy plugin and shopper plugin is not usable when Show Icons setting is turned off.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28362 a1c6a512-1295-4272-9138-f99709370657
2010-10-26 12:19:39 +00:00
Thomas Martitz
b39a4933cb Fix several inaccuracies in list handling on touchscreen.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28221 a1c6a512-1295-4272-9138-f99709370657
2010-10-09 11:22:52 +00:00
Thomas Martitz
d9d0b4dd20 Pixel-accurate (vertical) list scrolling for touchscreen targets.
Looks much smoother now as you don't scroll by whole lines anymore.
Add some functions lcd driver to enable the line based scrolling engine to draw the lines with a pixel-based y-offset.
This should also allow for a sensible kinetic scrolling mechanism (still a todo).

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28214 a1c6a512-1295-4272-9138-f99709370657
2010-10-06 12:46:42 +00:00
Jonathan Gordon
0dd8ba4725 Fix FS#11552 - touches outside of the UI viewport can do unexpected list movements.
Also remove naughty // comments from r28145

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28168 a1c6a512-1295-4272-9138-f99709370657
2010-09-26 07:32:16 +00:00
Thomas Martitz
f060cd5428 Don't actually reimplement an existing feature for hiding the selection marker
during scrolling.

However, the existing one is part of the list api, so it shouldn't be overridden
blindly internally, so do the decision in a different but equivalent way.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28147 a1c6a512-1295-4272-9138-f99709370657
2010-09-23 00:37:33 +00:00
Thomas Martitz
ac08e6942a Touchscreen: Improve scrolling in absolute point mode.
* Scrolling is now done by wiping over the screen. There's no acceleration or
  kinetic scrolling yet though. But it works rather well (previously
  you held the edges of the list to scroll).
* Improve scrollbar scrolling so that it keeps scrolling even if you leave the
  scrollbar area.
* Hide selection during scrolling
* Prevent accidental hitting of the list title (which means go back) during
  scrolling
* Don't go into context menu after scrolling when leaving the screen on an item

In general, it's very much like scrolling in native lists in Android,
except there's no kinetic scrolling and everything is still line based, but with
the feature that the scrollbar enables jumping around in the list and very fast
scrolling.

Thanks to Dustin Skoracki for his ideas and half of the code for this.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28145 a1c6a512-1295-4272-9138-f99709370657
2010-09-23 00:02:32 +00:00
Maurus Cuelenaere
5da84ec4da I somehow messed up the previous commit, undo the unrelated changes.
Also, r26922 wasn't the culprit but r27004.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27108 a1c6a512-1295-4272-9138-f99709370657
2010-06-24 14:32:25 +00:00
Maurus Cuelenaere
3f4838585f Fix touchscreen scrollbar behaviour when it's on the right.
This was broken since r26922.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27107 a1c6a512-1295-4272-9138-f99709370657
2010-06-24 14:22:36 +00:00
Jonathan Gordon
49dac9ae04 Make the title area go up one level in the lists again. This Doesnt work if you have the title in a seperate viewport in the sbs, but that isnt really a problem because if you are doing that there is a good chance you will setup a region for that press anyway
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27015 a1c6a512-1295-4272-9138-f99709370657
2010-06-21 14:57:44 +00:00
Jonathan Gordon
a398c2846a Touchregion support for the Base Skin and FM Skins. display obviously needs to be in stylus mode for this to work. Just about all screens should be mostly useable if your sbs has the next/prev/select/cancel/menu regions defined.
Plenty of room to add new action abilities if they are wanted.


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27004 a1c6a512-1295-4272-9138-f99709370657
2010-06-21 06:04:19 +00:00
Maurus Cuelenaere
6be8306ae0 Fix error: assignment of read-only variable 'list_width'
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26923 a1c6a512-1295-4272-9138-f99709370657
2010-06-18 14:45:44 +00:00
Maurus Cuelenaere
4c4285df9a Simplify check in gui_synclist_do_touchscreen(), no functional changes.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26922 a1c6a512-1295-4272-9138-f99709370657
2010-06-18 14:41:49 +00:00
Thomas Martitz
50a6ca39ad Move c/h files implementing/defining standard library stuff into a new libc directory, also standard'ify some parts of the code base (almost entirely #include fixes).
This is to a) to cleanup firmware/common and firmware/include a bit, but also b) for Rockbox as an application which should use the host system's c library and headers, separating makes it easy to exclude our files from the build.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25850 a1c6a512-1295-4272-9138-f99709370657
2010-05-06 21:04:40 +00:00
Jonathan Gordon
466e5d9aa4 2 new tags for the base skin.
%Lt - the title text for the current list
%Li - the icon number. Same order as the CustomIcons list, except the first icon is the "no icon" icon.


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24917 a1c6a512-1295-4272-9138-f99709370657
2010-02-26 03:45:41 +00:00
Maurus Cuelenaere
9ec0c1669c Touchscreen: fix scrollbar handling when it's on the right
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24635 a1c6a512-1295-4272-9138-f99709370657
2010-02-13 15:53:10 +00:00
Teruaki Kawashima
93f9e7cbfb fix text scrolling handling in do_menu, set_time_screen and time_screen.
Don't scroll text in time_screen(). the lines will be redrawn before scrolling statrs, so they don't scroll anyway.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24591 a1c6a512-1295-4272-9138-f99709370657
2010-02-11 10:41:06 +00:00
Teruaki Kawashima
67470c890a list: improvement to move and show selection in multi-line lists.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24195 a1c6a512-1295-4272-9138-f99709370657
2010-01-07 12:51:57 +00:00
Bertrik Sikken
92d2874959 apps/gui/bitmap/list.c: use bool instead of int to hold boolean value
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24161 a1c6a512-1295-4272-9138-f99709370657
2010-01-03 13:14:50 +00:00
Jonathan Gordon
88ae46cc88 fix another bug from FS#10771 - list touchscreen handling needs to ignore presses outside the list viewport.
It probably makes sense to pass off any button presses outside of the list viewport to the sbs, I'll leave that for someone else though


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24086 a1c6a512-1295-4272-9138-f99709370657
2009-12-21 04:42:20 +00:00
Jonathan Gordon
e425371e10 Fix FS#10289 - screens showing a list need to check the show_icons setting before setting the callback. the List will now always draw icons if a callback is set (like its always done for voice)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24022 a1c6a512-1295-4272-9138-f99709370657
2009-12-16 08:36:46 +00:00
Teruaki Kawashima
67ded6ce9d Fix position calculation of title icon.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22983 a1c6a512-1295-4272-9138-f99709370657
2009-10-06 13:32:37 +00:00
Tomer Shalev
a092b9ce92 Use macro to test viewport's RTL flag
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22978 a1c6a512-1295-4272-9138-f99709370657
2009-10-06 08:07:30 +00:00
Tomer Shalev
6a12b82a85 Fine tuning of gui elements positioning in RTL mode
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22976 a1c6a512-1295-4272-9138-f99709370657
2009-10-05 23:41:59 +00:00
Tomer Shalev
ff3e3f5974 Remove redundant code in list.c
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22974 a1c6a512-1295-4272-9138-f99709370657
2009-10-05 23:08:52 +00:00
Tomer Shalev
b0a9938321 Add rtl flagging to viewport_set_defaults(), and ensure that
viewportmanager_theme_changed() is called during font loading


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22971 a1c6a512-1295-4272-9138-f99709370657
2009-10-05 21:13:55 +00:00
Tomer Shalev
58221fc38d Implement RTL as a viewport's bit-field
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22968 a1c6a512-1295-4272-9138-f99709370657
2009-10-05 20:22:02 +00:00
Tomer Shalev
6b8a78f793 Fix red - type
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22966 a1c6a512-1295-4272-9138-f99709370657
2009-10-05 20:05:55 +00:00
Tomer Shalev
2438d1693b - Use pointers instead of repeating access to array element
- Set const when possible


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22965 a1c6a512-1295-4272-9138-f99709370657
2009-10-05 19:59:16 +00:00
Tomer Shalev
1acacc2dcb Revert renaming of the scrollbar global setting by r22945, following discussion in IRC
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22963 a1c6a512-1295-4272-9138-f99709370657
2009-10-05 18:11:41 +00:00
Tomer Shalev
bbeb3ec751 Fix yellow
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22956 a1c6a512-1295-4272-9138-f99709370657
2009-10-05 13:20:08 +00:00
Tomer Shalev
0b6f683137 Have scollbar in the right side while in RTL mode
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22955 a1c6a512-1295-4272-9138-f99709370657
2009-10-05 13:00:28 +00:00
Tomer Shalev
f8adc43c64 Fix red - forgot one #ifdef
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22948 a1c6a512-1295-4272-9138-f99709370657
2009-10-05 12:18:56 +00:00