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_Patterns_.CRITICAL_FG, _G_Widget_.threshold_text_style(
80 _G_Patterns_.CRITICAL_FG,
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_Patterns_.CRITICAL_FG, _G_Widget_.threshold_text_style(
limit _G_Patterns_.CRITICAL_FG,
limit
)
), ),
} }
end end
@ -416,9 +420,11 @@ M.initTextRowCrit = function(x, y, w, label, append_end, limit)
'right', 'right',
'center' 'center'
), ),
append_end, append_end,
_G_Patterns_.CRITICAL_FG, _G_Widget_.threshold_text_style(
limit _G_Patterns_.CRITICAL_FG,
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
), ),
_G_Widget_.threshold_style(
Patterns.INDICATOR_FG_PRIMARY,
Patterns.INDICATOR_FG_CRITICAL,
0.8
),
_SPACING_, _SPACING_,
FS_NUM, FS_NUM,
false, false
Patterns.INDICATOR_FG_PRIMARY,
Patterns.INDICATOR_FG_CRITICAL,
0.8
) )
-- local labels = _G_Widget_.TextColumn{ -- local labels = _G_Widget_.TextColumn{

View File

@ -65,9 +65,11 @@ local dial = _G_Widget_.Dial(
_DIAL_THICKNESS_, _DIAL_THICKNESS_,
_G_Patterns_.INDICATOR_BG _G_Patterns_.INDICATOR_BG
), ),
_G_Patterns_.INDICATOR_FG_PRIMARY, _G_Widget_.threshold_style(
_G_Patterns_.INDICATOR_FG_CRITICAL, _G_Patterns_.INDICATOR_FG_PRIMARY,
0.8 _G_Patterns_.INDICATOR_FG_CRITICAL,
0.8
)
) )
local cache_arc = _G_Widget_.Arc( local cache_arc = _G_Widget_.Arc(
_G_Widget_.make_semicircle( _G_Widget_.make_semicircle(

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_Patterns_.INDICATOR_FG_PRIMARY, _G_Widget_.threshold_style(
_G_Patterns_.INDICATOR_FG_CRITICAL, _G_Patterns_.INDICATOR_FG_PRIMARY,
0.8, _G_Patterns_.INDICATOR_FG_CRITICAL,
0.8
),
_DIAL_INNER_RADIUS_, _DIAL_INNER_RADIUS_,
_DIAL_SPACING_, _DIAL_SPACING_,
NUM_THREADS_PER_CORE NUM_THREADS_PER_CORE