The implementation of the "show_selection_marker" option in
lists isn't great. It's a cosmetic option used to hide the
selection, but it causes the list to do funny things to the
selected_item and doesn't play nice with voiced menus, since
these rely on the selection to determine what item is spoken.
There are only two user-facing lists that use the option, the
"Rockbox Info" screen and a menu in the superdom plugin. The
rest are debug screens, and cosmetics don't matter much there.
Given how little used the option is, and its issues, removing
it seems reasonable.
Change-Id: I2c70b3e4c74ff3cc6dbac46366a371d271dd2d58
Use const char* pointers for list titles. Only one debug menu
actually modifies the title, and in that case it's legal to
cast away const because the title points to a known mutable
buffer on the stack.
Change-Id: Idb8ab307b9a6ec23a93d8420c5e19fafd9f59c30
its really painful needing to override global settings in order to change
some aspects of lists
this patch moves:
[scrollbar position, cursor type,
talk_menus, keyclick,
wrap around, scroll paginated]
to variables within the synclist, it also makes updating
after settings changes a necessity
I think I have the static synclists in core covered
(I think the one in gui/list-skinned can be left as is)
this patch allows easy modification these flags on the fly
Change-Id: Id0dcb8b05eb9ecd78929c0aff7678bf2ab4c70a7
allow the guts of gui_sync_list to be used with owner drawn items
WIP
printcell_helper--
goal: allow data to be displayed in a spreadsheet format with an easy to use interface
printcell_set_columns(gui_synclist, title, icon)
sets title and calculates cell widths
each column is identified by '$' character
ex 3 columns title = "Col1$Col2$Col3"
also accepts $*WIDTH$
ex 3 columns varying width title = "$*64$Col1$*128$Col2$Col3
printcell_enable(gui_synclist, enable)
sets the printcell function enabled
After setting the columns and enabling the printcell function
items can be added to the list like normal
column items are supplied delimited by '$'
ex item = "Item1$item2$item3"
they will be placed in cells defined by set_columns and scroll if the cell is too small
--Fixed for 1 bit & 2 bit displays
Change-Id: I49bd7903005d7a54e93af4379b0cdea63c860656
Scrolling via the scrollbar is now a bit smoother -- it's
now drawn pixelwise, and dragging it will scroll the list
pixelwise instead of rigidly snapping to items.
Several other general UX issues were fixed:
- List and scrollbar now occupy the full viewport height,
to maximize use of screen space.
- Fixed issue with last item in the list suddenly appearing
or disappearing while scrolling.
- Prevented scrolling into blank space after the last item.
Change-Id: Ib279ac87ec2f2ffc8834c19ff0af45286e2d6d4d
Some lists have tall items that span more than one line of text,
eg. the bookmark menu or ID3 tag menu. The touchscreen code didn't
handle these menus correctly and touching on the lower part of a
list item could select "between" two items, leading to incorrect
rendering and behavior due to callers relying on the selected item
being properly aligned to the selection size. Fix this by ensuring
the touch code only generates properly aligned selections.
Change-Id: I73945bb0947590517a005754bd447639e22812e2
Due to this inadequate bounds check, it was possible under certain
conditions to cause a crash by touching & scrolling in the empty
space "after" the last item of a list.
Change-Id: Ic6c30214d887e1c7ccb212de272248ca24f60856
The viewport used for the scrollbar is allocated on the stack, and falls
out of scope before the next call to set_viewport(), which sets a flag
in the now-out-of-scope "last" viewport.
Change-Id: I2c8bfcff500d189fa3857411aadc2e16aa545d2c
While using Rockbox for a while on my 1st-gen iPod mini I noticed that
the first entry of a list sometimes displays a wrong character at the
18th column. For example, the ':' character would display as 'z', the
'-' character as 'm', 0x00 would display '@' and so on. Oddly enough
this only occurred when the scrollbar was enabled.
I figured that the call to `display->set_viewport(list_text_vp);` in the
for loop inside `list_draw(...)` causes this. Digging deeper I noticed
that in the `lcd-bitmap-common.c` driver the `current_viewport` was
pointing to the start of the line's text. From what I can tell the
cause of this was that the viewport was set to a struct with a shorter
scope than the entire function.
The actual fix for this is quite straightforward -- once the scrollbar
has been drawn the viewport is now changed back to the default one.
Change-Id: Id6a7bd8f74864641ea1670fedea9d12d764e78c0
I'm currently running up against the limitations of the lcd_draw functions
I want these functions to be able to be used on any size buffer not
just buffers with a stride matching the underlying device
[DONE] allow the framebuffer to be decoupled from the device framebuffer
[DONE need examples] allow for some simple blit like transformations
[DONE] remove the device framebuffer from the plugin api
[DONE}ditto remote framebuffer
[DONE] remove _viewport_get_framebuffer you can call struct *vp = lcd_set_viewport(NULL) and vp->buffer->fb_ptr
while remote lcds may compile (and work in the sim) its not been tested on targets
[FIXED] backdrops need work to be screen agnostic
[FIXED] screen statusbar is not being combined into the main viewport correctly yet
[FIXED] screen elements are displayed incorrectly after switch to void*
[FIXED] core didn't restore proper viewport on splash etc.
[NEEDS TESTING] remote lcd garbled data
[FIXED] osd lib garbled screen on bmp_part
[FIXED] grey_set_vp needs to return old viewport like lcd_set_viewport
[FIXED] Viewport update now handles viewports with differing buffers/strides by copying to the main buffer
[FIXED] splash on top of WPS leaves old framebuffer data (doesn't redraw)
[UPDATE] refined this a bit more to have clear_viewport set the clean bit and have skin_render do its own screen clear
scrolling viewports no longer trigger wps refresh
also fixed a bug where guisyncyesno was displaying and then disappearing
[ADDED!] New LCD macros that allow you to create properly size frame buffers in you desired size without wasting bytes
(LCD_ and LCD_REMOTE_)
LCD_STRIDE(w, h) same as STRIDE_MAIN
LCD_FBSTRIDE(w, h) returns target specific stride for a buffer W x H
LCD_NBELEMS(w, h) returns the number of fb_data sized elemenst needed for a buffer W x H
LCD_NATIVE_STRIDE(s) conversion between rockbox native vertical and lcd native stride (2bitH)
test_viewports.c has an example of usage
[FIXED!!] 2bit targets don't respect non-native strides
[FIXED] Few define snags
Change-Id: I0d04c3834e464eca84a5a715743a297a0cefd0af
This patch adds a configurable line separator between list items, very
similar to lists in Android. Additionally, below the list item there is a
thicker line. It can be disabled in the settings. Its color can
be configured as well.
Remote and monochrome displays are explicitly unsupported. If there is desire
this can be changed but it doesn't seem useful to me.
Change-Id: I005313b0d8f5ecd15864bf20e66ea4e3390d8b7d
This enables removing large portions of code, simplifiyng the drawing routine.
All of the removed code is functionaltiy now available through put_line().
Change-Id: Ib8e61772134189a8c3c6d22345c0b45e912bea76
Since x is viewport-relative the icon isn't necessarily placed at the physical
display boundaries so that the padding isn't always useful. In fact it does
more harm if one wants to place an icon exactly at 0 of a (non-default)
viewport.
Calling code looks still mostly fine. I've only modified list drawer to include
the padding in the call-site.
Change-Id: I6b16b3d4377c3553234667b79837adde10e0edf2
It fixed a simulator warning in the skin debug screen but broke
the icons in the database folder chooser. Proper fix shortly.
Change-Id: If366daacc440f937c40960112477b8f6136b72b9
There were some bugs, especially when the user scrolled above the
list viewport. One bug made Rockbox completely unusable once triggered.
Change-Id: I9bb4722ff4381db189058e9a19ea30b2c69e87d9
Change-Id: I1583371228ed477b504c135f81cb59a0c3c931e6
Reviewed-on: http://gerrit.rockbox.org/296
Reviewed-by: Jonathan Gordon <rockbox@jdgordon.info>
Tested-by: Jonathan Gordon <rockbox@jdgordon.info>
Creates a standard buffer passing, local data passing and messaging
system for processing stages. Stages can be moved to their own source
files to reduce clutter and ease assimilation of new ones. dsp.c
becomes dsp_core.c which supports an engine and framework for effects.
Formats and change notifications are passed along with the buffer so
that they arrive at the correct time at each stage in the chain
regardless of the internal delays of a particular one.
Removes restrictions on the number of samples that can be processed at
a time and it pays attention to destination buffer size restrictions
without having to limit input count, which also allows pcmbuf to
remain fuller and safely set its own buffer limits as it sees fit.
There is no longer a need to query input/output counts given a certain
number of input samples; just give it the sizes of the source and
destination buffers.
Works in harmony with stages that are not deterministic in terms of
sample input/output ratio (like both resamplers but most notably
the timestretch). As a result it fixes quirks with timestretch hanging
up with certain settings and it now operates properly throughout its
full settings range.
Change-Id: Ib206ec78f6f6c79259c5af9009fe021d68be9734
Reviewed-on: http://gerrit.rockbox.org/200
Reviewed-by: Michael Sevakis <jethead71@rockbox.org>
Tested-by: Michael Sevakis <jethead71@rockbox.org>
* fix potential stack overflow through recursion
* fix using using the scrollbar during active kinetic scrolling animation
Change-Id: Iaf124970a60d3f0c2ee7919ac278f2d6ac329e47
The old code was very confusing. The scrolling modes need to be handled
differently, thus a state machine makes sense. Should fix numerious
glitches and be easier to maintain.
NOTE: Behavior is still a bit glitchy with an SBS in use, because the skin
engine sees the touch events earlier than the list code.
Change-Id: I4ccead359c81de0d0fc3dea636fe2cb3a28d1bc6
The scrolling code cannot differentiate between the BUTTON_TOUCHSCREEN post
from normal touches and the one posted in the timeout callback.
To fix introduce a global special button (BUTTON_REDRAW) that results
in the desired redraw. This existed already as a local kludge for android
and is now generalized.
Change-Id: I6bfa6c66431c48f5042fcd8fce2ea72cd3457f58
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
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
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
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
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
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
* 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