2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-09-03 08:05:12 +00:00

Add "Open in new window" to context menu.

This commit is contained in:
John Preston
2023-02-03 19:32:25 +04:00
parent 94b489835c
commit bbd937115c
18 changed files with 92 additions and 48 deletions

View File

@@ -484,24 +484,8 @@ void Widget::chosenRow(const ChosenRow &row) {
const auto showAtMsgId = controller()->uniqueChatsInSearchResults()
? ShowAtUnreadMsgId
: row.message.fullId.msg;
if (row.newWindow && controller()->canShowSeparateWindow(peer)) {
const auto active = controller()->activeChatCurrent();
const auto fromActive = active.history()
? (active.history()->peer == peer)
: false;
const auto toSeparate = [=] {
Core::App().ensureSeparateWindowForPeer(
peer,
showAtMsgId);
};
if (fromActive) {
controller()->window().preventOrInvoke([=] {
controller()->clearSectionStack();
toSeparate();
});
} else {
toSeparate();
}
if (row.newWindow) {
controller()->showInNewWindow(peer, showAtMsgId);
} else {
controller()->showThread(
history,