mirror of
https://github.com/Qz3rK/tdesktop.git
synced 2026-07-03 14:15:08 +02:00
Highlight word from search query.
This commit is contained in:
@@ -696,16 +696,19 @@ void Widget::chosenRow(const ChosenRow &row) {
|
||||
}
|
||||
return;
|
||||
} else if (const auto topic = row.key.topic()) {
|
||||
auto params = Window::SectionShow(
|
||||
Window::SectionShow::Way::ClearStack);
|
||||
params.highlightPart.text = _searchState.query;
|
||||
if (!params.highlightPart.empty()) {
|
||||
params.highlightPartOffsetHint = kSearchQueryOffsetHint;
|
||||
}
|
||||
if (row.newWindow) {
|
||||
controller()->showInNewWindow(
|
||||
Window::SeparateId(topic),
|
||||
row.message.fullId.msg);
|
||||
} else {
|
||||
session().data().saveViewAsMessages(topic->forum(), false);
|
||||
controller()->showThread(
|
||||
topic,
|
||||
row.message.fullId.msg,
|
||||
Window::SectionShow::Way::ClearStack);
|
||||
controller()->showThread(topic, row.message.fullId.msg, params);
|
||||
}
|
||||
} else if (history
|
||||
&& row.userpicClick
|
||||
@@ -742,13 +745,16 @@ void Widget::chosenRow(const ChosenRow &row) {
|
||||
const auto showAtMsgId = controller()->uniqueChatsInSearchResults()
|
||||
? ShowAtUnreadMsgId
|
||||
: row.message.fullId.msg;
|
||||
auto params = Window::SectionShow(
|
||||
Window::SectionShow::Way::ClearStack);
|
||||
params.highlightPart.text = _searchState.query;
|
||||
if (!params.highlightPart.empty()) {
|
||||
params.highlightPartOffsetHint = kSearchQueryOffsetHint;
|
||||
}
|
||||
if (row.newWindow) {
|
||||
controller()->showInNewWindow(peer, showAtMsgId);
|
||||
} else {
|
||||
controller()->showThread(
|
||||
history,
|
||||
showAtMsgId,
|
||||
Window::SectionShow::Way::ClearStack);
|
||||
controller()->showThread(history, showAtMsgId, params);
|
||||
hideChildList();
|
||||
}
|
||||
} else if (const auto folder = row.key.folder()) {
|
||||
|
||||
Reference in New Issue
Block a user