mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Fix paid media price tag background.
This commit is contained in:
parent
aaa72b7c30
commit
bd49887607
4 changed files with 24 additions and 2 deletions
|
@ -343,6 +343,14 @@ rpl::producer<int> SendFilesBox::Block::itemModifyRequest() const {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
rpl::producer<> SendFilesBox::Block::orderUpdated() const {
|
||||||
|
if (_isAlbum) {
|
||||||
|
const auto album = static_cast<Ui::AlbumPreview*>(_preview.get());
|
||||||
|
return album->orderUpdated();
|
||||||
|
}
|
||||||
|
return rpl::never<>();
|
||||||
|
}
|
||||||
|
|
||||||
void SendFilesBox::Block::setSendWay(Ui::SendFilesWay way) {
|
void SendFilesBox::Block::setSendWay(Ui::SendFilesWay way) {
|
||||||
if (!_isAlbum) {
|
if (!_isAlbum) {
|
||||||
if (_isSingleMedia) {
|
if (_isSingleMedia) {
|
||||||
|
@ -1123,6 +1131,13 @@ void SendFilesBox::pushBlock(int from, int till) {
|
||||||
st::sendMediaPreviewSize,
|
st::sendMediaPreviewSize,
|
||||||
[=] { refreshAllAfterChanges(from); });
|
[=] { refreshAllAfterChanges(from); });
|
||||||
}, widget->lifetime());
|
}, widget->lifetime());
|
||||||
|
|
||||||
|
block.orderUpdated() | rpl::start_with_next([=]{
|
||||||
|
if (_priceTag) {
|
||||||
|
_priceTagBg = QImage();
|
||||||
|
_priceTag->update();
|
||||||
|
}
|
||||||
|
}, widget->lifetime());
|
||||||
}
|
}
|
||||||
|
|
||||||
void SendFilesBox::refreshControls(bool initial) {
|
void SendFilesBox::refreshControls(bool initial) {
|
||||||
|
|
|
@ -161,6 +161,7 @@ private:
|
||||||
[[nodiscard]] rpl::producer<int> itemDeleteRequest() const;
|
[[nodiscard]] rpl::producer<int> itemDeleteRequest() const;
|
||||||
[[nodiscard]] rpl::producer<int> itemReplaceRequest() const;
|
[[nodiscard]] rpl::producer<int> itemReplaceRequest() const;
|
||||||
[[nodiscard]] rpl::producer<int> itemModifyRequest() const;
|
[[nodiscard]] rpl::producer<int> itemModifyRequest() const;
|
||||||
|
[[nodiscard]] rpl::producer<> orderUpdated() const;
|
||||||
|
|
||||||
void setSendWay(Ui::SendFilesWay way);
|
void setSendWay(Ui::SendFilesWay way);
|
||||||
void toggleSpoilers(bool enabled);
|
void toggleSpoilers(bool enabled);
|
||||||
|
|
|
@ -279,6 +279,7 @@ void AlbumPreview::finishDrag() {
|
||||||
_finishDragAnimation.start([=] { update(); }, 0., 1., kDragDuration);
|
_finishDragAnimation.start([=] { update(); }, 0., 1., kDragDuration);
|
||||||
|
|
||||||
updateSizeAnimated(layout);
|
updateSizeAnimated(layout);
|
||||||
|
_orderUpdated.fire({});
|
||||||
} else {
|
} else {
|
||||||
for (const auto &thumb : _thumbs) {
|
for (const auto &thumb : _thumbs) {
|
||||||
thumb->resetLayoutAnimation();
|
thumb->resetLayoutAnimation();
|
||||||
|
@ -649,7 +650,7 @@ QImage AlbumPreview::generatePriceTagBackground() const {
|
||||||
p.translate(geometry.center());
|
p.translate(geometry.center());
|
||||||
p.scale(wscale, hscale);
|
p.scale(wscale, hscale);
|
||||||
p.translate(-geometry.center());
|
p.translate(-geometry.center());
|
||||||
thumb->paintInAlbum(p, 0, 0, 0., 0.);
|
thumb->paintInAlbum(p, 0, 0, 1., 1.);
|
||||||
p.restore();
|
p.restore();
|
||||||
}
|
}
|
||||||
p.end();
|
p.end();
|
||||||
|
|
|
@ -51,6 +51,10 @@ public:
|
||||||
return _thumbModified.events();
|
return _thumbModified.events();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[[nodiscard]] rpl::producer<> orderUpdated() const {
|
||||||
|
return _orderUpdated.events();
|
||||||
|
}
|
||||||
|
|
||||||
[[nodiscard]] QImage generatePriceTagBackground() const;
|
[[nodiscard]] QImage generatePriceTagBackground() const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
@ -120,6 +124,7 @@ private:
|
||||||
rpl::event_stream<int> _thumbDeleted;
|
rpl::event_stream<int> _thumbDeleted;
|
||||||
rpl::event_stream<int> _thumbChanged;
|
rpl::event_stream<int> _thumbChanged;
|
||||||
rpl::event_stream<int> _thumbModified;
|
rpl::event_stream<int> _thumbModified;
|
||||||
|
rpl::event_stream<> _orderUpdated;
|
||||||
|
|
||||||
base::unique_qptr<PopupMenu> _menu;
|
base::unique_qptr<PopupMenu> _menu;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue