mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-23 23:45:35 +08:00
Text message view, scroll down if sorted by timestamp
This commit is contained in:
committed by
Mat Sutcliffe
parent
a1ea9a2e10
commit
9dc85da42d
@@ -186,6 +186,7 @@ namespace BlackGui
|
||||
const bool playNotification = sGui && sGui->getIContextAudio();
|
||||
const bool audioCsMentioned = playNotification && m_audioSettings.get().textCallsignMentioned();
|
||||
|
||||
bool addedToAllMessages = false;
|
||||
for (const CTextMessage &message : messages)
|
||||
{
|
||||
bool relevantForMe = false;
|
||||
@@ -246,6 +247,7 @@ namespace BlackGui
|
||||
{
|
||||
ui->tvp_TextMessagesAll->push_back(message); // no sorting
|
||||
ui->tvp_TextMessagesAll->resort();
|
||||
addedToAllMessages = true;
|
||||
}
|
||||
if (!relevantForMe) { continue; }
|
||||
|
||||
@@ -262,6 +264,11 @@ namespace BlackGui
|
||||
}
|
||||
} // message
|
||||
} // for
|
||||
|
||||
if (addedToAllMessages && ui->tvp_TextMessagesAll->isSortedByTimestampPropertyLatestLast())
|
||||
{
|
||||
ui->tvp_TextMessagesAll->scrollToBottom();
|
||||
}
|
||||
}
|
||||
|
||||
void CTextMessageComponent::onChangedAircraftCockpit(const CSimulatedAircraft &aircraft, const CIdentifier &originator)
|
||||
|
||||
Reference in New Issue
Block a user