2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 14:38:15 +00:00

Display nice price tag, handle pay in albums.

This commit is contained in:
John Preston
2024-06-19 13:39:02 +04:00
parent a9bd7803e6
commit 5f8da27c86
9 changed files with 288 additions and 46 deletions

View File

@@ -680,9 +680,11 @@ bool SendFilesBox::hasSpoilerMenu() const {
bool SendFilesBox::canChangePrice() const {
const auto way = _sendWay.current();
return _list.canChangePrice(
way.groupFiles() && way.sendImagesAsPhotos(),
way.sendImagesAsPhotos());
return _captionToPeer
&& _captionToPeer->isBroadcast()
&& _list.canChangePrice(
way.groupFiles() && way.sendImagesAsPhotos(),
way.sendImagesAsPhotos());
}
void SendFilesBox::applyBlockChanges() {
@@ -754,6 +756,7 @@ void SendFilesBox::refreshPriceTag() {
raw,
tr::lng_paid_price(lt_price, std::move(price)),
st::paidTagLabel);
label->show();
label->sizeValue() | rpl::start_with_next([=](QSize size) {
const auto inner = QRect(QPoint(), size);
const auto rect = inner.marginsAdded(st::paidTagPadding);
@@ -833,6 +836,7 @@ void SendFilesBox::initSendWay() {
block.setSendWay(value);
}
refreshButtons();
refreshPriceTag();
if (was != hidden()) {
updateBoxSize();
updateControlsGeometry();