[Horus] Gauge percent was not vertically centered

This commit is contained in:
Bertrand Songis
2020-06-01 16:02:20 +02:00
parent feb556cad5
commit 36839dd417
7 changed files with 9 additions and 9 deletions
+3 -3
View File
@@ -28,7 +28,7 @@ class GaugeWidget: public Widget
{ {
} }
virtual void refresh(); void refresh() override;
static const ZoneOption options[]; static const ZoneOption options[];
}; };
@@ -38,7 +38,7 @@ const ZoneOption GaugeWidget::options[] = {
{ STR_MIN, ZoneOption::Integer, OPTION_VALUE_SIGNED(-RESX), OPTION_VALUE_SIGNED(-RESX), OPTION_VALUE_SIGNED(RESX) }, { STR_MIN, ZoneOption::Integer, OPTION_VALUE_SIGNED(-RESX), OPTION_VALUE_SIGNED(-RESX), OPTION_VALUE_SIGNED(RESX) },
{ STR_MAX, ZoneOption::Integer, OPTION_VALUE_SIGNED(RESX), OPTION_VALUE_SIGNED(-RESX), OPTION_VALUE_SIGNED(RESX) }, { STR_MAX, ZoneOption::Integer, OPTION_VALUE_SIGNED(RESX), OPTION_VALUE_SIGNED(-RESX), OPTION_VALUE_SIGNED(RESX) },
{ STR_COLOR, ZoneOption::Color, OPTION_VALUE_UNSIGNED(RED) }, { STR_COLOR, ZoneOption::Color, OPTION_VALUE_UNSIGNED(RED) },
{ NULL, ZoneOption::Bool } { nullptr, ZoneOption::Bool }
}; };
void GaugeWidget::refresh() void GaugeWidget::refresh()
@@ -64,7 +64,7 @@ void GaugeWidget::refresh()
// Gauge // Gauge
lcdSetColor(color); lcdSetColor(color);
lcdDrawSolidFilledRect(zone.x, zone.y + 16, zone.w, 16, TEXT_INVERTED_COLOR); lcdDrawSolidFilledRect(zone.x, zone.y + 16, zone.w, 16, TEXT_INVERTED_COLOR);
lcdDrawNumber(zone.x+zone.w/2, zone.y + 17, percent, SMLSIZE | CUSTOM_COLOR | CENTERED, 0, NULL, "%"); lcdDrawNumber(zone.x + zone.w/2, zone.y + 16, percent, SMLSIZE | CUSTOM_COLOR | CENTERED, 0, nullptr, "%");
lcd->invertRect(zone.x + w, zone.y + 16, zone.w - w, 16, CUSTOM_COLOR); lcd->invertRect(zone.x + w, zone.y + 16, zone.w - w, 16, CUSTOM_COLOR);
} }
+1 -1
View File
@@ -63,7 +63,7 @@ class ModelBitmapWidget: public Widget
} }
} }
virtual void refresh() void refresh() override
{ {
uint32_t new_hash = hash(g_model.header.bitmap, sizeof(g_model.header.bitmap)); uint32_t new_hash = hash(g_model.header.bitmap, sizeof(g_model.header.bitmap));
new_hash ^= hash(g_model.header.name, sizeof(g_model.header.name)); new_hash ^= hash(g_model.header.name, sizeof(g_model.header.name));
+1 -1
View File
@@ -33,7 +33,7 @@ class OutputsWidget: public Widget
{ {
} }
virtual void refresh(); void refresh() override;
uint8_t drawChannels(const uint16_t & x, const uint16_t & y, const uint16_t & w, const uint16_t & h, const uint8_t & firstChan, const bool & bg_shown, const uint16_t & bg_color) uint8_t drawChannels(const uint16_t & x, const uint16_t & y, const uint16_t & w, const uint16_t & h, const uint8_t & firstChan, const bool & bg_shown, const uint16_t & bg_color)
{ {
+1 -1
View File
@@ -30,7 +30,7 @@ class TextWidget: public Widget
{ {
} }
virtual void refresh(); void refresh() override;
static const ZoneOption options[]; static const ZoneOption options[];
}; };
+1 -1
View File
@@ -28,7 +28,7 @@ class TimerWidget: public Widget
{ {
} }
virtual void refresh(); void refresh() override;
static const ZoneOption options[]; static const ZoneOption options[];
}; };
+1 -1
View File
@@ -28,7 +28,7 @@ class ValueWidget: public Widget
{ {
} }
virtual void refresh(); void refresh() override;
static const ZoneOption options[]; static const ZoneOption options[];
}; };
+1 -1
View File
@@ -265,7 +265,7 @@ class LuaWidget: public Widget
virtual void update(); virtual void update();
virtual void refresh(); void refresh() override;
virtual void background(); virtual void background();