summaryrefslogtreecommitdiffstats
path: root/apps/gui/bitmap/list.c
AgeCommit message (Collapse)AuthorFilesLines
2023-10-09list allow VOICE_ONLY stringsWilliam Wilgus1-1/+4
Change-Id: Ie42ba8de986a10f68e05af0ecdb735b020aa9d1a
2022-10-30Fix tree scrolling not showing end of textroman.artiukhin1-2/+1
Fixes FS#13243 Change-Id: Icc9fa1e92ca5c928f90ba1a8291bdf37a6fe7898
2022-10-02gui: Remove show/hide selection option in listsAidan MacDonald1-6/+2
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
2022-10-02gui: Constify list title textAidan MacDonald1-1/+1
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
2022-04-10bitmap/list.c fix redWilliam Wilgus1-1/+1
--typo Change-Id: Iaa632e215d7d1e3758f62fedd72565fa633d925e
2022-04-10gui_synclist move global display settings to list structWilliam Wilgus1-18/+28
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
2022-01-01gui lists add callback for owner drawn itemsWilliam Wilgus1-32/+100
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
2021-11-24touchscreen: improved pixelwise scrolling in listsAidan MacDonald1-18/+56
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
2021-08-22touchscreen: fix smooth scrolling in listsAidan MacDonald1-26/+31
This fixes those annoying jumps that happen when you hit the end of a list while scrolling. Change-Id: I2e41111f9415dce1692b52a2600e7ce77c8f0291
2021-08-22touchscreen: handle scrollbar properly when UI viewport is usedAidan MacDonald1-7/+4
Change-Id: I3b55233f4d50f5b8ae38f9f337ebdee6f93ad44e
2021-08-10touchscreen: Respect list item selection sizeAidan MacDonald1-2/+6
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
2021-06-22Touchscreen: absolute point mode scrolling bugfixAidan MacDonald1-1/+1
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
2021-04-07list: After drawing scrollbars, explcitly switch back to old viewport.Solomon Peachy1-1/+2
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
2020-12-12list: reset viewport to avoid corrupting the text in the first lineGeorg Gadinger1-1/+1
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
2020-11-14synclist add method for setting selection colorWilliam Wilgus1-3/+13
Change-Id: I8c8761d92f4fc99f65d45098ee6e97800d3fe002
2020-10-26LCD core move buf ptr and address look up function viewport structWilliam Wilgus1-2/+2
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
2017-09-07Explicitly provide both cases in conditional (fixes warning)Frank Gevaerts1-1/+1
Change-Id: Iedca64432103af5407a7c7bac83e92ca1ae8992b
2014-03-03Touchscreen: Show a line separator in lists.Thomas Martitz1-1/+12
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
2014-01-07lists: Adapt put_line().Thomas Martitz1-173/+97
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
2014-01-07icons: Remove automatic left padding if x == 0.Thomas Martitz1-3/+3
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
2013-12-14scroll_engine: Rename scroll_stop* functions to be more consistent with the ↵Thomas Martitz1-5/+5
lcd api. Change-Id: I8ada10b96bfb628cca0331689e8b936ae47c7e1c
2013-02-13list widget: undo part of aaf3065Jonathan Gordon1-2/+0
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
2013-02-12skin_engine: Add a debug screen to display skin ram usageJonathan Gordon1-0/+2
Change-Id: Ida9c33211d9360ac88e30a2cf8df9f191bee8b45
2013-02-06gui: Fix \t indenting for RTL langs in the lists (DB folder chooser)Jonathan Gordon1-4/+18
Change-Id: If033547ad979a2ebdd463723a31eb15e718e6f8b
2013-01-18lists: Fix item indentation in RTL to match LTR behavior (which is no ↵Thomas Martitz1-1/+2
indentation when the scrollbar isn't shown, apparently). Change-Id: I5c36d34638fa7a9cba9468b7ee07a07a836fadec
2013-01-17touchscreen: Fix kinetic and swipe scrolling outside of the list viewport.Thomas Martitz1-57/+59
There were some bugs, especially when the user scrolled above the list viewport. One bug made Rockbox completely unusable once triggered. Change-Id: I9bb4722ff4381db189058e9a19ea30b2c69e87d9
2012-07-19lists: Support '\t' in list item text to indent the line containing it.Jonathan Gordon1-0/+26
Change-Id: I1583371228ed477b504c135f81cb59a0c3c931e6 Reviewed-on: http://gerrit.rockbox.org/296 Reviewed-by: Jonathan Gordon <rockbox@jdgordon.info> Tested-by: Jonathan Gordon <rockbox@jdgordon.info>
2012-06-19Make touchscreen handling work with skinned lists.Frank Gevaerts1-5/+10
Change-Id: I7df93319c8f16f05e840d74b022aab4803bb8f80
2012-06-15touchscreen: Don't hide selection by default. Fixes FS#12675.Thomas Martitz1-5/+7
Change-Id: Ic7e22ce6280d4105c38f7588717f4cf34c1bb5a3
2012-05-13Touchscreen: Check if click is outside of list. Fixes FS#12669Thomas Martitz1-0/+2
Change-Id: Ic036f4c399b89c65bdc43bfdf7111bf4a13be484
2012-04-29Fundamentally rewrite much of the audio DSP.Michael Sevakis1-1/+1
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>
2012-04-17touchscreen/lists: fix two regressionsThomas Martitz1-8/+11
* fix potential stack overflow through recursion * fix using using the scrollbar during active kinetic scrolling animation Change-Id: Iaf124970a60d3f0c2ee7919ac278f2d6ac329e47
2012-04-10touchscreen: fix some issues/crashes with clicking the list title.Thomas Martitz1-7/+12
Change-Id: I31adb012ac39f9b27f6b91f5077ed4195ba1dc02
2012-04-08touchscreen: fix swipe scrolling (jumped back to previous item).Thomas Martitz1-2/+3
Change-Id: I055a5b19dec1db3ad31212dadc11b0f5056be832
2012-04-08touchscreen: Rewrite kinetic scrolling using a state machine.Thomas Martitz1-203/+213
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
2012-04-05touchscreen: Fix kinetic scrolling when the statusbar is off.Thomas Martitz1-1/+1
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
2011-10-17Commit FS#12321 - Touchscreen: List line padding, to more easily select linesThomas Martitz1-15/+23
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-15Changed the FOR_NB_SCREENS macro to always be a for loop that declares its ↵Björn Stenberg1-1/+0
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-07Fix touchscreen behavior in time&date screen.Thomas Martitz1-3/+3
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30725 a1c6a512-1295-4272-9138-f99709370657
2011-02-02Touchscreen: Fix minor redraw after entering the context menu.Thomas Martitz1-0/+3
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29193 a1c6a512-1295-4272-9138-f99709370657
2011-02-02Redo r29168. Use similar but existing mechanism in the action system which ↵Thomas Martitz1-15/+3
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-01-29Touchscreen/lists: Hopefully fix glitchy behavior that happened after ↵Thomas Martitz1-1/+10
opening the context menu. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29168 a1c6a512-1295-4272-9138-f99709370657
2010-11-10Touchscreen: Improved scroll thresholdThomas Martitz1-1/+11
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-05Make the context menu pop up instantly after the long press timeout when ↵Thomas Martitz1-8/+13
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-10-31FS#11686 - Kinetic list scrolling for touchscreenThomas Martitz1-50/+249
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-26fix that disktidy plugin and shopper plugin is not usable when Show Icons ↵Teruaki Kawashima1-2/+2
setting is turned off. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28362 a1c6a512-1295-4272-9138-f99709370657
2010-10-09Fix several inaccuracies in list handling on touchscreen.Thomas Martitz1-36/+38
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28221 a1c6a512-1295-4272-9138-f99709370657
2010-10-06Pixel-accurate (vertical) list scrolling for touchscreen targets.Thomas Martitz1-30/+95
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-09-26Fix FS#11552 - touches outside of the UI viewport can do unexpected list ↵Jonathan Gordon1-5/+8
movements. Also remove naughty // comments from r28145 git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28168 a1c6a512-1295-4272-9138-f99709370657
2010-09-23Don't actually reimplement an existing feature for hiding the selection markerThomas Martitz1-11/+14
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