move all atomic static drawing ops to static drawing functions
This commit is contained in:
parent
715e856d20
commit
ba4ea08453
|
@ -62,15 +62,15 @@ local update = function(cr)
|
||||||
end
|
end
|
||||||
|
|
||||||
local draw_static = function(cr)
|
local draw_static = function(cr)
|
||||||
|
Text.draw(header.text, cr)
|
||||||
|
Line.draw(header.underline, cr)
|
||||||
|
|
||||||
|
TextColumn.draw(labels, cr)
|
||||||
end
|
end
|
||||||
|
|
||||||
local draw_dynamic = function(cr, trigger)
|
local draw_dynamic = function(cr, trigger)
|
||||||
if trigger == 0 then update(cr) end
|
if trigger == 0 then update(cr) end
|
||||||
|
|
||||||
Text.draw(header.text, cr)
|
|
||||||
Line.draw(header.underline, cr)
|
|
||||||
TextColumn.draw(labels, cr)
|
|
||||||
CompoundBar.draw(bars, cr)
|
CompoundBar.draw(bars, cr)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -269,39 +269,36 @@ _MEM_UTIL_Y_ = nil
|
||||||
_VID_UTIL_Y_ = nil
|
_VID_UTIL_Y_ = nil
|
||||||
|
|
||||||
local draw_static = function(cr)
|
local draw_static = function(cr)
|
||||||
|
Text.draw(header.text, cr)
|
||||||
|
Line.draw(header.underline, cr)
|
||||||
|
|
||||||
|
Text.draw(status.label, cr)
|
||||||
|
Line.draw(separator1, cr)
|
||||||
|
|
||||||
|
Text.draw(internal_temp.label, cr)
|
||||||
|
Line.draw(separator2, cr)
|
||||||
|
|
||||||
|
TextColumn.draw(clock_speed.labels, cr)
|
||||||
|
Line.draw(separator3, cr)
|
||||||
|
|
||||||
|
Text.draw(gpu_util.label, cr)
|
||||||
|
Text.draw(mem_util.label, cr)
|
||||||
|
Text.draw(vid_util.label, cr)
|
||||||
end
|
end
|
||||||
|
|
||||||
local draw_dynamic = function(cr)
|
local draw_dynamic = function(cr)
|
||||||
update(cr)
|
update(cr)
|
||||||
|
|
||||||
Text.draw(header.text, cr)
|
|
||||||
Line.draw(header.underline, cr)
|
|
||||||
|
|
||||||
Text.draw(status.label, cr)
|
|
||||||
Text.draw(status.value, cr)
|
Text.draw(status.value, cr)
|
||||||
|
|
||||||
Line.draw(separator1, cr)
|
|
||||||
|
|
||||||
Text.draw(internal_temp.label, cr)
|
|
||||||
Text.draw(internal_temp.value, cr)
|
Text.draw(internal_temp.value, cr)
|
||||||
|
|
||||||
Line.draw(separator2, cr)
|
|
||||||
|
|
||||||
TextColumn.draw(clock_speed.labels, cr)
|
|
||||||
TextColumn.draw(clock_speed.values, cr)
|
TextColumn.draw(clock_speed.values, cr)
|
||||||
|
|
||||||
Line.draw(separator3, cr)
|
|
||||||
|
|
||||||
Text.draw(gpu_util.label, cr)
|
|
||||||
Text.draw(gpu_util.value, cr)
|
Text.draw(gpu_util.value, cr)
|
||||||
LabelPlot.draw(gpu_util.plot, cr)
|
LabelPlot.draw(gpu_util.plot, cr)
|
||||||
|
|
||||||
Text.draw(mem_util.label, cr)
|
|
||||||
Text.draw(mem_util.value, cr)
|
Text.draw(mem_util.value, cr)
|
||||||
LabelPlot.draw(mem_util.plot, cr)
|
LabelPlot.draw(mem_util.plot, cr)
|
||||||
|
|
||||||
Text.draw(vid_util.label, cr)
|
|
||||||
Text.draw(vid_util.value, cr)
|
Text.draw(vid_util.value, cr)
|
||||||
LabelPlot.draw(vid_util.plot, cr)
|
LabelPlot.draw(vid_util.plot, cr)
|
||||||
end
|
end
|
||||||
|
|
|
@ -199,22 +199,23 @@ _RIGHT_X_ = nil
|
||||||
_PLOT_Y_ = nil
|
_PLOT_Y_ = nil
|
||||||
|
|
||||||
local draw_static = function(cr)
|
local draw_static = function(cr)
|
||||||
|
Text.draw(header.text, cr)
|
||||||
|
Line.draw(header.underline, cr)
|
||||||
|
|
||||||
|
Arc.draw(inner_ring, cr)
|
||||||
|
|
||||||
|
Text.draw(swap.label, cr)
|
||||||
|
TextColumn.draw(cache.labels, cr)
|
||||||
end
|
end
|
||||||
|
|
||||||
local draw_dynamic = function(cr)
|
local draw_dynamic = function(cr)
|
||||||
update(cr)
|
update(cr)
|
||||||
|
|
||||||
Text.draw(header.text, cr)
|
|
||||||
Line.draw(header.underline, cr)
|
|
||||||
Dial.draw(dial, cr)
|
Dial.draw(dial, cr)
|
||||||
Arc.draw(cache_arc, cr)
|
Arc.draw(cache_arc, cr)
|
||||||
Arc.draw(inner_ring, cr)
|
|
||||||
CriticalText.draw(total_used, cr)
|
CriticalText.draw(total_used, cr)
|
||||||
|
|
||||||
Text.draw(swap.label, cr)
|
|
||||||
CriticalText.draw(swap.percent, cr)
|
CriticalText.draw(swap.percent, cr)
|
||||||
TextColumn.draw(cache.labels, cr)
|
|
||||||
TextColumn.draw(cache.percents, cr)
|
TextColumn.draw(cache.percents, cr)
|
||||||
|
|
||||||
LabelPlot.draw(plot, cr)
|
LabelPlot.draw(plot, cr)
|
||||||
|
|
|
@ -133,20 +133,19 @@ _RIGHT_X_ = nil
|
||||||
_UPLOAD_Y_ = nil
|
_UPLOAD_Y_ = nil
|
||||||
|
|
||||||
local draw_static = function(cr)
|
local draw_static = function(cr)
|
||||||
|
Text.draw(header.text, cr)
|
||||||
|
Line.draw(header.underline, cr)
|
||||||
|
|
||||||
|
Text.draw(dnload.label, cr)
|
||||||
|
Text.draw(upload.label, cr)
|
||||||
end
|
end
|
||||||
|
|
||||||
local draw_dynamic = function(cr, update_frequency)
|
local draw_dynamic = function(cr, update_frequency)
|
||||||
update(cr, update_frequency)
|
update(cr, update_frequency)
|
||||||
|
|
||||||
Text.draw(header.text, cr)
|
|
||||||
Line.draw(header.underline, cr)
|
|
||||||
|
|
||||||
Text.draw(dnload.label, cr)
|
|
||||||
Text.draw(dnload.speed, cr)
|
Text.draw(dnload.speed, cr)
|
||||||
ScalePlot.draw(dnload.plot, cr)
|
ScalePlot.draw(dnload.plot, cr)
|
||||||
|
|
||||||
Text.draw(upload.label, cr)
|
|
||||||
Text.draw(upload.speed, cr)
|
Text.draw(upload.speed, cr)
|
||||||
ScalePlot.draw(upload.plot, cr)
|
ScalePlot.draw(upload.plot, cr)
|
||||||
end
|
end
|
||||||
|
|
|
@ -50,15 +50,14 @@ local update = function(cr)
|
||||||
end
|
end
|
||||||
|
|
||||||
local draw_static = function(cr)
|
local draw_static = function(cr)
|
||||||
|
Text.draw(header.text, cr)
|
||||||
|
Line.draw(header.underline, cr)
|
||||||
|
TextColumn.draw(labels, cr)
|
||||||
end
|
end
|
||||||
|
|
||||||
local draw_dynamic = function(cr, log_is_changed)
|
local draw_dynamic = function(cr, log_is_changed)
|
||||||
if log_is_changed then update(cr) end
|
if log_is_changed then update(cr) end
|
||||||
|
|
||||||
Text.draw(header.text, cr)
|
|
||||||
Line.draw(header.underline, cr)
|
|
||||||
TextColumn.draw(labels, cr)
|
|
||||||
TextColumn.draw(info, cr)
|
TextColumn.draw(info, cr)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -252,33 +252,34 @@ _PROCESS_Y_ = nil
|
||||||
_PLOT_Y_ = nil
|
_PLOT_Y_ = nil
|
||||||
|
|
||||||
local draw_static = function(cr)
|
local draw_static = function(cr)
|
||||||
|
Text.draw(header.text, cr)
|
||||||
|
Line.draw(header.underline, cr)
|
||||||
|
|
||||||
|
for c = 1, NUM_PHYSICAL_CORES do
|
||||||
|
local this_core = cores[c]
|
||||||
|
Arc.draw(this_core.inner_ring, cr)
|
||||||
|
end
|
||||||
|
|
||||||
|
Text.draw(process.label, cr)
|
||||||
|
Text.draw(ave_freq.label, cr)
|
||||||
|
Line.draw(separator, cr)
|
||||||
|
|
||||||
|
Text.draw(total_load.label, cr)
|
||||||
end
|
end
|
||||||
|
|
||||||
local draw_dynamic = function(cr)
|
local draw_dynamic = function(cr)
|
||||||
update(cr)
|
update(cr)
|
||||||
|
|
||||||
Text.draw(header.text, cr)
|
|
||||||
Line.draw(header.underline, cr)
|
|
||||||
|
|
||||||
for c = 1, NUM_PHYSICAL_CORES do
|
for c = 1, NUM_PHYSICAL_CORES do
|
||||||
local core = cores[c]
|
local this_core = cores[c]
|
||||||
CompoundDial.draw(core.dials, cr)
|
CompoundDial.draw(this_core.dials, cr)
|
||||||
Arc.draw(core.inner_ring, cr)
|
CriticalText.draw(this_core.coretemp_text, cr)
|
||||||
CriticalText.draw(core.coretemp_text, cr)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
Text.draw(process.label, cr)
|
|
||||||
Text.draw(process.value, cr)
|
Text.draw(process.value, cr)
|
||||||
|
|
||||||
Text.draw(ave_freq.label, cr)
|
|
||||||
Text.draw(ave_freq.value, cr)
|
Text.draw(ave_freq.value, cr)
|
||||||
|
|
||||||
Line.draw(separator, cr)
|
|
||||||
|
|
||||||
Text.draw(total_load.label, cr)
|
|
||||||
CriticalText.draw(total_load.value, cr)
|
CriticalText.draw(total_load.value, cr)
|
||||||
|
|
||||||
LabelPlot.draw(plot, cr)
|
LabelPlot.draw(plot, cr)
|
||||||
|
|
||||||
Table.draw(tbl, cr)
|
Table.draw(tbl, cr)
|
||||||
|
|
|
@ -120,20 +120,19 @@ local update = function(cr, update_frequency)
|
||||||
end
|
end
|
||||||
|
|
||||||
local draw_static = function(cr)
|
local draw_static = function(cr)
|
||||||
|
Text.draw(header.text, cr)
|
||||||
|
Line.draw(header.underline, cr)
|
||||||
|
|
||||||
|
Text.draw(reads.label, cr)
|
||||||
|
Text.draw(writes.label, cr)
|
||||||
end
|
end
|
||||||
|
|
||||||
local draw_dynamic = function(cr, update_frequency)
|
local draw_dynamic = function(cr, update_frequency)
|
||||||
update(cr, update_frequency)
|
update(cr, update_frequency)
|
||||||
|
|
||||||
Text.draw(header.text, cr)
|
|
||||||
Line.draw(header.underline, cr)
|
|
||||||
|
|
||||||
Text.draw(reads.label, cr)
|
|
||||||
Text.draw(reads.rate, cr)
|
Text.draw(reads.rate, cr)
|
||||||
ScalePlot.draw(reads.plot, cr)
|
ScalePlot.draw(reads.plot, cr)
|
||||||
|
|
||||||
Text.draw(writes.label, cr)
|
|
||||||
Text.draw(writes.rate, cr)
|
Text.draw(writes.rate, cr)
|
||||||
ScalePlot.draw(writes.plot, cr)
|
ScalePlot.draw(writes.plot, cr)
|
||||||
end
|
end
|
||||||
|
|
|
@ -45,7 +45,9 @@ local info = _G_Widget_.TextColumn{
|
||||||
_TEXT_SPACING_ = nil
|
_TEXT_SPACING_ = nil
|
||||||
|
|
||||||
local draw_static = function(cr)
|
local draw_static = function(cr)
|
||||||
|
Text.draw(header.text, cr)
|
||||||
|
Line.draw(header.underline, cr)
|
||||||
|
TextColumn.draw(labels, cr)
|
||||||
end
|
end
|
||||||
|
|
||||||
local draw_dynamic = function(cr, log_is_changed)
|
local draw_dynamic = function(cr, log_is_changed)
|
||||||
|
@ -58,9 +60,6 @@ local draw_dynamic = function(cr, log_is_changed)
|
||||||
"'/ synchronizing package lists/p' /var/log/pacman.log | tail -1"))
|
"'/ synchronizing package lists/p' /var/log/pacman.log | tail -1"))
|
||||||
end
|
end
|
||||||
|
|
||||||
Text.draw(header.text, cr)
|
|
||||||
Line.draw(header.underline, cr)
|
|
||||||
TextColumn.draw(labels, cr)
|
|
||||||
TextColumn.draw(info, cr)
|
TextColumn.draw(info, cr)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue