mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-16 06:07:06 +02:00
Add a distinct forum icon in chats list.
This commit is contained in:
parent
76330eaaa6
commit
97d8aa0a0d
8 changed files with 38 additions and 19 deletions
BIN
Telegram/Resources/icons/dialogs/dialogs_forum.png
Normal file
BIN
Telegram/Resources/icons/dialogs/dialogs_forum.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 469 B |
BIN
Telegram/Resources/icons/dialogs/dialogs_forum@2x.png
Normal file
BIN
Telegram/Resources/icons/dialogs/dialogs_forum@2x.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 902 B |
BIN
Telegram/Resources/icons/dialogs/dialogs_forum@3x.png
Normal file
BIN
Telegram/Resources/icons/dialogs/dialogs_forum@3x.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.3 KiB |
|
@ -271,7 +271,7 @@ dialogSearchFrom: IconButton(dialogCalendar) {
|
|||
iconPosition: point(9px, 8px);
|
||||
}
|
||||
|
||||
dialogsChatTypeSkip: 20px;
|
||||
dialogsChatTypeSkip: 3px;
|
||||
dialogsChatIcon: icon {{ "dialogs/dialogs_chat", dialogsChatIconFg, point(1px, 4px) }};
|
||||
dialogsChatIconOver: icon {{ "dialogs/dialogs_chat", dialogsChatIconFgOver, point(1px, 4px) }};
|
||||
dialogsChatIconActive: icon {{ "dialogs/dialogs_chat", dialogsChatIconFgActive, point(1px, 4px) }};
|
||||
|
@ -281,6 +281,9 @@ dialogsChannelIconActive: icon {{ "dialogs/dialogs_channel", dialogsChatIconFgAc
|
|||
dialogsBotIcon: icon {{ "dialogs/dialogs_bot", dialogsChatIconFg, point(1px, 3px) }};
|
||||
dialogsBotIconOver: icon {{ "dialogs/dialogs_bot", dialogsChatIconFgOver, point(1px, 3px) }};
|
||||
dialogsBotIconActive: icon {{ "dialogs/dialogs_bot", dialogsChatIconFgActive, point(1px, 3px) }};
|
||||
dialogsForumIcon: icon {{ "dialogs/dialogs_forum", dialogsChatIconFg, point(1px, 4px) }};
|
||||
dialogsForumIconOver: icon {{ "dialogs/dialogs_forum", dialogsChatIconFgOver, point(1px, 4px) }};
|
||||
dialogsForumIconActive: icon {{ "dialogs/dialogs_forum", dialogsChatIconFgActive, point(1px, 4px) }};
|
||||
dialogsArchiveUserpic: icon {{ "archive_userpic", historyPeerUserpicFg }};
|
||||
dialogsRepliesUserpic: icon {{ "replies_userpic", historyPeerUserpicFg }};
|
||||
|
||||
|
|
|
@ -859,7 +859,9 @@ void InnerWidget::paintPeerSearchResult(
|
|||
// draw chat icon
|
||||
if (const auto chatTypeIcon = Ui::ChatTypeIcon(peer, context)) {
|
||||
chatTypeIcon->paint(p, rectForName.topLeft(), context.width);
|
||||
rectForName.setLeft(rectForName.left() + st::dialogsChatTypeSkip);
|
||||
rectForName.setLeft(rectForName.left()
|
||||
+ chatTypeIcon->width()
|
||||
+ st::dialogsChatTypeSkip);
|
||||
}
|
||||
const auto badgeWidth = result->badge.drawGetWidth(
|
||||
p,
|
||||
|
@ -987,7 +989,9 @@ void InnerWidget::paintSearchInFilter(
|
|||
st::semiboldFont->height);
|
||||
if (icon) {
|
||||
icon->paint(p, rectForName.topLeft(), width());
|
||||
rectForName.setLeft(rectForName.left() + st::dialogsChatTypeSkip);
|
||||
rectForName.setLeft(rectForName.left()
|
||||
+ icon->width()
|
||||
+ st::dialogsChatTypeSkip);
|
||||
}
|
||||
p.setPen(savedPen);
|
||||
text.drawLeftElided(
|
||||
|
|
|
@ -340,7 +340,9 @@ void PaintRow(
|
|||
} else if (from) {
|
||||
if (const auto chatTypeIcon = ChatTypeIcon(from, context)) {
|
||||
chatTypeIcon->paint(p, rectForName.topLeft(), context.width);
|
||||
rectForName.setLeft(rectForName.left() + st::dialogsChatTypeSkip);
|
||||
rectForName.setLeft(rectForName.left()
|
||||
+ chatTypeIcon->width()
|
||||
+ st::dialogsChatTypeSkip);
|
||||
}
|
||||
}
|
||||
auto texttop = context.st->textTop;
|
||||
|
@ -739,19 +741,7 @@ void PaintUnreadBadge(QPainter &p, const QRect &rect, const UnreadBadgeStyle &st
|
|||
const style::icon *ChatTypeIcon(
|
||||
not_null<PeerData*> peer,
|
||||
const PaintContext &context) {
|
||||
if (peer->isChat() || peer->isMegagroup()) {
|
||||
return &(context.active
|
||||
? st::dialogsChatIconActive
|
||||
: context.selected
|
||||
? st::dialogsChatIconOver
|
||||
: st::dialogsChatIcon);
|
||||
} else if (peer->isChannel()) {
|
||||
return &(context.active
|
||||
? st::dialogsChannelIconActive
|
||||
: context.selected
|
||||
? st::dialogsChannelIconOver
|
||||
: st::dialogsChannelIcon);
|
||||
} else if (const auto user = peer->asUser()) {
|
||||
if (const auto user = peer->asUser()) {
|
||||
if (ShowUserBotIcon(user)) {
|
||||
return &(context.active
|
||||
? st::dialogsBotIconActive
|
||||
|
@ -759,6 +749,24 @@ const style::icon *ChatTypeIcon(
|
|||
? st::dialogsBotIconOver
|
||||
: st::dialogsBotIcon);
|
||||
}
|
||||
} else if (peer->isBroadcast()) {
|
||||
return &(context.active
|
||||
? st::dialogsChannelIconActive
|
||||
: context.selected
|
||||
? st::dialogsChannelIconOver
|
||||
: st::dialogsChannelIcon);
|
||||
} else if (peer->isForum()) {
|
||||
return &(context.active
|
||||
? st::dialogsForumIconActive
|
||||
: context.selected
|
||||
? st::dialogsForumIconOver
|
||||
: st::dialogsForumIcon);
|
||||
} else {
|
||||
return &(context.active
|
||||
? st::dialogsChatIconActive
|
||||
: context.selected
|
||||
? st::dialogsChatIconOver
|
||||
: st::dialogsChatIcon);
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
|
|
@ -870,7 +870,9 @@ void Notification::updateNotifyDisplay() {
|
|||
}
|
||||
if (const auto chatTypeIcon = Dialogs::Ui::ChatTypeIcon(_history->peer)) {
|
||||
chatTypeIcon->paint(p, rectForName.topLeft(), w);
|
||||
rectForName.setLeft(rectForName.left() + st::dialogsChatTypeSkip);
|
||||
rectForName.setLeft(rectForName.left()
|
||||
+ chatTypeIcon->width()
|
||||
+ st::dialogsChatTypeSkip);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -700,7 +700,9 @@ void Generator::paintRow(const Row &row) {
|
|||
})();
|
||||
if (chatTypeIcon) {
|
||||
(*chatTypeIcon)[_palette].paint(*_p, rectForName.topLeft(), fullWidth);
|
||||
rectForName.setLeft(rectForName.left() + st::dialogsChatTypeSkip);
|
||||
rectForName.setLeft(rectForName.left()
|
||||
+ chatTypeIcon->width()
|
||||
+ st::dialogsChatTypeSkip);
|
||||
}
|
||||
|
||||
auto texttop = y + st.textTop;
|
||||
|
|
Loading…
Add table
Reference in a new issue