Richtext now supports more colors, fixed menudisplay selection box overdraw
This commit is contained in:
@ -7,7 +7,7 @@ void ChangeValueDisplayInterface::initScreen()
|
||||
|
||||
m_titleLabel.start();
|
||||
|
||||
tft.fillRect(0, 34, tft.width(), 3, TFT_WHITE);
|
||||
tft.fillRect(0, 33, tft.width(), 3, TFT_WHITE);
|
||||
|
||||
tft.drawRect(25, 75, 190, 65, TFT_WHITE);
|
||||
m_valueLabel.start();
|
||||
|
@ -18,7 +18,7 @@ void MenuDisplay::initScreen()
|
||||
tft.fillScreen(TFT_BLACK);
|
||||
|
||||
m_titleLabel.start();
|
||||
tft.fillRect(0, 34, tft.width(), 3, TFT_WHITE);
|
||||
tft.fillRect(0, 33, tft.width(), 3, TFT_WHITE);
|
||||
|
||||
for (auto &label : m_labels)
|
||||
label.start();
|
||||
@ -94,7 +94,7 @@ void MenuDisplay::redraw()
|
||||
tft.drawRect(5,
|
||||
label.y()-1,
|
||||
tft.width() - 10,
|
||||
lineHeight+2,
|
||||
lineHeight+1,
|
||||
color);
|
||||
};
|
||||
|
||||
|
@ -99,9 +99,9 @@ private:
|
||||
static constexpr size_t rowCount = CONFIG_ESPGUI_MENUDISPLAY_ROWS;
|
||||
static constexpr auto iconWidth = 25;
|
||||
static constexpr auto horizontalSpacing = 10;
|
||||
static constexpr auto topMargin = 40;
|
||||
static constexpr auto lineHeight = 25;
|
||||
static constexpr auto verticalSpacing = 4;
|
||||
static constexpr auto topMargin = 39;
|
||||
static constexpr auto lineHeight = 27;
|
||||
static constexpr auto verticalSpacing = 2;
|
||||
|
||||
std::array<Label, rowCount> m_labels {{
|
||||
#if CONFIG_ESPGUI_MENUDISPLAY_ROWS >= 1
|
||||
|
@ -28,7 +28,7 @@ int16_t renderRichText(std::string_view str, int32_t poX, int32_t poY, uint8_t f
|
||||
if (str.empty())
|
||||
return 0;
|
||||
|
||||
const auto oldColor = tft.textcolor;
|
||||
const uint16_t oldColor = tft.textcolor;
|
||||
|
||||
int16_t width{};
|
||||
|
||||
@ -53,13 +53,21 @@ again:
|
||||
case '0':
|
||||
case '1':
|
||||
case '2':
|
||||
case '3':
|
||||
case '4':
|
||||
case '5':
|
||||
case '6':
|
||||
{
|
||||
const auto color = [&controlChar](){
|
||||
const auto color = [&controlChar,&oldColor](){
|
||||
switch (controlChar)
|
||||
{
|
||||
case '0': return TFT_RED;
|
||||
case '1': return TFT_GREEN;
|
||||
case '2': return TFT_BLUE;
|
||||
case '0': return oldColor;
|
||||
case '1': return TFT_RED;
|
||||
case '2': return TFT_GREEN;
|
||||
case '3': return TFT_BLUE;
|
||||
case '4': return TFT_BLACK;
|
||||
case '5': return TFT_WHITE;
|
||||
case '6': return TFT_GREY;
|
||||
}
|
||||
__builtin_unreachable();
|
||||
}();
|
||||
|
Reference in New Issue
Block a user