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,
M.right_text_style,
'%s%%',
_G_Widget_.threshold_text_style(
_G_Patterns_.CRITICAL_FG,
80
)
),
-- value = _G_Widget_.CriticalText{
-- x = x + w,
@ -294,8 +296,10 @@ M.initTextRing = function(x, y, r, fmt, limit)
'center'
),
fmt,
_G_Widget_.threshold_text_style(
_G_Patterns_.CRITICAL_FG,
limit
)
),
}
end
@ -417,9 +421,11 @@ M.initTextRowCrit = function(x, y, w, label, append_end, limit)
'center'
),
append_end,
_G_Widget_.threshold_text_style(
_G_Patterns_.CRITICAL_FG,
limit
)
)
}
end

View File

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

View File

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

View File

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