2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 14:38:15 +00:00

Enter selects from-row in reply-in-another-chat.

This commit is contained in:
John Preston
2024-12-05 15:52:48 +04:00
parent 0045eb4598
commit d157eb0b6e
3 changed files with 33 additions and 4 deletions

View File

@@ -474,7 +474,7 @@ void PeerListBox::addSelectItem(
void PeerListBox::addSelectItem(
uint64 itemId,
const QString &text,
Ui::MultiSelect::PaintRoundImage paintUserpic,
PaintRoundImageCallback paintUserpic,
anim::type animated) {
if (!_select) {
createMultiSelect();
@@ -549,6 +549,10 @@ rpl::producer<int> PeerListBox::multiSelectHeightValue() const {
return _select ? _select->heightValue() : rpl::single(0);
}
rpl::producer<> PeerListBox::noSearchSubmits() const {
return content()->noSearchSubmits();
}
PeerListRow::PeerListRow(not_null<PeerData*> peer)
: PeerListRow(peer, peer->id.value) {
}
@@ -2189,6 +2193,9 @@ bool PeerListContent::submitted() {
_controller->rowClicked(row);
return true;
}
} else {
_noSearchSubmits.fire({});
return true;
}
return false;
}

View File

@@ -712,7 +712,7 @@ public:
update();
}
std::unique_ptr<PeerListState> saveState() const;
[[nodiscard]] std::unique_ptr<PeerListState> saveState() const;
void restoreState(std::unique_ptr<PeerListState> state);
void showRowMenu(
@@ -720,10 +720,14 @@ public:
bool highlightRow,
Fn<void(not_null<Ui::PopupMenu*>)> destroyed);
auto scrollToRequests() const {
[[nodiscard]] auto scrollToRequests() const {
return _scrollToRequests.events();
}
[[nodiscard]] auto noSearchSubmits() const {
return _noSearchSubmits.events();
}
~PeerListContent();
protected:
@@ -890,6 +894,8 @@ private:
object_ptr<Ui::FlatLabel> _searchLoading = { nullptr };
object_ptr<Ui::RpWidget> _loadingAnimation = { nullptr };
rpl::event_stream<> _noSearchSubmits;
std::vector<std::unique_ptr<PeerListRow>> _searchRows;
base::Timer _repaintByStatus;
base::unique_qptr<Ui::PopupMenu> _contextMenu;
@@ -1106,6 +1112,7 @@ public:
[[nodiscard]] std::vector<PeerListRowId> collectSelectedIds();
[[nodiscard]] std::vector<not_null<PeerData*>> collectSelectedRows();
[[nodiscard]] rpl::producer<int> multiSelectHeightValue() const;
[[nodiscard]] rpl::producer<> noSearchSubmits() const;
void peerListSetTitle(rpl::producer<QString> title) override {
setTitle(std::move(title));