diff options
Diffstat (limited to 'src/plugins')
5 files changed, 37 insertions, 4 deletions
diff --git a/src/plugins/bearer/networkmanager/qnetworkmanagerservice.h b/src/plugins/bearer/networkmanager/qnetworkmanagerservice.h index 65e618d15f..c879083faf 100644 --- a/src/plugins/bearer/networkmanager/qnetworkmanagerservice.h +++ b/src/plugins/bearer/networkmanager/qnetworkmanagerservice.h @@ -243,7 +243,7 @@ public: // bool setConnections(); Q_SIGNALS: - void propertiesChanged(QMap <QString,QVariant>); + void propertiesChanged(QMap<QString,QVariant>); void propertiesReady(); private Q_SLOTS: diff --git a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmintegration.cpp b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmintegration.cpp index 402338197d..1e4f4e72c8 100644 --- a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmintegration.cpp +++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmintegration.cpp @@ -118,6 +118,8 @@ QPlatformCursor *QEglFSKmsGbmIntegration::createCursor(QPlatformScreen *screen) qCDebug(qLcEglfsKmsDebug, "Using plain OpenGL mouse cursor"); return new QEglFSCursor(screen); } +#else + Q_UNUSED(screen); #endif return nullptr; } diff --git a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/qeglfskmsegldeviceintegration.cpp b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/qeglfskmsegldeviceintegration.cpp index a67457a6a5..ab39af6b80 100644 --- a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/qeglfskmsegldeviceintegration.cpp +++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/qeglfskmsegldeviceintegration.cpp @@ -289,7 +289,9 @@ QPlatformCursor *QEglFSKmsEglDeviceIntegration::createCursor(QPlatformScreen *sc { #if QT_CONFIG(opengl) if (screenConfig()->separateScreens()) - return new QEglFSCursor(screen); + return new QEglFSCursor(screen); +#else + Q_UNUSED(screen); #endif return nullptr; } diff --git a/src/plugins/platforms/windows/qwindowsglcontext.cpp b/src/plugins/platforms/windows/qwindowsglcontext.cpp index 851a6c961e..21cb794196 100644 --- a/src/plugins/platforms/windows/qwindowsglcontext.cpp +++ b/src/plugins/platforms/windows/qwindowsglcontext.cpp @@ -1350,10 +1350,10 @@ bool QWindowsGLContext::makeCurrent(QPlatformSurface *surface) // Set the swap interval if (m_staticContext->wglSwapInternalExt) { const int interval = surface->format().swapInterval(); - if (interval >= 0 && m_swapInterval != interval) { + if (m_swapInterval != interval) m_swapInterval = interval; + if (interval >= 0) m_staticContext->wglSwapInternalExt(interval); - } } return success; diff --git a/src/plugins/styles/mac/qmacstyle_mac.mm b/src/plugins/styles/mac/qmacstyle_mac.mm index b84448d5e2..c2b6fbfead 100644 --- a/src/plugins/styles/mac/qmacstyle_mac.mm +++ b/src/plugins/styles/mac/qmacstyle_mac.mm @@ -130,6 +130,7 @@ #include <QtWidgets/qgraphicsview.h> #endif #include <QtCore/qvariant.h> +#include <QtCore/qvarlengtharray.h> #include <private/qstylehelper_p.h> #include <private/qstyleanimation_p.h> #include <qpa/qplatformfontdatabase.h> @@ -314,6 +315,26 @@ static QLinearGradient titlebarGradientInactive() return qt_mac_applicationIsInDarkMode() ? darkGradient : lightGradient; } +static void clipTabBarFrame(const QStyleOption *option, const QMacStyle *style, CGContextRef ctx) +{ + Q_ASSERT(option); + Q_ASSERT(style); + Q_ASSERT(ctx); + + if (qt_mac_applicationIsInDarkMode()) { + QTabWidget *tabWidget = qobject_cast<QTabWidget *>(option->styleObject); + Q_ASSERT(tabWidget); + + const QRect tabBarRect = style->subElementRect(QStyle::SE_TabWidgetTabBar, option, tabWidget).adjusted(2, 2, -3, -2); + const QRegion clipPath = QRegion(option->rect) - tabBarRect; + QVarLengthArray<CGRect, 3> cgRects; + for (const QRect &qtRect : clipPath) + cgRects.push_back(qtRect.toCGRect()); + if (cgRects.size()) + CGContextClipToRects(ctx, &cgRects[0], size_t(cgRects.size())); + } +} + static const QColor titlebarSeparatorLineActive(111, 111, 111); static const QColor titlebarSeparatorLineInactive(131, 131, 131); static const QColor darkModeSeparatorLine(88, 88, 88); @@ -2976,6 +2997,8 @@ void QMacStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, QPai // QDarkNSBox, of type NSBoxCustom. Its appearance is close enough to the real thing so // we can use this for now. d->drawNSViewInRect(box, opt->rect, p, ^(CGContextRef ctx, const CGRect &rect) { + if (QTabWidget *tabWidget = qobject_cast<QTabWidget *>(opt->styleObject)) + clipTabBarFrame(opt, this, ctx); CGContextTranslateCTM(ctx, 0, rect.origin.y + rect.size.height); CGContextScaleCTM(ctx, 1, -1); if (QOperatingSystemVersion::current() < QOperatingSystemVersion::MacOSMojave @@ -3699,6 +3722,12 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter // inFrame:withView:], -[drawRect:] or anything in between. Besides, // there's no public API do draw the pressed state, AFAICS. We'll use // a push NSButton instead and clip the CGContext. + // NOTE/TODO: this is not true. On 10.13 NSSegmentedControl works with + // some (black?) magic/magic dances, on 10.14 it simply works (was + // it fixed in AppKit?). But, indeed, we cannot make a tab 'pressed' + // with NSSegmentedControl (only selected), so we stay with buttons + // (mixing buttons and NSSegmentedControl for such a simple thing + // is too much work). const auto cs = d->effectiveAquaSizeConstrain(opt, w); // Extra hacks to get the proper pressed appreance when not selected or selected and inactive |