mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-09-04 16:35:44 +00:00
Show small unread mark for non-opened topics.
This commit is contained in:
@@ -750,6 +750,7 @@ Dialogs::BadgesState ForumTopic::chatListBadgesState() const {
|
|||||||
if (!result.unread && _replies->inboxReadTillId() < 2) {
|
if (!result.unread && _replies->inboxReadTillId() < 2) {
|
||||||
result.unread = channel()->amIn()
|
result.unread = channel()->amIn()
|
||||||
&& (_lastKnownServerMessageId > history()->inboxReadTillId());
|
&& (_lastKnownServerMessageId > history()->inboxReadTillId());
|
||||||
|
result.unreadMuted = muted();
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
@@ -20,6 +20,7 @@ DialogRow {
|
|||||||
topicsSkip: pixels;
|
topicsSkip: pixels;
|
||||||
topicsSkipBig: pixels;
|
topicsSkipBig: pixels;
|
||||||
topicsHeight: pixels;
|
topicsHeight: pixels;
|
||||||
|
unreadMarkDiameter: pixels;
|
||||||
}
|
}
|
||||||
|
|
||||||
ForumTopicIcon {
|
ForumTopicIcon {
|
||||||
@@ -474,6 +475,7 @@ forumTopicRow: DialogRow(defaultDialogRow) {
|
|||||||
nameTop: 7px;
|
nameTop: 7px;
|
||||||
textLeft: 68px;
|
textLeft: 68px;
|
||||||
textTop: 29px;
|
textTop: 29px;
|
||||||
|
unreadMarkDiameter: 8px;
|
||||||
}
|
}
|
||||||
forumTopicIconPosition: point(2px, 0px);
|
forumTopicIconPosition: point(2px, 0px);
|
||||||
editTopicTitleMargin: margins(70px, 2px, 22px, 18px);
|
editTopicTitleMargin: margins(70px, 2px, 22px, 18px);
|
||||||
|
@@ -112,7 +112,32 @@ int PaintBadges(
|
|||||||
bool displayPinnedIcon = false,
|
bool displayPinnedIcon = false,
|
||||||
int pinnedIconTop = 0) {
|
int pinnedIconTop = 0) {
|
||||||
auto initial = right;
|
auto initial = right;
|
||||||
if (badgesState.unread) {
|
if (badgesState.unread
|
||||||
|
&& !badgesState.unreadCounter
|
||||||
|
&& context.st->unreadMarkDiameter > 0) {
|
||||||
|
const auto d = context.st->unreadMarkDiameter;
|
||||||
|
UnreadBadgeStyle st;
|
||||||
|
PainterHighQualityEnabler hq(p);
|
||||||
|
const auto rect = QRect(
|
||||||
|
right - st.size + (st.size - d) / 2,
|
||||||
|
top + (st.size - d) / 2,
|
||||||
|
d,
|
||||||
|
d);
|
||||||
|
p.setPen(Qt::NoPen);
|
||||||
|
p.setBrush(badgesState.unreadMuted
|
||||||
|
? (context.active
|
||||||
|
? st::dialogsUnreadBgMutedActive
|
||||||
|
: context.selected
|
||||||
|
? st::dialogsUnreadBgMutedOver
|
||||||
|
: st::dialogsUnreadBgMuted)
|
||||||
|
: (context.active
|
||||||
|
? st::dialogsUnreadBgActive
|
||||||
|
: context.selected
|
||||||
|
? st::dialogsUnreadBgOver
|
||||||
|
: st::dialogsUnreadBg));
|
||||||
|
p.drawEllipse(rect);
|
||||||
|
right -= st.size + st.padding;
|
||||||
|
} else if (badgesState.unread) {
|
||||||
UnreadBadgeStyle st;
|
UnreadBadgeStyle st;
|
||||||
st.active = context.active;
|
st.active = context.active;
|
||||||
st.selected = context.selected;
|
st.selected = context.selected;
|
||||||
|
Reference in New Issue
Block a user