[Horus] UI continued

This commit is contained in:
Bertrand Songis
2016-02-15 21:28:31 +01:00
parent c07e965542
commit 79a5f65a2c
24 changed files with 343 additions and 240 deletions
+5 -5
View File
@@ -67,13 +67,13 @@ void GaugeWidget::refresh()
int percent = divRoundClosest(100 * (value_in_range - min), (max - min));
// Gauge label
putsMixerSource(zone.x, zone.y + 5, index, SMLSIZE | TEXT_INVERTED_COLOR);
putsMixerSource(zone.x, zone.y, index, SMLSIZE | TEXT_INVERTED_COLOR);
// Gauge
lcdSetColor(color);
lcdDrawSolidFilledRect(zone.x, zone.y + 20, zone.w, 16, TEXT_INVERTED_COLOR);
lcdDrawNumber(zone.x+zone.w/2+20, zone.y + 21, percent, SMLSIZE | CUSTOM_COLOR, 0, NULL, "%");
lcdInvertRect(zone.x + w, zone.y + 20, zone.w - w, 16, CUSTOM_COLOR);
lcdDrawSolidFilledRect(zone.x, zone.y + 15, zone.w, 16, TEXT_INVERTED_COLOR);
lcdDrawNumber((percent >= 100 ? 20 : (percent >= 10 ? 10 : 0)) + zone.x+zone.w/2, zone.y + 16, percent, SMLSIZE | CUSTOM_COLOR, 0, NULL, "%");
lcdInvertRect(zone.x + w, zone.y + 15, zone.w - w, 16, CUSTOM_COLOR);
}
BaseWidgetFactory<GaugeWidget> gaugeWidget("Gauge", "", GaugeWidget::options);
BaseWidgetFactory<GaugeWidget> gaugeWidget("Gauge", "", GaugeWidget::options);