Repository navigation
Screen set frames update #4043
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Screen set frames update #4043
Changes from 4 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
4409057
Updated setFrames in Screen.cpp
slash-bit 38a9f33
Space added Screen.cpp
slash-bit cbd49ed
Update Screen.cpp
slash-bit f4a88c2
Update Screen.cpp
slash-bit 3f3db83
Hold position, even if number of frames increases
todd-herbert 64d8cdf
Hold position, if handling an outgoing text message
todd-herbert da32505
Merge branch 'master' into screen-setFrames-update
thebentern 3b2febb
Merge pull request #1 from todd-herbert/screen-setFrames-update
slash-bit de6e8a1
Update Screen.cpp
slash-bit 1243987
Reverted chnages related to devicestate.has_rx_text_message
slash-bit File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2054,9 +2054,11 @@ void Screen::setScreensaverFrames(FrameCallback einkScreensaver) | |
| #endif | ||
|
|
||
| // restore our regular frame list | ||
| void Screen::setFrames() | ||
| void Screen::setFrames(bool holdPosition = false) | ||
| { | ||
| LOG_DEBUG("showing standard frames\n"); | ||
| uint8_t currentFrameNum = ui->getUiState()->currentFrame; | ||
| LOG_DEBUG("Showing standard frame number %d\n", currentFrameNum); | ||
|
|
||
| showingNormalScreen = true; | ||
|
|
||
| #ifdef USE_EINK | ||
|
|
@@ -2147,7 +2149,14 @@ void Screen::setFrames() | |
| // just changed) | ||
|
|
||
| setFastFramerate(); // Draw ASAP | ||
| } | ||
|
|
||
| if (holdPosition) { | ||
| ui->switchToFrame(currentFrameNum); // Attempt to return to same frame after rebuilding the frames, | ||
| // if holdPosition is true (currently only Screen::handleStatusUpdate calls this | ||
| } else { | ||
| continue; // We leave the displayed frame as it is or chnage focuse to new frame | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I did have a bit of a play with this a few days ago, and I think there might be a sneaky issue here: if you're trying to stay on the "log buffer" frame, and the number of frames increases, |
||
| } | ||
| } | ||
|
|
||
| void Screen::handleStartBluetoothPinScreen(uint32_t pin) | ||
| { | ||
|
|
@@ -2646,7 +2655,7 @@ int Screen::handleStatusUpdate(const meshtastic::Status *arg) | |
| switch (arg->getStatusType()) { | ||
| case STATUS_TYPE_NODE: | ||
| if (showingNormalScreen && nodeStatus->getLastNumTotal() != nodeStatus->getNumTotal()) { | ||
| setFrames(); // Regen the list of screens | ||
| setFrames(true); // Regen the list of screens, will show the previously displayed frame | ||
| } | ||
| nodeDB->updateGUI = false; | ||
| break; | ||
|
|
@@ -2712,4 +2721,4 @@ int Screen::handleInputEvent(const InputEvent *event) | |
| } // namespace graphics | ||
| #else | ||
| graphics::Screen::Screen(ScanI2C::DeviceAddress, meshtastic_Config_DisplayConfig_OledType, OLEDDISPLAY_GEOMETRY) {} | ||
| #endif // HAS_SCREEN | ||
| #endif // HAS_SCREEN | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't forget the one declaration in Screen.h either!
(because of the order of Screen.cpp, I also think you'll want to set that
=falsedefault argument in Screen.h instead)