ENH update core

This commit is contained in:
Nathan Dwarshuis 2021-08-08 18:06:28 -04:00
parent e55ef84108
commit da32ac31f3
4 changed files with 39 additions and 32 deletions

2
core

@ -1 +1 @@
Subproject commit e83c1cac1000d1fac2f84e52128a859d26798fff Subproject commit 0390516cf112b4e239de4efd8f7a5e0d238acf8d

View File

@ -593,40 +593,47 @@ end
local default_table_font_spec = make_font_spec(FONT, TABLE_FONT_SIZE, false) local default_table_font_spec = make_font_spec(FONT, TABLE_FONT_SIZE, false)
local default_table_style = tbl.config( local default_table_config = function(label)
rect.config( return tbl.config(
style.closed_poly(TABLE_LINE_THICKNESS, CAIRO_LINE_JOIN_MITER), rect.config(
theme.BORDER_FG style.closed_poly(TABLE_LINE_THICKNESS, CAIRO_LINE_JOIN_MITER),
), theme.BORDER_FG
line.config( ),
style.line(TABLE_LINE_THICKNESS, CAIRO_LINE_CAP_BUTT), line.config(
theme.BORDER_FG, style.line(TABLE_LINE_THICKNESS, CAIRO_LINE_CAP_BUTT),
true theme.BORDER_FG,
), true
tbl.header_config( ),
default_table_font_spec, tbl.header_config(
theme.PRIMARY_FG, default_table_font_spec,
TABLE_HEADER_PAD theme.PRIMARY_FG,
), TABLE_HEADER_PAD
tbl.body_config( ),
default_table_font_spec, tbl.body_config(
theme.INACTIVE_TEXT_FG, default_table_font_spec,
TABLE_BODY_FORMAT theme.INACTIVE_TEXT_FG,
), -- TABLE_BODY_FORMAT,
F.padding( {
TABLE_HORZ_PAD, tbl.column_config('Name', TABLE_BODY_FORMAT),
TABLE_VERT_PAD, tbl.column_config('PID', false),
TABLE_HORZ_PAD, tbl.column_config(label, false),
TABLE_VERT_PAD }
),
tbl.padding(
TABLE_HORZ_PAD,
TABLE_VERT_PAD,
TABLE_HORZ_PAD,
TABLE_VERT_PAD
)
) )
) end
M.make_text_table = function(x, y, w, h, n, labels) M.make_text_table = function(x, y, w, h, n, label)
return tbl.make( return tbl.make(
F.make_box(x, y, w, h), F.make_box(x, y, w, h),
n, n,
labels, -- labels,
default_table_style default_table_config(label)
) )
end end

View File

@ -127,7 +127,7 @@ return function(update_freq)
geometry.SECTION_WIDTH, geometry.SECTION_WIDTH,
TABLE_HEIGHT, TABLE_HEIGHT,
NUM_ROWS, NUM_ROWS,
{'Name', 'PID', 'Mem (%)'} 'Mem (%)'
) )
----------------------------------------------------------------------------- -----------------------------------------------------------------------------

View File

@ -128,7 +128,7 @@ return function(update_freq)
geometry.SECTION_WIDTH, geometry.SECTION_WIDTH,
TABLE_HEIGHT, TABLE_HEIGHT,
NUM_ROWS, NUM_ROWS,
{'Name', 'PID', 'cpu (%)'} 'CPU (%)'
) )
----------------------------------------------------------------------------- -----------------------------------------------------------------------------