From 4faa18ded04eaa69d9e98d43d7394316f3baa441 Mon Sep 17 00:00:00 2001 From: ndwarshuis Date: Tue, 6 Jul 2021 18:56:24 -0400 Subject: [PATCH] REF move crticial patterns out of core --- core | 2 +- drawing/Common.lua | 7 ++++--- drawing/FileSystem.lua | 1 + drawing/Graphics.lua | 3 ++- drawing/Memory.lua | 4 +++- drawing/Processor.lua | 1 + 6 files changed, 12 insertions(+), 6 deletions(-) diff --git a/core b/core index f15bbe1..7a1f42c 160000 --- a/core +++ b/core @@ -1 +1 @@ -Subproject commit f15bbe1bb31f75aad4b49566a11092e25a559205 +Subproject commit 7a1f42c1fec42ff66ee8fcb1ae7d8fcd3926ff69 diff --git a/drawing/Common.lua b/drawing/Common.lua index 2f87110..555f31e 100644 --- a/drawing/Common.lua +++ b/drawing/Common.lua @@ -11,8 +11,8 @@ local ScalePlot = require 'ScalePlot' local HEADER_HEIGHT = 45 local HEADER_FONT_SIZE = 15 -- TODO move all this font stuff to the theme file -local HEADER_FONT_SLANT = CAIRO_FONT_SLANT_NORMAL -local HEADER_FONT_WEIGHT = CAIRO_FONT_WEIGHT_BOLD +-- local HEADER_FONT_SLANT = CAIRO_FONT_SLANT_NORMAL +-- local HEADER_FONT_WEIGHT = CAIRO_FONT_WEIGHT_BOLD local HEADER_UNDERLINE_CAP = CAIRO_LINE_CAP_ROUND local HEADER_UNDERLINE_OFFSET = -20 local HEADER_UNDERLINE_THICKNESS = 3 @@ -280,7 +280,7 @@ end -- text row with critical indicator -- TODO add limit to this -M.initTextRowCrit = function(x, y, w, label, append_end) +M.initTextRowCrit = function(x, y, w, label, append_end, limit) return{ label = _G_Widget_.Text{ x = x, @@ -295,6 +295,7 @@ M.initTextRowCrit = function(x, y, w, label, append_end) x_align = 'right', text_color = _G_Patterns_.PRIMARY_FG, critical_color = _G_Patterns_.CRITICAL_FG, + critical_limit = limit, append_end = append_end, text = '', font_spec = M.normal_font_spec, diff --git a/drawing/FileSystem.lua b/drawing/FileSystem.lua index d574986..90bda8c 100644 --- a/drawing/FileSystem.lua +++ b/drawing/FileSystem.lua @@ -54,6 +54,7 @@ local bars = _G_Widget_.CompoundBar{ -- thickness = 12, critical_limit = '>0.8', indicator_pattern = Patterns.INDICATOR_FG_PRIMARY, + critical_pattern = Patterns.INDICATOR_FG_CRITICAL, line_pattern = Patterns.INDICATOR_BG, } diff --git a/drawing/Graphics.lua b/drawing/Graphics.lua index 6a2d804..e79a726 100644 --- a/drawing/Graphics.lua +++ b/drawing/Graphics.lua @@ -43,7 +43,8 @@ local internal_temp = Common.initTextRowCrit( _INTERNAL_TEMP_Y_, _G_INIT_DATA_.SECTION_WIDTH, 'Internal Temperature', - '°C' + '°C', + '>80' ) local _SEP_Y_2_ = _INTERNAL_TEMP_Y_ + _SEPARATOR_SPACING_ diff --git a/drawing/Memory.lua b/drawing/Memory.lua index f5bbca9..44ee2fe 100644 --- a/drawing/Memory.lua +++ b/drawing/Memory.lua @@ -61,6 +61,7 @@ local dial = _G_Widget_.Dial{ thickness = _DIAL_THICKNESS_, critical_limit = '>0.8', dial_pattern = _G_Patterns_.INDICATOR_FG_PRIMARY, + critical_pattern = _G_Patterns_.INDICATOR_FG_CRITICAL, arc_pattern = _G_Patterns_.INDICATOR_BG } local cache_arc = _G_Widget_.Arc{ @@ -89,7 +90,8 @@ local swap = Common.initTextRowCrit( -- TODO this is silly _RIGHT_X_ - _TEXT_LEFT_X_, 'Swap Usage', - ' %' + ' %', + '80' ) local cache = { diff --git a/drawing/Processor.lua b/drawing/Processor.lua index eea580a..81a70af 100644 --- a/drawing/Processor.lua +++ b/drawing/Processor.lua @@ -64,6 +64,7 @@ local _create_core_ = function(cores, id, x, y) spacing = _DIAL_SPACING_, num_dials = NUM_THREADS_PER_CORE, critical_limit = '>0.8', + critical_pattern = _G_Patterns_.INDICATOR_FG_CRITICAL, dial_pattern = _G_Patterns_.INDICATOR_FG_PRIMARY, arc_pattern = _G_Patterns_.INDICATOR_BG },