From da32ac31f3fb520f3abbc650d5d0121cb4843c09 Mon Sep 17 00:00:00 2001 From: ndwarshuis Date: Sun, 8 Aug 2021 18:06:28 -0400 Subject: [PATCH] ENH update core --- core | 2 +- drawing/common.lua | 65 ++++++++++++++++++++++++------------------- drawing/memory.lua | 2 +- drawing/processor.lua | 2 +- 4 files changed, 39 insertions(+), 32 deletions(-) diff --git a/core b/core index e83c1ca..0390516 160000 --- a/core +++ b/core @@ -1 +1 @@ -Subproject commit e83c1cac1000d1fac2f84e52128a859d26798fff +Subproject commit 0390516cf112b4e239de4efd8f7a5e0d238acf8d diff --git a/drawing/common.lua b/drawing/common.lua index 271464c..fa13b50 100644 --- a/drawing/common.lua +++ b/drawing/common.lua @@ -593,40 +593,47 @@ end local default_table_font_spec = make_font_spec(FONT, TABLE_FONT_SIZE, false) -local default_table_style = tbl.config( - rect.config( - style.closed_poly(TABLE_LINE_THICKNESS, CAIRO_LINE_JOIN_MITER), - theme.BORDER_FG - ), - line.config( - style.line(TABLE_LINE_THICKNESS, CAIRO_LINE_CAP_BUTT), - theme.BORDER_FG, - true - ), - tbl.header_config( - default_table_font_spec, - theme.PRIMARY_FG, - TABLE_HEADER_PAD - ), - tbl.body_config( - default_table_font_spec, - theme.INACTIVE_TEXT_FG, - TABLE_BODY_FORMAT - ), - F.padding( - TABLE_HORZ_PAD, - TABLE_VERT_PAD, - TABLE_HORZ_PAD, - TABLE_VERT_PAD +local default_table_config = function(label) + return tbl.config( + rect.config( + style.closed_poly(TABLE_LINE_THICKNESS, CAIRO_LINE_JOIN_MITER), + theme.BORDER_FG + ), + line.config( + style.line(TABLE_LINE_THICKNESS, CAIRO_LINE_CAP_BUTT), + theme.BORDER_FG, + true + ), + tbl.header_config( + default_table_font_spec, + theme.PRIMARY_FG, + TABLE_HEADER_PAD + ), + tbl.body_config( + default_table_font_spec, + theme.INACTIVE_TEXT_FG, + -- TABLE_BODY_FORMAT, + { + tbl.column_config('Name', TABLE_BODY_FORMAT), + tbl.column_config('PID', false), + tbl.column_config(label, false), + } + ), + 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( F.make_box(x, y, w, h), n, - labels, - default_table_style + -- labels, + default_table_config(label) ) end diff --git a/drawing/memory.lua b/drawing/memory.lua index 7d18d31..c72a37f 100644 --- a/drawing/memory.lua +++ b/drawing/memory.lua @@ -127,7 +127,7 @@ return function(update_freq) geometry.SECTION_WIDTH, TABLE_HEIGHT, NUM_ROWS, - {'Name', 'PID', 'Mem (%)'} + 'Mem (%)' ) ----------------------------------------------------------------------------- diff --git a/drawing/processor.lua b/drawing/processor.lua index e32c939..ac2c5d8 100644 --- a/drawing/processor.lua +++ b/drawing/processor.lua @@ -128,7 +128,7 @@ return function(update_freq) geometry.SECTION_WIDTH, TABLE_HEIGHT, NUM_ROWS, - {'Name', 'PID', 'cpu (%)'} + 'CPU (%)' ) -----------------------------------------------------------------------------