diff --git a/ui/emoji_config.cpp b/ui/emoji_config.cpp index 6680854..148feeb 100644 --- a/ui/emoji_config.cpp +++ b/ui/emoji_config.cpp @@ -35,7 +35,7 @@ constexpr auto kSetVersion = uint32(2); constexpr auto kCacheVersion = uint32(6); constexpr auto kMaxId = uint32(1 << 8); -#if defined Q_OS_MAC && !defined OS_MAC_OLD +#ifdef Q_OS_MAC constexpr auto kScaleForTouchBar = 150; #endif @@ -80,7 +80,7 @@ auto CanClearUniversal = false; auto WaitingToSwitchBackToId = 0; auto Updates = rpl::event_stream<>(); -#if defined Q_OS_MAC && !defined OS_MAC_OLD +#ifdef Q_OS_MAC auto TouchbarSize = -1; auto TouchbarInstance = std::unique_ptr(); auto TouchbarEmoji = (Instance*)nullptr; @@ -498,7 +498,7 @@ void Init() { InstanceNormal = std::make_unique(SizeNormal); InstanceLarge = std::make_unique(SizeLarge); -#if defined Q_OS_MAC && !defined OS_MAC_OLD +#ifdef Q_OS_MAC if (style::Scale() != kScaleForTouchBar) { TouchbarSize = int(style::ConvertScale(18 * 4 / 3., kScaleForTouchBar * style::DevicePixelRatio())); @@ -516,7 +516,7 @@ void Clear() { InstanceNormal = nullptr; InstanceLarge = nullptr; -#if defined Q_OS_MAC && !defined OS_MAC_OLD +#ifdef Q_OS_MAC TouchbarInstance = nullptr; TouchbarEmoji = nullptr; #endif @@ -620,7 +620,7 @@ int GetSizeLarge() { return SizeLarge; } -#if defined Q_OS_MAC && !defined OS_MAC_OLD +#ifdef Q_OS_MAC int GetSizeTouchbar() { return (style::Scale() == kScaleForTouchBar) ? GetSizeLarge() @@ -763,7 +763,7 @@ const QPixmap &SinglePixmap(EmojiPtr emoji, int fontHeight) { } 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) ? SizeLarge : TouchbarSize; diff --git a/ui/emoji_config.h b/ui/emoji_config.h index 75f10e1..3183258 100644 --- a/ui/emoji_config.h +++ b/ui/emoji_config.h @@ -40,7 +40,7 @@ void ClearNeedSwitchToId(); [[nodiscard]] int GetSizeNormal(); [[nodiscard]] int GetSizeLarge(); -#if defined Q_OS_MAC && !defined OS_MAC_OLD +#ifdef Q_OS_MAC [[nodiscard]] int GetSizeTouchbar(); #endif diff --git a/ui/style/style_core.cpp b/ui/style/style_core.cpp index 9914e50..48d1dd4 100644 --- a/ui/style/style_core.cpp +++ b/ui/style/style_core.cpp @@ -144,11 +144,7 @@ namespace internal { QImage createCircleMask(int size, QColor bg, QColor fg) { int realSize = size * DevicePixelRatio(); -#ifndef OS_MAC_OLD 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); PainterHighQualityEnabler hq(p); diff --git a/ui/text/text.cpp b/ui/text/text.cpp index 95e22f9..6db3e73 100644 --- a/ui/text/text.cpp +++ b/ui/text/text.cpp @@ -134,14 +134,7 @@ bool IsBad(QChar ch) { || (ch >= 127 && ch < 160 && ch != 156) // qt harfbuzz crash see https://github.com/telegramdesktop/tdesktop/issues/4551 - || (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)); + || (Platform::IsMac() && ch == 6158); } } // namespace @@ -1982,12 +1975,7 @@ private: if (item == -1) 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); -#endif // OS_MAC_OLD - auto blockIndex = _lineStartBlock; auto currentBlock = _t->_blocks[blockIndex].get(); auto nextBlock = (++blockIndex < _blocksSize) ? _t->_blocks[blockIndex].get() : nullptr; diff --git a/ui/text/text_entity.cpp b/ui/text/text_entity.cpp index b535f4e..cd4453e 100644 --- a/ui/text/text_entity.cpp +++ b/ui/text/text_entity.cpp @@ -88,9 +88,7 @@ QRegularExpression CreateRegExp(const QString &expression) { auto result = QRegularExpression( expression, QRegularExpression::UseUnicodePropertiesOption); -#ifndef OS_MAC_OLD result.optimize(); -#endif // OS_MAC_OLD return result; } diff --git a/ui/ui_utility.cpp b/ui/ui_utility.cpp index f37e607..7e5b7d8 100644 --- a/ui/ui_utility.cpp +++ b/ui/ui_utility.cpp @@ -169,9 +169,7 @@ void SendSynteticMouseEvent(QWidget *widget, QEvent::Type type, Qt::MouseButton , button , QGuiApplication::mouseButtons() | button , QGuiApplication::keyboardModifiers() -#ifndef OS_MAC_OLD , Qt::MouseEventSynthesizedByApplication -#endif // OS_MAC_OLD ); ev.setTimestamp(crl::now()); QGuiApplication::sendEvent(windowHandle, &ev);