mirror of
https://github.com/MarekZegare4/MeshCore-Solo.git
synced 2026-11-02 10:51:57 +00:00
refactor: one place each for "in view" and the keyboard's backspace
ui-new's messagesInView() and ui-lvgl's threadInView() hold the lit-and-unlocked test the viewing checks repeated; the keyboard's three copies of the backspace call deleteBeforeCursor(). A stale comment on the cursor-mode hint goes, onDisplayOn() sits after the view helpers it calls. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1914,12 +1914,16 @@ void UITask::onMessageArrived(const UiEvent& ev) {
|
||||
}
|
||||
|
||||
// On screen: a conversation left open under the lock or a dark display isn't read.
|
||||
bool UITask::threadInView() const {
|
||||
return !_asleep && !locked() && _screen == SCR_THREAD;
|
||||
}
|
||||
|
||||
bool UITask::isViewingChannel(uint8_t channel_idx) {
|
||||
return !_asleep && !locked() && _screen == SCR_THREAD && _thread_is_channel && _thread_channel == channel_idx;
|
||||
return threadInView() && _thread_is_channel && _thread_channel == channel_idx;
|
||||
}
|
||||
|
||||
bool UITask::isViewingDM(const uint8_t* pub_key) {
|
||||
return !_asleep && !locked() && _screen == SCR_THREAD && !_thread_is_channel && memcmp(_thread_key, pub_key, 4) == 0;
|
||||
return threadInView() && !_thread_is_channel && memcmp(_thread_key, pub_key, 4) == 0;
|
||||
}
|
||||
|
||||
// ── Status bar + toast (top layer, over every screen) ─────────────────────────
|
||||
|
||||
@@ -430,6 +430,7 @@ private:
|
||||
void buildThread();
|
||||
void threadOpenAt(int first);
|
||||
void reopenThreadIfUnread();
|
||||
bool threadInView() const; // a thread on a lit, unlocked screen
|
||||
void refreshThread();
|
||||
void refreshThreadAges();
|
||||
uint32_t threadSignature() const;
|
||||
|
||||
Reference in New Issue
Block a user