mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2026-07-25 06:54:43 +00:00
Added ability to drag dialogs to search field.
This commit is contained in:
@@ -27,6 +27,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
#include "history/view/history_view_requests_bar.h"
|
||||
#include "history/view/history_view_top_bar_widget.h"
|
||||
#include "boxes/peers/edit_peer_requests_box.h"
|
||||
#include "boxes/choose_filter_box.h"
|
||||
#include "ui/text/text_utilities.h"
|
||||
#include "ui/widgets/buttons.h"
|
||||
#include "ui/widgets/chat_filters_tabs_strip.h"
|
||||
@@ -550,6 +551,20 @@ Widget::Widget(
|
||||
_search->submits(
|
||||
) | rpl::on_next([=] { submit(); }, _search->lifetime());
|
||||
|
||||
_search->setMimeDataHook([=](
|
||||
not_null<const QMimeData*> data,
|
||||
Ui::InputField::MimeAction action) {
|
||||
if (data->hasFormat(u"application/x-telegram-dialog"_q)) {
|
||||
if (const auto history = HistoryFromMimeData(data, &session())) {
|
||||
if (action != Ui::InputField::MimeAction::Check) {
|
||||
controller->searchInChat(history);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
});
|
||||
|
||||
QObject::connect(
|
||||
_search->rawTextEdit().get(),
|
||||
&QTextEdit::cursorPositionChanged,
|
||||
|
||||
Reference in New Issue
Block a user