2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 06:35:14 +00:00

Fix build on macOS.

This commit is contained in:
John Preston
2022-06-10 17:38:52 +04:00
parent 0e90092d59
commit bcfbdcd6ed
6 changed files with 13 additions and 13 deletions

View File

@@ -422,7 +422,7 @@ void PreloadSticker(const std::shared_ptr<Data::DocumentMedia> &media) {
}
const auto width = st::premiumVideoWidth;
const auto height = state->blurred.height()
? state->blurred.height()
? (state->blurred.height() / state->blurred.devicePixelRatio())
: width;
const auto left = (st::boxWideWidth - width) / 2;
const auto top = st::premiumPreviewHeight - height;

View File

@@ -373,16 +373,16 @@ bool PeerMatchesTypes(
return (types & PeerType::Group);
}
PeerTypes ParseChooseTypes(const QString &choose) {
PeerTypes ParseChooseTypes(QStringView choose) {
auto result = PeerTypes();
for (const auto &entry : choose.split(QChar(' '))) {
if (entry == "users") {
if (entry == u"users"_q) {
result |= PeerType::User;
} else if (entry == "bots") {
} else if (entry == u"bots"_q) {
result |= PeerType::Bot;
} else if (entry == "groups") {
} else if (entry == u"groups"_q) {
result |= PeerType::Group;
} else if (entry == "channels") {
} else if (entry == u"channels"_q) {
result |= PeerType::Broadcast;
}
}

View File

@@ -47,7 +47,7 @@ using PeerTypes = base::flags<PeerType>;
not_null<PeerData*> peer,
not_null<UserData*> bot,
PeerTypes types);
[[nodiscard]] PeerTypes ParseChooseTypes(const QString &choose);
[[nodiscard]] PeerTypes ParseChooseTypes(QStringView choose);
struct AttachWebViewBot {
not_null<UserData*> user;

View File

@@ -843,7 +843,7 @@ void SessionController::setupPremiumToast() {
Ui::Toast::Show(
Window::Show(this).toastParent(),
{
.text = tr::lng_premium_success(tr::now),
.text = { tr::lng_premium_success(tr::now) },
.st = &st::defaultToast,
});
}, _lifetime);