[Xfce4-commits] [panel-plugins/xfce4-hardware-monitor-plugin] 08/29: Fix CurveView to respect monitor fixed maxes when querying data max values
noreply at xfce.org
noreply at xfce.org
Mon Dec 18 12:45:39 CET 2017
This is an automated email from the git hooks/post-receive script.
o m e g a p h i l p u s h e d a c o m m i t t o b r a n c h m a s t e r
in repository panel-plugins/xfce4-hardware-monitor-plugin.
commit 929b6fa7cef5ad202f884df8809ed22000432602
Author: OmegaPhil <OmegaPhil at startmail.com>
Date: Fri Nov 24 14:19:02 2017 +0000
Fix CurveView to respect monitor fixed maxes when querying data max values
---
src/curve-view.cpp | 16 +++++++++++++---
1 file changed, 13 insertions(+), 3 deletions(-)
diff --git a/src/curve-view.cpp b/src/curve-view.cpp
index 4afa4a5..296d879 100644
--- a/src/curve-view.cpp
+++ b/src/curve-view.cpp
@@ -266,7 +266,7 @@ void CurveView::do_detach(Monitor *monitor)
void CurveView::do_draw_loop()
{
- double max = 0;
+ double max = 0, tmp_max = 0;
Glib::ustring max_formatted, max_formatted_compact, monitor_data,
monitor_data_compact, text_overlay_format_string, tag_string,
separator_string = plugin->get_viewer_text_overlay_separator();
@@ -274,10 +274,20 @@ void CurveView::do_draw_loop()
monitor_data_needed = false, monitor_data_compact_needed = false,
text_overlay_enabled = plugin->get_viewer_text_overlay_enabled();
- // Obtain maximum value of all curves in the view
+ /* Obtain maximum value of all curves in the view, respecting individual
+ * curve/monitor's fixed maxes if present */
for (curve_iterator i = curves.begin(), end = curves.end(); i != end; ++i)
- if ((*i)->get_max_value() > max)
+ {
+ if ((*i)->monitor->fixed_max())
+ {
+ tmp_max = ((*i)->get_max_value() < (*i)->monitor->fixed_max()) ?
+ (*i)->get_max_value() : (*i)->monitor->fixed_max();
+ if (tmp_max > max)
+ max = tmp_max;
+ }
+ else if ((*i)->get_max_value() > max)
max = (*i)->get_max_value();
+ }
// If the text overlay is enabled, detecting all information required to output
if (text_overlay_enabled)
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Xfce4-commits
mailing list