mirror of
https://github.com/meshtastic/firmware.git
synced 2025-02-01 02:09:57 +00:00
No focus on new messages if auto-carousel is off (#5881)
* no focus on messages if screen carousel is disabled * trunk + comment * compacted the nested if using ternary operator * trunk
This commit is contained in:
parent
c1beb44678
commit
0f981153eb
@ -2662,14 +2662,13 @@ int Screen::handleStatusUpdate(const meshtastic::Status *arg)
|
|||||||
|
|
||||||
int Screen::handleTextMessage(const meshtastic_MeshPacket *packet)
|
int Screen::handleTextMessage(const meshtastic_MeshPacket *packet)
|
||||||
{
|
{
|
||||||
if (showingNormalScreen) {
|
// If auto carousel is disabled -> return 0 and skip new messages handling
|
||||||
// Outgoing message
|
if (config.display.auto_screen_carousel_secs == 0)
|
||||||
if (packet->from == 0)
|
return 0;
|
||||||
setFrames(FOCUS_PRESERVE); // Return to same frame (quietly hiding the rx text message frame)
|
|
||||||
|
|
||||||
// Incoming message
|
// Handle focus change based on message type
|
||||||
else
|
if (showingNormalScreen) {
|
||||||
setFrames(FOCUS_TEXTMESSAGE); // Focus on the new message
|
setFrames(packet->from == 0 ? FOCUS_PRESERVE : FOCUS_TEXTMESSAGE);
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
@ -2756,4 +2755,4 @@ int Screen::handleAdminMessage(const meshtastic_AdminMessage *arg)
|
|||||||
} // namespace graphics
|
} // namespace graphics
|
||||||
#else
|
#else
|
||||||
graphics::Screen::Screen(ScanI2C::DeviceAddress, meshtastic_Config_DisplayConfig_OledType, OLEDDISPLAY_GEOMETRY) {}
|
graphics::Screen::Screen(ScanI2C::DeviceAddress, meshtastic_Config_DisplayConfig_OledType, OLEDDISPLAY_GEOMETRY) {}
|
||||||
#endif // HAS_SCREEN
|
#endif // HAS_SCREEN
|
Loading…
Reference in New Issue
Block a user