2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 06:26:18 +00:00

Show selected sublist as active in list.

This commit is contained in:
John Preston
2024-01-02 12:59:22 +04:00
parent 175914f02b
commit c51a8816eb
4 changed files with 15 additions and 2 deletions

View File

@@ -624,7 +624,7 @@ void InnerWidget::paintEvent(QPaintEvent *e) {
bool selected,
bool mayBeActive) {
const auto key = row->key();
const auto active = mayBeActive && (activeEntry.key == key);
const auto active = mayBeActive && isRowActive(row, activeEntry);
const auto forum = key.history() && key.history()->isForum();
if (forum && !_topicJumpCache) {
_topicJumpCache = std::make_unique<Ui::TopicJumpCache>();
@@ -977,6 +977,14 @@ void InnerWidget::paintCollapsedRow(
});
}
bool InnerWidget::isRowActive(
not_null<Row*> row,
const RowDescriptor &entry) const {
const auto key = row->key();
return (entry.key == key)
|| (entry.key.sublist() && key.peer() && key.peer()->isSelf());
}
bool InnerWidget::isSearchResultActive(
not_null<FakeRow*> result,
const RowDescriptor &entry) const {

View File

@@ -231,6 +231,7 @@ private:
void switchToFilter(FilterId filterId);
bool chooseHashtag();
ChosenRow computeChosenRow() const;
bool isRowActive(not_null<Row*> row, const RowDescriptor &entry) const;
bool isSearchResultActive(
not_null<FakeRow*> result,
const RowDescriptor &entry) const;