Show visible-only-to-members line in pending requests.

This commit is contained in:
John Preston
2026-06-23 12:21:30 +04:00
parent 752a0f9a51
commit 143976d1bb
3 changed files with 34 additions and 8 deletions
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="16px" height="16px" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg">
<g stroke="none" fill="none" fill-rule="evenodd">
<path d="M8 3.5 C4.7 3.5 1.9 5.6 0.8 8.5 C0.74 8.66 0.74 8.84 0.8 9 C1.45 10.7 2.6 12.13 4.06 13.13 L2.7 14.49 C2.41 14.78 2.41 15.26 2.7 15.55 C2.99 15.84 3.47 15.84 3.76 15.55 L13.96 5.36 C14.25 5.07 14.25 4.59 13.96 4.3 C13.67 4.01 13.19 4.01 12.9 4.3 L11.55 5.65 C10.5 4.36 9.32 3.5 8 3.5 Z M5.62 11.57 C4.4 10.78 3.43 9.66 2.83 8.75 C3.86 7.18 5.83 5.5 8 5.5 C8.79 5.5 9.55 5.73 10.24 6.13 L9.16 7.21 C8.81 7.04 8.42 6.95 8 6.95 C6.51 6.95 5.3 8.16 5.3 9.65 C5.3 10.07 5.39 10.46 5.56 10.81 L5.62 11.57 Z M13.17 6.95 L11.74 8.38 C11.62 9.46 11.13 10.45 10.4 11.18 C9.5 12.08 8.3 12.5 8 12.5 L8 12.5 C7.84 12.5 7.62 12.49 7.36 12.46 L6.13 13.69 C6.74 13.89 7.37 14 8 14 C11.3 14 14.1 11.9 15.2 9 C15.26 8.84 15.26 8.66 15.2 8.5 C14.7 7.2 13.99 6.95 13.17 6.95 Z" fill="#FFFFFF" fill-rule="evenodd"></path>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1015 B

+9 -3
View File
@@ -1060,7 +1060,7 @@ requestPeerRestriction: FlatLabel(defaultFlatLabel) {
}
requestsBoxItem: PeerListItem(peerListBoxItem) {
height: 104px;
height: 124px;
namePosition: point(74px, 26px);
button: OutlineButton(defaultPeerListButton) {
textBg: contactsBg;
@@ -1102,7 +1102,7 @@ requestsRejectButton: RoundButton(defaultLightButton) {
height: 30px;
textTop: 6px;
}
requestAcceptPosition: point(71px, 70px);
requestAcceptPosition: point(71px, 90px);
requestButtonsSkip: 9px;
requestSuggestStyle: TextStyle(defaultTextStyle) {
font: contactsStatusFont;
@@ -1111,7 +1111,7 @@ requestSuggestPosition: point(74px, 6px);
requestMembersStyle: TextStyle(defaultTextStyle) {
font: contactsStatusFont;
}
requestMembersPosition: point(74px, 48px);
requestMembersPosition: point(74px, 46px);
requestMembersIcon: IconEmoji {
icon: icon{{ "chat/mini_subscribers", contactsStatusFg }};
padding: margins(0px, 3px, 4px, 0px);
@@ -1120,6 +1120,12 @@ requestMembersIcon: IconEmoji {
requestSuggestBadgeSize: 18px;
requestSuggestBadgeBorder: 1px;
requestSuggestBadgeSkip: point(0px, 0px);
requestOnlyMembersPosition: point(74px, 66px);
requestVisibleIcon: IconEmoji {
icon: icon{{ "chat/mini_hidden", contactsStatusFg }};
padding: margins(0px, 2px, 4px, 0px);
useIconColor: false;
}
ringtonesBoxButton: SettingsButton(defaultSettingsButton) {
textFg: lightButtonFg;
@@ -246,6 +246,7 @@ private:
UserData *_requestedBy = nullptr;
Ui::Text::String _suggest;
Ui::Text::String _members;
Ui::Text::String _onlyMembers;
int _userWidth = 0;
std::unique_ptr<Ui::RippleAnimation> _acceptRipple;
std::unique_ptr<Ui::RippleAnimation> _rejectRipple;
@@ -278,11 +279,6 @@ Row::Row(
lt_user,
tr::link(user),
tr::marked);
if (!request.visible) {
suggest.append(QString::fromUtf8(" \xE2\x80\xA2 "));
suggest.append(
tr::lng_community_request_only_members(tr::now));
}
_suggest.setMarkedText(
st::requestSuggestStyle,
suggest,
@@ -302,6 +298,15 @@ Row::Row(
Ui::NameTextOptions());
}
if (!request.visible) {
auto text = Ui::Text::IconEmoji(&st::requestVisibleIcon)
.append(tr::lng_community_request_only_members(tr::now));
_onlyMembers.setMarkedText(
st::requestMembersStyle,
text,
Ui::NameTextOptions());
}
_chatUserpic = Ui::MakeUserpicThumbnail(request.peer);
if (request.requestedBy) {
_suggestUserpic = Ui::MakeUserpicThumbnail(request.requestedBy);
@@ -381,6 +386,15 @@ void Row::paintStatusText(
.elisionLines = 1,
});
}
if (!_onlyMembers.isEmpty()) {
_onlyMembers.draw(p, {
.position = st::requestOnlyMembersPosition,
.availableWidth = availableWidth,
.palette = &st::defaultTextPalette,
.now = now,
.elisionLines = 1,
});
}
}
void Row::setPending(bool pending) {