Get rid of osx and linux32 special targets
This commit is contained in:
parent
1b590f9e16
commit
a2d1114a93
6 changed files with 8 additions and 28 deletions
|
|
@ -35,7 +35,7 @@ constexpr auto kSetVersion = uint32(2);
|
||||||
constexpr auto kCacheVersion = uint32(6);
|
constexpr auto kCacheVersion = uint32(6);
|
||||||
constexpr auto kMaxId = uint32(1 << 8);
|
constexpr auto kMaxId = uint32(1 << 8);
|
||||||
|
|
||||||
#if defined Q_OS_MAC && !defined OS_MAC_OLD
|
#ifdef Q_OS_MAC
|
||||||
constexpr auto kScaleForTouchBar = 150;
|
constexpr auto kScaleForTouchBar = 150;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
@ -80,7 +80,7 @@ auto CanClearUniversal = false;
|
||||||
auto WaitingToSwitchBackToId = 0;
|
auto WaitingToSwitchBackToId = 0;
|
||||||
auto Updates = rpl::event_stream<>();
|
auto Updates = rpl::event_stream<>();
|
||||||
|
|
||||||
#if defined Q_OS_MAC && !defined OS_MAC_OLD
|
#ifdef Q_OS_MAC
|
||||||
auto TouchbarSize = -1;
|
auto TouchbarSize = -1;
|
||||||
auto TouchbarInstance = std::unique_ptr<Instance>();
|
auto TouchbarInstance = std::unique_ptr<Instance>();
|
||||||
auto TouchbarEmoji = (Instance*)nullptr;
|
auto TouchbarEmoji = (Instance*)nullptr;
|
||||||
|
|
@ -498,7 +498,7 @@ void Init() {
|
||||||
InstanceNormal = std::make_unique<Instance>(SizeNormal);
|
InstanceNormal = std::make_unique<Instance>(SizeNormal);
|
||||||
InstanceLarge = std::make_unique<Instance>(SizeLarge);
|
InstanceLarge = std::make_unique<Instance>(SizeLarge);
|
||||||
|
|
||||||
#if defined Q_OS_MAC && !defined OS_MAC_OLD
|
#ifdef Q_OS_MAC
|
||||||
if (style::Scale() != kScaleForTouchBar) {
|
if (style::Scale() != kScaleForTouchBar) {
|
||||||
TouchbarSize = int(style::ConvertScale(18 * 4 / 3.,
|
TouchbarSize = int(style::ConvertScale(18 * 4 / 3.,
|
||||||
kScaleForTouchBar * style::DevicePixelRatio()));
|
kScaleForTouchBar * style::DevicePixelRatio()));
|
||||||
|
|
@ -516,7 +516,7 @@ void Clear() {
|
||||||
|
|
||||||
InstanceNormal = nullptr;
|
InstanceNormal = nullptr;
|
||||||
InstanceLarge = nullptr;
|
InstanceLarge = nullptr;
|
||||||
#if defined Q_OS_MAC && !defined OS_MAC_OLD
|
#ifdef Q_OS_MAC
|
||||||
TouchbarInstance = nullptr;
|
TouchbarInstance = nullptr;
|
||||||
TouchbarEmoji = nullptr;
|
TouchbarEmoji = nullptr;
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -620,7 +620,7 @@ int GetSizeLarge() {
|
||||||
return SizeLarge;
|
return SizeLarge;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined Q_OS_MAC && !defined OS_MAC_OLD
|
#ifdef Q_OS_MAC
|
||||||
int GetSizeTouchbar() {
|
int GetSizeTouchbar() {
|
||||||
return (style::Scale() == kScaleForTouchBar)
|
return (style::Scale() == kScaleForTouchBar)
|
||||||
? GetSizeLarge()
|
? GetSizeLarge()
|
||||||
|
|
@ -763,7 +763,7 @@ const QPixmap &SinglePixmap(EmojiPtr emoji, int fontHeight) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void Draw(QPainter &p, EmojiPtr emoji, int size, int x, int y) {
|
void Draw(QPainter &p, EmojiPtr emoji, int size, int x, int y) {
|
||||||
#if defined Q_OS_MAC && !defined OS_MAC_OLD
|
#ifdef Q_OS_MAC
|
||||||
const auto s = (style::Scale() == kScaleForTouchBar)
|
const auto s = (style::Scale() == kScaleForTouchBar)
|
||||||
? SizeLarge
|
? SizeLarge
|
||||||
: TouchbarSize;
|
: TouchbarSize;
|
||||||
|
|
|
||||||
|
|
@ -40,7 +40,7 @@ void ClearNeedSwitchToId();
|
||||||
|
|
||||||
[[nodiscard]] int GetSizeNormal();
|
[[nodiscard]] int GetSizeNormal();
|
||||||
[[nodiscard]] int GetSizeLarge();
|
[[nodiscard]] int GetSizeLarge();
|
||||||
#if defined Q_OS_MAC && !defined OS_MAC_OLD
|
#ifdef Q_OS_MAC
|
||||||
[[nodiscard]] int GetSizeTouchbar();
|
[[nodiscard]] int GetSizeTouchbar();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -144,11 +144,7 @@ namespace internal {
|
||||||
|
|
||||||
QImage createCircleMask(int size, QColor bg, QColor fg) {
|
QImage createCircleMask(int size, QColor bg, QColor fg) {
|
||||||
int realSize = size * DevicePixelRatio();
|
int realSize = size * DevicePixelRatio();
|
||||||
#ifndef OS_MAC_OLD
|
|
||||||
auto result = QImage(realSize, realSize, QImage::Format::Format_Grayscale8);
|
auto result = QImage(realSize, realSize, QImage::Format::Format_Grayscale8);
|
||||||
#else // OS_MAC_OLD
|
|
||||||
auto result = QImage(realSize, realSize, QImage::Format::Format_RGB32);
|
|
||||||
#endif // OS_MAC_OLD
|
|
||||||
{
|
{
|
||||||
QPainter p(&result);
|
QPainter p(&result);
|
||||||
PainterHighQualityEnabler hq(p);
|
PainterHighQualityEnabler hq(p);
|
||||||
|
|
|
||||||
|
|
@ -134,14 +134,7 @@ bool IsBad(QChar ch) {
|
||||||
|| (ch >= 127 && ch < 160 && ch != 156)
|
|| (ch >= 127 && ch < 160 && ch != 156)
|
||||||
|
|
||||||
// qt harfbuzz crash see https://github.com/telegramdesktop/tdesktop/issues/4551
|
// qt harfbuzz crash see https://github.com/telegramdesktop/tdesktop/issues/4551
|
||||||
|| (Platform::IsMac() && ch == 6158)
|
|| (Platform::IsMac() && ch == 6158);
|
||||||
|
|
||||||
// tmp hack see https://bugreports.qt.io/browse/QTBUG-48910
|
|
||||||
|| (Platform::IsMac10_11OrGreater()
|
|
||||||
&& !Platform::IsMac10_12OrGreater()
|
|
||||||
&& ch >= 0x0B00
|
|
||||||
&& ch <= 0x0B7F
|
|
||||||
&& IsDiac(ch));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
@ -1982,12 +1975,7 @@ private:
|
||||||
if (item == -1)
|
if (item == -1)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
#ifdef OS_MAC_OLD
|
|
||||||
auto end = _e->findItem(line.from + line.length - 1);
|
|
||||||
#else // OS_MAC_OLD
|
|
||||||
auto end = _e->findItem(line.from + line.length - 1, item);
|
auto end = _e->findItem(line.from + line.length - 1, item);
|
||||||
#endif // OS_MAC_OLD
|
|
||||||
|
|
||||||
auto blockIndex = _lineStartBlock;
|
auto blockIndex = _lineStartBlock;
|
||||||
auto currentBlock = _t->_blocks[blockIndex].get();
|
auto currentBlock = _t->_blocks[blockIndex].get();
|
||||||
auto nextBlock = (++blockIndex < _blocksSize) ? _t->_blocks[blockIndex].get() : nullptr;
|
auto nextBlock = (++blockIndex < _blocksSize) ? _t->_blocks[blockIndex].get() : nullptr;
|
||||||
|
|
|
||||||
|
|
@ -88,9 +88,7 @@ QRegularExpression CreateRegExp(const QString &expression) {
|
||||||
auto result = QRegularExpression(
|
auto result = QRegularExpression(
|
||||||
expression,
|
expression,
|
||||||
QRegularExpression::UseUnicodePropertiesOption);
|
QRegularExpression::UseUnicodePropertiesOption);
|
||||||
#ifndef OS_MAC_OLD
|
|
||||||
result.optimize();
|
result.optimize();
|
||||||
#endif // OS_MAC_OLD
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -169,9 +169,7 @@ void SendSynteticMouseEvent(QWidget *widget, QEvent::Type type, Qt::MouseButton
|
||||||
, button
|
, button
|
||||||
, QGuiApplication::mouseButtons() | button
|
, QGuiApplication::mouseButtons() | button
|
||||||
, QGuiApplication::keyboardModifiers()
|
, QGuiApplication::keyboardModifiers()
|
||||||
#ifndef OS_MAC_OLD
|
|
||||||
, Qt::MouseEventSynthesizedByApplication
|
, Qt::MouseEventSynthesizedByApplication
|
||||||
#endif // OS_MAC_OLD
|
|
||||||
);
|
);
|
||||||
ev.setTimestamp(crl::now());
|
ev.setTimestamp(crl::now());
|
||||||
QGuiApplication::sendEvent(windowHandle, &ev);
|
QGuiApplication::sendEvent(windowHandle, &ev);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue