mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +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 selected,
|
||||||
bool mayBeActive) {
|
bool mayBeActive) {
|
||||||
const auto key = row->key();
|
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();
|
const auto forum = key.history() && key.history()->isForum();
|
||||||
if (forum && !_topicJumpCache) {
|
if (forum && !_topicJumpCache) {
|
||||||
_topicJumpCache = std::make_unique<Ui::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(
|
bool InnerWidget::isSearchResultActive(
|
||||||
not_null<FakeRow*> result,
|
not_null<FakeRow*> result,
|
||||||
const RowDescriptor &entry) const {
|
const RowDescriptor &entry) const {
|
||||||
|
|
|
@ -231,6 +231,7 @@ private:
|
||||||
void switchToFilter(FilterId filterId);
|
void switchToFilter(FilterId filterId);
|
||||||
bool chooseHashtag();
|
bool chooseHashtag();
|
||||||
ChosenRow computeChosenRow() const;
|
ChosenRow computeChosenRow() const;
|
||||||
|
bool isRowActive(not_null<Row*> row, const RowDescriptor &entry) const;
|
||||||
bool isSearchResultActive(
|
bool isSearchResultActive(
|
||||||
not_null<FakeRow*> result,
|
not_null<FakeRow*> result,
|
||||||
const RowDescriptor &entry) const;
|
const RowDescriptor &entry) const;
|
||||||
|
|
|
@ -259,7 +259,7 @@ not_null<Data::SavedSublist*> SublistWidget::sublist() const {
|
||||||
|
|
||||||
Dialogs::RowDescriptor SublistWidget::activeChat() const {
|
Dialogs::RowDescriptor SublistWidget::activeChat() const {
|
||||||
return {
|
return {
|
||||||
_history,
|
_sublist,
|
||||||
FullMsgId(_history->peer->id, ShowAtUnreadMsgId)
|
FullMsgId(_history->peer->id, ShowAtUnreadMsgId)
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -2446,6 +2446,10 @@ auto MainWidget::thirdSectionForCurrentMainSection(
|
||||||
return std::make_shared<Info::Memento>(
|
return std::make_shared<Info::Memento>(
|
||||||
peer,
|
peer,
|
||||||
Info::Memento::DefaultSection(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().");
|
Unexpected("Key in MainWidget::thirdSectionForCurrentMainSection().");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue