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 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<Instance>();
|
||||
auto TouchbarEmoji = (Instance*)nullptr;
|
||||
|
|
@ -498,7 +498,7 @@ void Init() {
|
|||
InstanceNormal = std::make_unique<Instance>(SizeNormal);
|
||||
InstanceLarge = std::make_unique<Instance>(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;
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue