Fixed build for macOS old versions.

This commit is contained in:
John Preston 2016-11-21 23:48:21 +03:00
parent eb05e62422
commit b1ca0f5ea3
5 changed files with 10 additions and 8 deletions

View File

@ -20,7 +20,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
*/
#pragma once
#include <cstdint>
#include <stdint.h>
// thanks Chromium

View File

@ -76,13 +76,11 @@ void TitleWidget::mouseDoubleClickEvent(QMouseEvent *e) {
}
Window::TitleWidget *CreateTitleWidget(QWidget *parent) {
#ifndef OS_MAC_OLD
if (auto window = qobject_cast<Platform::MainWindow*>(parent)) {
if (auto height = window->getCustomTitleHeight()) {
return new TitleWidget(window, height);
}
}
#endif // !OS_MAC_OLD
return nullptr;
}

View File

@ -490,6 +490,8 @@ public:
void step_icons(uint64 ms, bool timer);
void leaveToChildEvent(QEvent *e, QWidget *child) override;
void stickersInstalled(uint64 setId);
void queryInlineBot(UserData *bot, PeerData *peer, QString query);
@ -611,8 +613,6 @@ private:
void validateSelectedIcon(ValidateIconAnimations animations);
void updateContentHeight();
void leaveToChildEvent(QEvent *e, QWidget *child);
void updateSelected();
void updateIcons();

View File

@ -97,6 +97,8 @@ void RoundCheckbox::paint(Painter &p, uint64 ms, int x, int y, int outerWidth, f
p.setOpacity(fadeIn * fadeOut);
if (fadeOut < 1.) {
p.drawPixmapLeft(to, outerWidth, icon.wideCheckCache, cacheFrom);
} else if (fadeIn == 1.) {
p.drawPixmapLeft(to, outerWidth, _wideCheckFullCache, cacheFrom);
} else {
auto realDivider = ((kWideScale - 1) * _st.size / 2 + qMax(fadeIn - 0.5, 0.) * 2. * _st.size);
auto divider = qRound(realDivider * masterScale);
@ -179,9 +181,11 @@ void RoundCheckbox::prepareWideCheckIconCache(Icon *icon) {
Painter p(&wideCache);
p.setCompositionMode(QPainter::CompositionMode_Source);
auto iconSize = kWideScale * _st.size;
auto divider = qRound((kWideScale - 1) * _st.size / 2 + qMax(icon->fadeIn.current(1.) - 0.5, 0.) * 2. * _st.size);
auto realDivider = ((kWideScale - 1) * _st.size / 2 + qMax(icon->fadeIn.current(1.) - 0.5, 0.) * 2. * _st.size);
auto divider = qRound(realDivider);
auto cacheDivider = qRound(realDivider) * cIntRetinaFactor();
p.drawPixmapLeft(QRect(0, 0, divider, iconSize), cacheWidth, _wideCheckFullCache, QRect(0, 0, divider * cIntRetinaFactor(), _wideCheckFullCache.height()));
p.drawPixmapLeft(QRect(divider, 0, iconSize - divider, iconSize), cacheWidth, _wideCheckBgCache, QRect(divider * cIntRetinaFactor(), 0, _wideCheckBgCache.width() - divider * cIntRetinaFactor(), _wideCheckBgCache.height()));
p.drawPixmapLeft(QRect(divider, 0, iconSize - divider, iconSize), cacheWidth, _wideCheckBgCache, QRect(cacheDivider, 0, _wideCheckBgCache.width() - cacheDivider, _wideCheckBgCache.height()));
}
icon->wideCheckCache = App::pixmapFromImageInPlace(std_::move(wideCache));
icon->wideCheckCache.setDevicePixelRatio(cRetinaFactor());

View File

@ -171,7 +171,7 @@ bool loadColorScheme(const QByteArray &content, Instance *out = nullptr) {
auto data = base::parse::stripComments(content);
auto from = data.constData(), end = from + data.size();
while (from != end) {
QLatin1String name, value;
QLatin1String name(""), value("");
if (!readNameAndValue(from, end, &name, &value)) {
return false;
}