REF use common line style

This commit is contained in:
Nathan Dwarshuis 2021-07-24 01:29:02 -04:00
parent 9c31293f9d
commit 6783162ae2
2 changed files with 16 additions and 17 deletions

2
core

@ -1 +1 @@
Subproject commit dd025fd52a623a4cec0ed471c642dd5aa6b078ad Subproject commit 9e5d5925a8be5ec2d2a93d5d34145477224a9b2f

View File

@ -88,13 +88,13 @@ end
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
-- header -- header
M.Header = function(x, y, w, s) M.Header = function(x, y, w, text)
local bottom_y = y + HEADER_HEIGHT local bottom_y = y + HEADER_HEIGHT
local underline_y = y + HEADER_UNDERLINE_OFFSET local underline_y = y + HEADER_UNDERLINE_OFFSET
return { return {
text = Text.build_plain( text = Text.build_plain(
F.make_point(x, y), F.make_point(x, y),
s, text,
Text.style( Text.style(
M.make_font_spec(FONT, HEADER_FONT_SIZE, true), M.make_font_spec(FONT, HEADER_FONT_SIZE, true),
Theme.HEADER_FG, Theme.HEADER_FG,
@ -106,10 +106,10 @@ M.Header = function(x, y, w, s)
underline = Line.build( underline = Line.build(
F.make_point(x, underline_y), F.make_point(x, underline_y),
F.make_point(x + w, underline_y), F.make_point(x + w, underline_y),
Line.style( Line.config(
HEADER_UNDERLINE_THICKNESS, s.line(HEADER_UNDERLINE_THICKNESS, HEADER_UNDERLINE_CAP),
Theme.HEADER_FG, Theme.HEADER_FG,
HEADER_UNDERLINE_CAP true
) )
) )
} }
@ -451,10 +451,9 @@ M.compound_bar = function(x, y, w, pad, labels, spacing, thickness, threshold)
bars = CompoundBar.build( bars = CompoundBar.build(
F.make_point(x + pad, y), F.make_point(x + pad, y),
w - pad, w - pad,
Line.style( Line.config(
thickness, s.line(thickness, CAIRO_LINE_CAP_BUTT),
Theme.INDICATOR_BG, Theme.INDICATOR_BG,
CAIRO_LINE_JOIN_MITER,
true true
), ),
threshold_indicator(threshold), threshold_indicator(threshold),
@ -485,10 +484,10 @@ M.initSeparator = function(x, y, w)
return Line.build( return Line.build(
F.make_point(x, y), F.make_point(x, y),
F.make_point(x + w, y), F.make_point(x + w, y),
Line.style( Line.config(
SEPARATOR_THICKNESS, s.line(SEPARATOR_THICKNESS, CAIRO_LINE_CAP_BUTT),
Theme.BORDER_FG, Theme.BORDER_FG,
CAIRO_LINE_CAP_BUTT true
) )
) )
end end
@ -627,17 +626,17 @@ M.default_table_style = Table.style(
s.closed_poly(TABLE_LINE_THICKNESS, CAIRO_LINE_JOIN_MITER), s.closed_poly(TABLE_LINE_THICKNESS, CAIRO_LINE_JOIN_MITER),
Theme.BORDER_FG Theme.BORDER_FG
), ),
Line.style( Line.config(
TABLE_LINE_THICKNESS, s.line(TABLE_LINE_THICKNESS, CAIRO_LINE_CAP_BUTT),
Theme.BORDER_FG, Theme.BORDER_FG,
CAIRO_LINE_CAP_BUTT true
), ),
Table.header_style( Table.header_config(
M.default_table_font_spec, M.default_table_font_spec,
Theme.PRIMARY_FG, Theme.PRIMARY_FG,
TABLE_HEADER_PAD TABLE_HEADER_PAD
), ),
Table.body_style( Table.body_config(
M.default_table_font_spec, M.default_table_font_spec,
Theme.INACTIVE_TEXT_FG, Theme.INACTIVE_TEXT_FG,
TABLE_BODY_FORMAT TABLE_BODY_FORMAT