ENH use threshold style objects

This commit is contained in:
Nathan Dwarshuis 2021-07-10 23:33:25 -04:00
parent 03add92fdd
commit b1d321bfc2
5 changed files with 30 additions and 18 deletions

2
core

@ -1 +1 @@
Subproject commit 927f508765e79508b7520d12d2e6467dab175a08 Subproject commit 3d9a76cd4a4032c2e5db84e0564c69136bc27c8b

View File

@ -150,8 +150,10 @@ M.initPercentPlot = function(x, y, w, h, spacing, label)
nil, nil,
M.right_text_style, M.right_text_style,
'%s%%', '%s%%',
_G_Widget_.threshold_text_style(
_G_Patterns_.CRITICAL_FG, _G_Patterns_.CRITICAL_FG,
80 80
)
), ),
-- value = _G_Widget_.CriticalText{ -- value = _G_Widget_.CriticalText{
-- x = x + w, -- x = x + w,
@ -294,8 +296,10 @@ M.initTextRing = function(x, y, r, fmt, limit)
'center' 'center'
), ),
fmt, fmt,
_G_Widget_.threshold_text_style(
_G_Patterns_.CRITICAL_FG, _G_Patterns_.CRITICAL_FG,
limit limit
)
), ),
} }
end end
@ -417,9 +421,11 @@ M.initTextRowCrit = function(x, y, w, label, append_end, limit)
'center' 'center'
), ),
append_end, append_end,
_G_Widget_.threshold_text_style(
_G_Patterns_.CRITICAL_FG, _G_Patterns_.CRITICAL_FG,
limit limit
) )
)
} }
end end

View File

@ -69,12 +69,14 @@ local bars = _G_Widget_.CompoundBar(
Patterns.INDICATOR_BG, Patterns.INDICATOR_BG,
CAIRO_LINE_JOIN_MITER CAIRO_LINE_JOIN_MITER
), ),
_SPACING_, _G_Widget_.threshold_style(
FS_NUM,
false,
Patterns.INDICATOR_FG_PRIMARY, Patterns.INDICATOR_FG_PRIMARY,
Patterns.INDICATOR_FG_CRITICAL, Patterns.INDICATOR_FG_CRITICAL,
0.8 0.8
),
_SPACING_,
FS_NUM,
false
) )
-- local labels = _G_Widget_.TextColumn{ -- local labels = _G_Widget_.TextColumn{

View File

@ -65,10 +65,12 @@ local dial = _G_Widget_.Dial(
_DIAL_THICKNESS_, _DIAL_THICKNESS_,
_G_Patterns_.INDICATOR_BG _G_Patterns_.INDICATOR_BG
), ),
_G_Widget_.threshold_style(
_G_Patterns_.INDICATOR_FG_PRIMARY, _G_Patterns_.INDICATOR_FG_PRIMARY,
_G_Patterns_.INDICATOR_FG_CRITICAL, _G_Patterns_.INDICATOR_FG_CRITICAL,
0.8 0.8
) )
)
local cache_arc = _G_Widget_.Arc( local cache_arc = _G_Widget_.Arc(
_G_Widget_.make_semicircle( _G_Widget_.make_semicircle(
_G_Widget_.make_point(DIAL_X, DIAL_Y), _G_Widget_.make_point(DIAL_X, DIAL_Y),

View File

@ -76,9 +76,11 @@ local _create_core_ = function(cores, id, x, y)
360 360
), ),
_G_Patterns_.INDICATOR_BG, _G_Patterns_.INDICATOR_BG,
_G_Widget_.threshold_style(
_G_Patterns_.INDICATOR_FG_PRIMARY, _G_Patterns_.INDICATOR_FG_PRIMARY,
_G_Patterns_.INDICATOR_FG_CRITICAL, _G_Patterns_.INDICATOR_FG_CRITICAL,
0.8, 0.8
),
_DIAL_INNER_RADIUS_, _DIAL_INNER_RADIUS_,
_DIAL_SPACING_, _DIAL_SPACING_,
NUM_THREADS_PER_CORE NUM_THREADS_PER_CORE