mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-16 06:07:06 +02:00
Show selected sublist as active in list.
This commit is contained in:
parent
175914f02b
commit
c51a8816eb
4 changed files with 15 additions and 2 deletions
|
@ -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;
|
||||
|
|
|
@ -259,7 +259,7 @@ not_null<Data::SavedSublist*> SublistWidget::sublist() const {
|
|||
|
||||
Dialogs::RowDescriptor SublistWidget::activeChat() const {
|
||||
return {
|
||||
_history,
|
||||
_sublist,
|
||||
FullMsgId(_history->peer->id, ShowAtUnreadMsgId)
|
||||
};
|
||||
}
|
||||
|
|
|
@ -2446,6 +2446,10 @@ auto MainWidget::thirdSectionForCurrentMainSection(
|
|||
return std::make_shared<Info::Memento>(
|
||||
peer,
|
||||
Info::Memento::DefaultSection(peer));
|
||||
} else if (const auto sublist = key.sublist()) {
|
||||
return std::make_shared<Info::Memento>(
|
||||
session().user(),
|
||||
Info::Memento::DefaultSection(session().user()));
|
||||
}
|
||||
Unexpected("Key in MainWidget::thirdSectionForCurrentMainSection().");
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue