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:
@@ -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 {
|
||||
|
@@ -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;
|
||||
|
Reference in New Issue
Block a user