Update draw_homescreen_simplified (128x32)

Drawer rework, should look ok but testing is required
This commit is contained in:
Leo
2025-01-28 16:32:20 +02:00
parent b469179058
commit ce86d6594d

View File

@@ -7,56 +7,35 @@ extern uint8_t buttonBF[sizeof(buttonB)];
extern uint8_t disconnectedTipF[sizeof(disconnectedTip)]; extern uint8_t disconnectedTipF[sizeof(disconnectedTip)];
void ui_draw_homescreen_simplified(TemperatureType_t tipTemp) { void ui_draw_homescreen_simplified(TemperatureType_t tipTemp) {
bool tempOnDisplay = false; bool tipDisconnected = isTipDisconnected();
bool tipDisconnectedDisplay = false; bool isFlipped = OLED::getRotation();
if (OLED::getRotation()) { bool isReverse = getSettingValue(SettingsOptions::ReverseButtonNavEnabled);
OLED::drawArea(68, 0, 56, 32, buttonAF); // Flip and switch buttons accordingly
OLED::drawArea(12, 0, 56, 32, buttonBF); OLED::drawArea(isFlipped ? 68 : 0, 0, 56, 32, isFlipped ? (isReverse ? buttonBF : buttonAF) : (isReverse ? buttonB : buttonA));
OLED::setCursor(0, 0); OLED::drawArea(isFlipped ? 12 : 58, 0, 56, 32, isFlipped ? (isReverse ? buttonAF : buttonBF) : (isReverse ? buttonA : buttonB));
ui_draw_power_source_icon();
} else { if ((tipTemp > 55) || tipDisconnected) {
OLED::drawArea(0, 0, 56, 32, buttonA); // Needs to be flipped so button ends up // draw temp over the start soldering button
OLED::drawArea(58, 0, 56, 32, buttonB); // on right side of screen // Location changes on screen rotation
OLED::setCursor(116, 0); // in right handed mode we want to draw over the first part
ui_draw_power_source_icon(); OLED::fillArea(isReverse ? (isFlipped ? 26 : 58) : (isFlipped ? 68 : 0), 0, 56, 32, 0); // clear the area
} OLED::setCursor(isReverse ? (isFlipped ? 27 : 59) : (isFlipped ? 56 : 0), 0);
tipDisconnectedDisplay = false; // If tip is connected draw the temp, otherwise - the notification
if (tipTemp > 55) { if (tipDisconnected) {
tempOnDisplay = true; // Draw-in the missing tip symbol
} else if (tipTemp < 45) { if (isReverse) {
tempOnDisplay = false; OLED::drawArea(isFlipped ? 20 : 54, 0, 56, 32, isFlipped ? disconnectedTipF : disconnectedTip);
} } else {
if (isTipDisconnected()) { OLED::drawArea(isFlipped ? 54 : 0, 0, 56, 32, isFlipped ? disconnectedTipF : disconnectedTip);
tempOnDisplay = false; }// Draw-in the temp
tipDisconnectedDisplay = true;
}
if (tempOnDisplay || tipDisconnectedDisplay) { } else if (!(getSettingValue(SettingsOptions::CoolingTempBlink) && (xTaskGetTickCount() % 1000 < 300))) {
// draw temp over the start soldering button ui_draw_tip_temperature(false, FontStyle::LARGE); // Draw-in the temp
// Location changes on screen rotation }
if (OLED::getRotation()) { }
// in right handed mode we want to draw over the first part OLED::setCursor(isFlipped ? 0 : 116, 0);
OLED::fillArea(68, 0, 56, 32, 0); // clear the area for the temp ui_draw_power_source_icon();
OLED::setCursor(56, 0);
} else {
OLED::fillArea(0, 0, 56, 32, 0); // clear the area
OLED::setCursor(0, 0);
}
// If we have a tip connected draw the temp, if not we leave it blank
if (!tipDisconnectedDisplay) {
// draw in the temp
if (!(getSettingValue(SettingsOptions::CoolingTempBlink) && (xTaskGetTickCount() % 1000 < 300))) {
ui_draw_tip_temperature(false, FontStyle::LARGE); // draw in the temp
}
} else {
// Draw in missing tip symbol
if (OLED::getRotation()) {
// in right handed mode we want to draw over the first part
OLED::drawArea(54, 0, 56, 32, disconnectedTipF);
} else {
OLED::drawArea(0, 0, 56, 32, disconnectedTip);
}
}
}
} }
#endif #endif