diff options
author | William Wilgus <wilgus.william@gmail.com> | 2021-04-08 00:03:18 -0400 |
---|---|---|
committer | William Wilgus <me.theuser@yahoo.com> | 2021-04-08 04:15:40 +0000 |
commit | c77cd7027f3597384f4474c049b28014027845b6 (patch) | |
tree | 8bf1b92dc7b5e69f76b66e2b1c147f5176e95aaa /apps/plugins/lua/include_lua/printtable.lua | |
parent | f8ce18c286b644f30839ac8db8cb04e9f10606a1 (diff) | |
download | rockbox-c77cd7027f3597384f4474c049b28014027845b6.tar.gz rockbox-c77cd7027f3597384f4474c049b28014027845b6.zip |
lua print_table add ability to draw a line separator
allows you to draw a line between items
Change-Id: I7e6e2f56738e12ff06d06a24f0f9d0769932a7b1
Diffstat (limited to 'apps/plugins/lua/include_lua/printtable.lua')
-rw-r--r-- | apps/plugins/lua/include_lua/printtable.lua | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/apps/plugins/lua/include_lua/printtable.lua b/apps/plugins/lua/include_lua/printtable.lua index 24c4f73b0a..b289beeb0e 100644 --- a/apps/plugins/lua/include_lua/printtable.lua +++ b/apps/plugins/lua/include_lua/printtable.lua | |||
@@ -152,14 +152,15 @@ function print_table(t, t_count, settings) | |||
152 | end | 152 | end |
153 | 153 | ||
154 | local wrap, justify, start, curpos, co_routine, hasheader, m_sel | 154 | local wrap, justify, start, curpos, co_routine, hasheader, m_sel |
155 | local header_fgc, header_bgc, item_fgc, item_bgc, item_selc | 155 | local header_fgc, header_bgc, item_fgc, item_bgc, item_selc, drawsep |
156 | do | 156 | do |
157 | local s = settings or _print.get_settings() | 157 | local s = settings or _print.get_settings() |
158 | wrap, justify = s.wrap, s.justify | 158 | wrap, justify = s.wrap, s.justify |
159 | start, curpos = s.start, s.curpos | 159 | start, curpos = s.start, s.curpos |
160 | co_routine = s.co_routine | 160 | co_routine = s.co_routine |
161 | hasheader = s.hasheader | 161 | hasheader = s.hasheader |
162 | m_sel = false | 162 | drawsep = s.drawsep |
163 | m_sel = false | ||
163 | if co_routine == nil then | 164 | if co_routine == nil then |
164 | --no multi select in incremental mode | 165 | --no multi select in incremental mode |
165 | m_sel = s.msel | 166 | m_sel = s.msel |
@@ -351,6 +352,11 @@ function print_table(t, t_count, settings) | |||
351 | _print.opt.overflow("manual") | 352 | _print.opt.overflow("manual") |
352 | _print.opt.justify(justify) | 353 | _print.opt.justify(justify) |
353 | 354 | ||
355 | local opts = _print.opt.get() | ||
356 | opts.drawsep = drawsep | ||
357 | _print.opt.set(opts) | ||
358 | |||
359 | |||
354 | -- initialize vertical scrollbar | 360 | -- initialize vertical scrollbar |
355 | set_vsb(); do | 361 | set_vsb(); do |
356 | local vsb =_print.opt.get() | 362 | local vsb =_print.opt.get() |
@@ -359,7 +365,7 @@ function print_table(t, t_count, settings) | |||
359 | vsb.bg_pattern = 3 - vsb.bg_pattern | 365 | vsb.bg_pattern = 3 - vsb.bg_pattern |
360 | end | 366 | end |
361 | 367 | ||
362 | set_vsb = function (item) | 368 | set_vsb = function (item) |
363 | if t_count > (maxline or t_count) then | 369 | if t_count > (maxline or t_count) then |
364 | rb.set_viewport(vsb) | 370 | rb.set_viewport(vsb) |
365 | item = item or 0 | 371 | item = item or 0 |