2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-30 14:17:45 +00:00

Redesign of admin ranks

This commit is contained in:
RadRussianRus
2019-10-19 04:02:50 +03:00
parent 423356d42c
commit cc52f0fdd6
4 changed files with 14 additions and 10 deletions

View File

@@ -1159,13 +1159,13 @@ crl::time PeerListContent::paintRow(Painter &p, crl::time ms, RowIndex index) {
auto &name = row->name();
auto namex = _st.item.namePosition.x();
auto namew = width() - namex - skipRight;
auto statusw = namew;
if (!actionSize.isEmpty()) {
namew -= actionMargins.left()
statusw -= actionMargins.left()
+ actionSize.width()
+ actionMargins.right()
- skipRight;
}
auto statusw = namew;
if (auto iconWidth = row->nameIconWidth()) {
namew -= iconWidth;
row->paintNameIcon(
@@ -1176,14 +1176,9 @@ crl::time PeerListContent::paintRow(Painter &p, crl::time ms, RowIndex index) {
selected);
}
if (auto adminRankWidth = row->adminRankWidth()) {
namew -= adminRankWidth;
namew -= adminRankWidth + skipRight;
auto rankx = width() - adminRankWidth - skipRight;
if (!actionSize.isEmpty() && selected) {
namew -= skipRight;
rankx -= skipRight;
}
p.setFont(st::normalFont);
p.setPen(selected ? _st.item.statusFgOver : _st.item.statusFg);
row->paintAdminRank(
p,
rankx,

View File

@@ -554,7 +554,7 @@ infoMembersRemoveIconOver: icon {{
menuIconFgOver
}};
infoMembersAdminIconMarigns: margins(10px, 18px, 10px, 10px);
infoMembersRemoveIconMargins: margins(10px, 12px, 12px, 10px);
infoMembersRemoveIconMargins: margins(10px, 36px, 18px, 10px);
infoMediaHeaderStyle: TextStyle(semiboldTextStyle) {
}

View File

@@ -77,6 +77,11 @@ void MemberListRow::paintAdminRank(
int y,
int outerWidth,
bool selected) {
p.setPen(_type.rights == Rights::Creator
? st::defaultPeerListItem.statusFgActive
: selected
? st::defaultPeerListItem.statusFgOver
: st::defaultPeerListItem.statusFg);
p.drawTextLeft(x, y, outerWidth, _type.adminRank, adminRankWidth());
}

View File

@@ -102,7 +102,11 @@ void PeerListWidget::paintItem(Painter &p, int x, int y, Item *item, bool select
nameWidth -= _removeWidth + skip;
} else if (item->adminState != Item::AdminState::None) {
p.setFont(st::normalFont);
p.setPen(selected ? _st.statusFgOver : _st.statusFg);
p.setPen(item->adminState == Item::AdminState::Creator
? _st.statusFgActive
: selected
? _st.statusFgOver
: _st.statusFg);
p.drawTextLeft(nameLeft + nameWidth - item->adminRankWidth, nameTop, width(), item->adminRank, item->adminRankWidth);
nameWidth -= item->adminRankWidth + skip;
}