Fix build on Linux.

This commit is contained in:
John Preston 2022-06-14 20:38:52 +04:00
parent 9b7e19e9c5
commit 60d998bf36
10 changed files with 7 additions and 154 deletions

View File

@ -1666,8 +1666,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
"lng_group_stickers_description" = "You can choose a sticker set which will be available for every member while in the group chat.";
"lng_group_stickers_add" = "Choose sticker set";
"lng_premium_stickers" = "Premium stickers";
"lng_premium_reaction_no_group" = "This reaction is not available in this group.";
"lng_premium_reaction_no_channel" = "This reaction is not available in this channel.";
"lng_premium" = "Premium";
"lng_premium_free" = "Free";

View File

@ -876,7 +876,6 @@ void FileSizeLimitBox(
not_null<Ui::GenericBox*> box,
not_null<Main::Session*> session,
uint64 fileSizeBytes) {
const auto premium = session->premium();
const auto premiumPossible = session->premiumPossible();
const auto defaultLimit = Limit(

View File

@ -74,10 +74,6 @@ bool operator==(const Descriptor &a, const Descriptor &b) {
&& (a.fromSettings == b.fromSettings);
}
bool operator!=(const Descriptor &a, const Descriptor &b) {
return !(a == b);
}
[[nodiscard]] int ComputeX(int column, int columns) {
const auto skip = st::premiumReactionWidthSkip;
const auto fullWidth = columns * skip;
@ -375,7 +371,8 @@ void PreloadSticker(const std::shared_ptr<Data::DocumentMedia> &media) {
state->toggleTimer.callOnce(kToggleStickerTimeout);
}
};
state->index = (++state->index) % state->medias.size();
++state->index;
state->index %= state->medias.size();
delete std::exchange(state->previous, state->current);
state->current = state->next;
createNext();
@ -764,16 +761,6 @@ private:
};
[[nodiscard]] QString DisabledText(ReactionDisableType type) {
switch (type) {
case ReactionDisableType::Group:
return tr::lng_premium_reaction_no_group(tr::now);
case ReactionDisableType::Channel:
return tr::lng_premium_reaction_no_channel(tr::now);
}
return QString();
}
ReactionPreview::ReactionPreview(
not_null<Window::SessionController*> controller,
const Data::Reaction &reaction,
@ -868,7 +855,6 @@ bool ReactionPreview::disabled() const {
}
void ReactionPreview::paint(Painter &p) {
const auto size = st::premiumReactionAround;
const auto center = st::premiumReactionSize;
const auto scale = _scale.value(_over ? 1. : st::premiumReactionScale);
const auto inner = QRect(
@ -1518,14 +1504,6 @@ void Show(not_null<Window::SessionController*> controller, QImage back) {
}
}
[[nodiscard]] QImage SolidColorImage(QSize size, QColor color) {
const auto ratio = style::DevicePixelRatio();
auto result = QImage(size * ratio, QImage::Format_ARGB32_Premultiplied);
result.setDevicePixelRatio(ratio);
result.fill(color);
return result;
}
void Show(
not_null<Window::SessionController*> controller,
Descriptor &&descriptor) {
@ -1569,22 +1547,8 @@ void Show(
const auto fill = QSize(st::boxWideWidth, st::boxWideWidth);
const auto stops = Ui::Premium::LimitGradientStops();
//const auto theme = controller->currentChatTheme();
//const auto color = theme->background().colorForFill;
//const auto area = QSize(fill.width(), fill.height() * 2);
//const auto request = theme->cacheBackgroundRequest(area);
crl::async([=] {
using Option = Images::Option;
//auto back = color
// ? SolidColorImage(area, *color)
// : request.background.waitingForNegativePattern()
// ? SolidColorImage(area, Qt::black)
// : Ui::CacheBackground(request).image;
const auto factor = style::DevicePixelRatio();
//auto cropped = back.copy(QRect(
// QPoint(0, fill.height() * factor / 2),
// fill * factor));
//cropped.setDevicePixelRatio(factor);
auto cropped = QImage(
fill * factor,
QImage::Format_ARGB32_Premultiplied);
@ -1595,10 +1559,6 @@ void Show(
p.fillRect(QRect(QPoint(), fill), gradient);
p.end();
const auto options = Images::Options()
| Option::RoundSkipBottomLeft
| Option::RoundSkipBottomRight
| Option::RoundLarge;
const auto result = Images::Round(
std::move(cropped),
Images::CornersMask(st::boxRadius),

View File

@ -320,7 +320,6 @@ void AddPostLinkAction(
&& !request.link->copyToClipboardContextItemText().isEmpty()) {
return;
}
const auto session = &item->history()->session();
const auto itemId = item->fullId();
const auto context = request.view
? request.view->context()

View File

@ -231,7 +231,6 @@ void EmojiInteractions::visibleAreaUpdated(
QRect EmojiInteractions::computeRect(const Play &play) const {
const auto view = play.view;
const auto fullWidth = view->width();
const auto sticker = play.inner;
const auto size = play.outer;
const auto shift = play.premium

View File

@ -104,7 +104,6 @@ void PaintWaveform(
wfSize);
const auto barNormValue = (wf ? voiceData->wavemax : 0) + 1;
const auto maxDelta = st::msgWaveformMax - st::msgWaveformMin;
const auto &bottom = st::msgWaveformMax;
p.setPen(Qt::NoPen);
auto hq = PainterHighQualityEnabler(p);
for (auto i = 0, barLeft = 0, sum = 0, maxValue = 0; i < wfSize; ++i) {

View File

@ -37,100 +37,6 @@ namespace Info {
namespace Profile {
namespace {
class SectionToggle : public Ui::AbstractCheckView {
public:
SectionToggle(
const style::InfoToggle &st,
bool checked,
Fn<void()> updateCallback);
QSize getSize() const override;
void paint(
Painter &p,
int left,
int top,
int outerWidth) override;
QImage prepareRippleMask() const override;
bool checkRippleStartPosition(QPoint position) const override;
private:
QSize rippleSize() const;
const style::InfoToggle &_st;
};
SectionToggle::SectionToggle(
const style::InfoToggle &st,
bool checked,
Fn<void()> updateCallback)
: AbstractCheckView(st.duration, checked, std::move(updateCallback))
, _st(st) {
}
QSize SectionToggle::getSize() const {
return QSize(_st.size, _st.size);
}
void SectionToggle::paint(
Painter &p,
int left,
int top,
int outerWidth) {
auto sqrt2 = sqrt(2.);
auto vLeft = style::rtlpoint(left + _st.skip, 0, outerWidth).x() + 0.;
auto vTop = top + _st.skip + 0.;
auto vWidth = _st.size - 2 * _st.skip;
auto vHeight = _st.size - 2 * _st.skip;
auto vStroke = _st.stroke / sqrt2;
constexpr auto kPointCount = 6;
std::array<QPointF, kPointCount> pathV = { {
{ vLeft, vTop + (vHeight / 4.) + vStroke },
{ vLeft + vStroke, vTop + (vHeight / 4.) },
{ vLeft + (vWidth / 2.), vTop + (vHeight * 3. / 4.) - vStroke },
{ vLeft + vWidth - vStroke, vTop + (vHeight / 4.) },
{ vLeft + vWidth, vTop + (vHeight / 4.) + vStroke },
{ vLeft + (vWidth / 2.), vTop + (vHeight * 3. / 4.) + vStroke },
} };
auto toggled = currentAnimationValue();
auto alpha = (toggled - 1.) * M_PI_2;
auto cosalpha = cos(alpha);
auto sinalpha = sin(alpha);
auto shiftx = vLeft + (vWidth / 2.);
auto shifty = vTop + (vHeight / 2.);
for (auto &point : pathV) {
auto x = point.x() - shiftx;
auto y = point.y() - shifty;
point.setX(shiftx + x * cosalpha - y * sinalpha);
point.setY(shifty + y * cosalpha + x * sinalpha);
}
QPainterPath path;
path.moveTo(pathV[0]);
for (int i = 1; i != kPointCount; ++i) {
path.lineTo(pathV[i]);
}
path.lineTo(pathV[0]);
PainterHighQualityEnabler hq(p);
p.fillPath(path, _st.color);
}
QImage SectionToggle::prepareRippleMask() const {
return Ui::RippleAnimation::ellipseMask(rippleSize());
}
QSize SectionToggle::rippleSize() const {
return getSize() + 2 * QSize(
_st.rippleAreaPadding,
_st.rippleAreaPadding);
}
bool SectionToggle::checkRippleStartPosition(QPoint position) const {
return QRect(QPoint(0, 0), rippleSize()).contains(position);
}
auto MembersStatusText(int count) {
return tr::lng_chat_status_members(tr::now, lt_count_decimal, count);
};

View File

@ -550,7 +550,7 @@ void Reader::Slices::processPart(
auto Reader::Slices::fill(uint32 offset, bytes::span buffer) -> FillResult {
Expects(!buffer.empty());
Expects(offset >= 0 && offset < _size);
Expects(offset < _size);
Expects(offset + buffer.size() <= _size);
Expects(buffer.size() <= kInSlice);
@ -569,8 +569,7 @@ auto Reader::Slices::fill(uint32 offset, bytes::span buffer) -> FillResult {
const auto till = uint32(offset + buffer.size());
const auto fromSlice = offset / kInSlice;
const auto tillSlice = (till + kInSlice - 1) / kInSlice;
Assert(fromSlice >= 0
&& (fromSlice + 1 == tillSlice || fromSlice + 2 == tillSlice)
Assert((fromSlice + 1 == tillSlice || fromSlice + 2 == tillSlice)
&& tillSlice <= _data.size());
const auto cacheNotLoaded = [&](int sliceIndex) {

View File

@ -266,8 +266,6 @@ public:
rpl::producer<> showFinishes,
const style::icon *icon);
[[nodiscard]] bool animating() const;
protected:
void paintEvent(QPaintEvent *e) override;
@ -390,10 +388,6 @@ BubbleWidget::BubbleWidget(
}, lifetime());
}
bool BubbleWidget::animating() const {
return _appearanceAnimation.animating();
}
void BubbleWidget::paintEvent(QPaintEvent *e) {
if (_bubble.counter() <= 0) {
return;
@ -832,13 +826,13 @@ void ShowListBox(
const auto content = box->verticalLayout();
for (auto &entry : entries) {
const auto subtitle = content->add(
content->add(
object_ptr<Ui::FlatLabel>(
content,
base::take(entry.subtitle) | rpl::map(Ui::Text::Bold),
stLabel),
titlePadding);
const auto description = content->add(
content->add(
object_ptr<Ui::FlatLabel>(
content,
base::take(entry.description),

@ -1 +1 @@
Subproject commit 2878b2a8a32a64e73c4a4ebf56b552e8ec6e87ed
Subproject commit 866d3618cf2518530589fccd60157138f611bbcd