Skip to content

Commit 0dff8a4

Browse files
Revert "Fix calculator equals and clarify missing weather"
1 parent 15fd085 commit 0dff8a4

2 files changed

Lines changed: 7 additions & 15 deletions

File tree

‎src/displayapp/screens/Calculator.cpp‎

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -59,13 +59,6 @@ void Calculator::OnButtonEvent(lv_obj_t* obj, lv_event_t event) {
5959
}
6060

6161
void Calculator::HandleInput() {
62-
// A press between or outside the buttons leaves LVGL's "active" button on the previous key,
63-
// which would replay it. Only accept presses that actually landed on a button.
64-
const auto* ext = static_cast<lv_btnmatrix_ext_t*>(lv_obj_get_ext_attr(buttonMatrix));
65-
if (ext->btn_id_pr == LV_BTNMATRIX_BTN_NONE) {
66-
return;
67-
}
68-
6962
const char* buttonText = lv_btnmatrix_get_active_btn_text(buttonMatrix);
7063

7164
if (buttonText == nullptr) {
@@ -195,15 +188,14 @@ void Calculator::HandleInput() {
195188
break;
196189

197190
case '=':
191+
equalSignPressedBefore = true;
198192
Eval();
199-
if (error == Error::None) {
200-
// Show the answer on the main line, like a regular calculator.
201-
// The next digit starts a new number, the next operator keeps working on the answer.
202-
value = result;
203-
operation = ' ';
204-
UpdateOperation();
193+
// If the operation is ' ' then we move the value to the result.
194+
// We reset the input after this.
195+
// This seems more convenient.
196+
if (operation == ' ') {
197+
ResetInput();
205198
}
206-
equalSignPressedBefore = true;
207199
break;
208200
}
209201

‎src/displayapp/screens/WatchFaceNetRunner.cpp‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ void WatchFaceNetRunner::Refresh() {
296296
}
297297
lv_label_set_text_fmt(labelEnv, "#9d4edd ENV# %d°%c %s", temp, tempUnit, Symbols::GetSimpleCondition(optCurrentWeather->iconId));
298298
} else {
299-
lv_label_set_text_static(labelEnv, "#9d4edd ENV# NO WEATHER");
299+
lv_label_set_text_static(labelEnv, "#9d4edd ENV# NO SIGNAL");
300300
}
301301
}
302302
}

0 commit comments

Comments
 (0)