summaryrefslogtreecommitdiffstats
path: root/apps/plugins/lua/include_lua/print.lua
diff options
context:
space:
mode:
authorWilliam Wilgus <wilgus.william@gmail.com>2021-04-27 23:12:49 -0400
committerWilliam Wilgus <me.theuser@yahoo.com>2021-04-28 04:37:16 +0000
commit63b62815050acbfd96f913c4fd936040aac871d7 (patch)
tree8b347a95cc5d58a4c060c3e02350a6ae3c90f170 /apps/plugins/lua/include_lua/print.lua
parentd5695822a7d2f04aad43f751ea427718a5d7257e (diff)
downloadrockbox-63b62815050acbfd96f913c4fd936040aac871d7.tar.gz
rockbox-63b62815050acbfd96f913c4fd936040aac871d7.tar.bz2
rockbox-63b62815050acbfd96f913c4fd936040aac871d7.zip
lua add submenu module + cleanup
allows menus + submenus + context menus all with simple tables menu_t which is a table of strings func_t which are the corresponding functions to go with those strings see lua_scripts/submenu_demo.lua Change-Id: I907b74b4abef0ecbe49f181d0ced6e6d20e94de5
Diffstat (limited to 'apps/plugins/lua/include_lua/print.lua')
-rw-r--r--apps/plugins/lua/include_lua/print.lua14
1 files changed, 6 insertions, 8 deletions
diff --git a/apps/plugins/lua/include_lua/print.lua b/apps/plugins/lua/include_lua/print.lua
index 3b4c389848..6f2010422a 100644
--- a/apps/plugins/lua/include_lua/print.lua
+++ b/apps/plugins/lua/include_lua/print.lua
@@ -343,20 +343,15 @@ local _print = {} do
tld.line_end_color = line_end_color
end
- line_separator = ld.line_separator
-
+ line_separator = ld.line_separator or o.drawsep
+ local indent = line_indent < 0 and 0 or line_indent --rb scroller doesn't like negative offset!
if o.line == 1 and o.header then
- --rb scroller doesn't like negative offset!
- local indent = line_indent < 0 and 0 or line_indent
set_desc(ld, true, 1, false, rb.STYLE_DEFAULT,
indent, o.fg_pattern, o.bg_pattern, o.bg_pattern)
ld.show_cursor = false
elseif s_lines[o.line] then
--/* Display line selector */
local style = show_cursor == true and rb.STYLE_DEFAULT or linestyle
-
- local indent = line_indent < 0 and 0 or line_indent
- --rb scroller doesn't like negative offset!
local ovfl = (o.ovfl == "auto" and w >= o.width and x == 0)
set_desc(ld, ovfl, 0, true, style, indent,
o.bg_pattern, o.sel_pattern, o.sel_pattern)
@@ -377,7 +372,9 @@ local _print = {} do
if ld.selected == true then
rb.set_viewport(o) -- revert drawmode if selected
end
- rb.lcd_drawline(0, line * h, o.width, line * h)
+ if not o.header then
+ rb.lcd_drawline(0, line * h, o.width, line * h)
+ end
rb.lcd_drawline(0, line * h + h, o.width, line * h + h) --only to add the last line
-- but we don't have an idea which line is the last line here so every line is the last line!
end
@@ -457,6 +454,7 @@ local _print = {} do
_print.opt.line = set_line
_print.opt.linedesc = set_linedesc
_print.opt.autoupdate = set_update
+ _print.selected = function() return s_lines end
_print.clear = clear
_print.f = printf