Improve naming in dialogs_layout module.

This commit is contained in:
John Preston 2022-01-31 16:17:34 +03:00
parent 8ef7325e16
commit 98e7de01b0

View file

@ -90,7 +90,7 @@ void PaintNarrowCounter(
bool selected, bool selected,
bool active, bool active,
bool unreadMuted, bool unreadMuted,
bool mentionMuted) { bool mentionOrReactionMuted) {
auto skipBeforeMention = 0; auto skipBeforeMention = 0;
if (displayUnreadCounter || displayUnreadMark) { if (displayUnreadCounter || displayUnreadMark) {
const auto counter = (unreadCount > 0) const auto counter = (unreadCount > 0)
@ -131,7 +131,7 @@ void PaintNarrowCounter(
UnreadBadgeStyle st; UnreadBadgeStyle st;
st.active = active; st.active = active;
st.selected = selected; st.selected = selected;
st.muted = mentionMuted; st.muted = mentionOrReactionMuted;
st.padding = 0; st.padding = 0;
st.textTop = 0; st.textTop = 0;
const auto badge = PaintUnreadBadge( const auto badge = PaintUnreadBadge(
@ -168,7 +168,7 @@ int PaintWideCounter(
bool active, bool active,
bool selected, bool selected,
bool unreadMuted, bool unreadMuted,
bool mentionMuted) { bool mentionOrReactionMuted) {
const auto initial = availableWidth; const auto initial = availableWidth;
auto hadOneBadge = false; auto hadOneBadge = false;
if (displayUnreadCounter || displayUnreadMark) { if (displayUnreadCounter || displayUnreadMark) {
@ -223,7 +223,7 @@ int PaintWideCounter(
UnreadBadgeStyle st; UnreadBadgeStyle st;
st.active = active; st.active = active;
st.selected = selected; st.selected = selected;
st.muted = mentionMuted; st.muted = mentionOrReactionMuted;
st.padding = 0; st.padding = 0;
st.textTop = 0; st.textTop = 0;
const auto badge = PaintUnreadBadge( const auto badge = PaintUnreadBadge(
@ -769,7 +769,7 @@ void RowPainter::paint(
const auto unreadCount = entry->chatListUnreadCount(); const auto unreadCount = entry->chatListUnreadCount();
const auto unreadMark = entry->chatListUnreadMark(); const auto unreadMark = entry->chatListUnreadMark();
const auto unreadMuted = entry->chatListMutedBadge(); const auto unreadMuted = entry->chatListMutedBadge();
const auto mentionMuted = (entry->folder() != nullptr); const auto mentionOrReactionMuted = (entry->folder() != nullptr);
const auto item = entry->chatListMessage(); const auto item = entry->chatListMessage();
const auto cloudDraft = [&]() -> const Data::Draft*{ const auto cloudDraft = [&]() -> const Data::Draft*{
if (history && (!item || (!unreadCount && !unreadMark))) { if (history && (!item || (!unreadCount && !unreadMark))) {
@ -850,7 +850,7 @@ void RowPainter::paint(
active, active,
selected, selected,
unreadMuted, unreadMuted,
mentionMuted); mentionOrReactionMuted);
const auto &color = active const auto &color = active
? st::dialogsTextFgServiceActive ? st::dialogsTextFgServiceActive
: (selected : (selected
@ -894,7 +894,7 @@ void RowPainter::paint(
selected, selected,
active, active,
unreadMuted, unreadMuted,
mentionMuted); mentionOrReactionMuted);
}; };
paintRow( paintRow(
p, p,
@ -962,7 +962,7 @@ void RowPainter::paint(
const auto unreadMark = displayUnreadInfo const auto unreadMark = displayUnreadInfo
&& history->chatListUnreadMark(); && history->chatListUnreadMark();
const auto unreadMuted = history->chatListMutedBadge(); const auto unreadMuted = history->chatListMutedBadge();
const auto mentionMuted = (history->folder() != nullptr); const auto mentionOrReactionMuted = (history->folder() != nullptr);
const auto displayMentionBadge = displayUnreadInfo const auto displayMentionBadge = displayUnreadInfo
&& history->unreadMentions().has(); && history->unreadMentions().has();
const auto displayReactionBadge = displayUnreadInfo const auto displayReactionBadge = displayUnreadInfo
@ -992,7 +992,7 @@ void RowPainter::paint(
active, active,
selected, selected,
unreadMuted, unreadMuted,
mentionMuted); mentionOrReactionMuted);
const auto itemRect = QRect( const auto itemRect = QRect(
nameleft, nameleft,
@ -1018,7 +1018,7 @@ void RowPainter::paint(
selected, selected,
active, active,
unreadMuted, unreadMuted,
mentionMuted); mentionOrReactionMuted);
}; };
const auto showSavedMessages = history->peer->isSelf() const auto showSavedMessages = history->peer->isSelf()
&& !row->searchInChat(); && !row->searchInChat();