REF don't use kwargs for line-like things

This commit is contained in:
Nathan Dwarshuis 2021-07-08 23:26:38 -04:00
parent 853badd05e
commit ed2376e418
3 changed files with 53 additions and 25 deletions

2
core

@ -1 +1 @@
Subproject commit 937998112de5de54726925532ac20f7aa8e24226
Subproject commit ace0345e68a057ed013e41112db80891aeedf648

View File

@ -51,13 +51,20 @@ M.Header = function(x, y, w, s)
-- weight = HEADER_FONT_WEIGHT
},
bottom_y = bottom_y,
underline = _G_Widget_.Line{
p1 = {x = x, y = underline_y},
p2 = {x = x + w, y = underline_y},
thickness = HEADER_UNDERLINE_THICKNESS,
line_pattern = _G_Patterns_.HEADER_FG,
cap = HEADER_UNDERLINE_CAP
}
-- underline = _G_Widget_.Line{
-- p1 = {x = x, y = underline_y},
-- p2 = {x = x + w, y = underline_y},
-- thickness = HEADER_UNDERLINE_THICKNESS,
-- line_pattern = _G_Patterns_.HEADER_FG,
-- cap = HEADER_UNDERLINE_CAP
-- }
underline = _G_Widget_.Line(
HEADER_UNDERLINE_THICKNESS,
HEADER_UNDERLINE_CAP,
_G_Patterns_.HEADER_FG,
{x = x, y = underline_y},
{x = x + w, y = underline_y}
)
}
return obj
@ -245,11 +252,18 @@ end
-- separator (eg a horizontal line)
M.initSeparator = function(x, y, w)
return _G_Widget_.Line{
p1 = {x = x, y = y},
p2 = {x = x + w, y = y},
line_pattern = _G_Patterns_.BORDER_FG,
}
-- return _G_Widget_.Line{
-- p1 = {x = x, y = y},
-- p2 = {x = x + w, y = y},
-- line_pattern = _G_Patterns_.BORDER_FG,
-- }
return _G_Widget_.Line(
1,
CAIRO_LINE_CAP_BUTT,
_G_Patterns_.BORDER_FG,
{x = x, y = y},
{x = x + w, y = y}
)
end
--------------------------------------------------------------------------------

View File

@ -45,18 +45,32 @@ local separator = Common.initSeparator(
local _BAR_Y_ = _SEP_Y_ + _SEPARATOR_SPACING_
local bars = _G_Widget_.CompoundBar{
x = _G_INIT_DATA_.RIGHT_X + _BAR_PAD_,
y = _BAR_Y_,
length = _G_INIT_DATA_.SECTION_WIDTH - _BAR_PAD_,
spacing = _SPACING_,
num_bars = FS_NUM,
-- thickness = 12,
critical_limit = 0.8,
indicator_pattern = Patterns.INDICATOR_FG_PRIMARY,
critical_pattern = Patterns.INDICATOR_FG_CRITICAL,
line_pattern = Patterns.INDICATOR_BG,
}
-- local bars = _G_Widget_.CompoundBar{
-- x = _G_INIT_DATA_.RIGHT_X + _BAR_PAD_,
-- y = _BAR_Y_,
-- length = _G_INIT_DATA_.SECTION_WIDTH - _BAR_PAD_,
-- spacing = _SPACING_,
-- num_bars = FS_NUM,
-- -- thickness = 12,
-- critical_limit = 0.8,
-- indicator_pattern = Patterns.INDICATOR_FG_PRIMARY,
-- critical_pattern = Patterns.INDICATOR_FG_CRITICAL,
-- line_pattern = Patterns.INDICATOR_BG,
-- }
local bars = _G_Widget_.CompoundBar(
_G_INIT_DATA_.RIGHT_X + _BAR_PAD_,
_BAR_Y_,
_G_INIT_DATA_.SECTION_WIDTH - _BAR_PAD_,
_SPACING_,
FS_NUM,
12,
false,
Patterns.INDICATOR_BG,
Patterns.INDICATOR_FG_PRIMARY,
Patterns.INDICATOR_FG_CRITICAL,
0.8
)
local labels = _G_Widget_.TextColumn{
x = _G_INIT_DATA_.RIGHT_X,