From ebd2fe108ae4e72d94dd7e3bc0ed296253b68b3d Mon Sep 17 00:00:00 2001 From: Shawn Rutledge Date: Thu, 31 Jul 2014 18:10:33 +0200 Subject: Add flicking behavior hints to xcb platform integration For now these will be used in QtQuick Flickable. Task-number: QTBUG-35608 Task-number: QTBUG-35609 Task-number: QTBUG-97055 Pick-to: 6.5 Change-Id: I944d7f0271d535822ceeef610f232f56c85e0938 Reviewed-by: Axel Spoerl --- src/plugins/platforms/xcb/qxcbintegration.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/plugins/platforms/xcb/qxcbintegration.cpp') diff --git a/src/plugins/platforms/xcb/qxcbintegration.cpp b/src/plugins/platforms/xcb/qxcbintegration.cpp index 6b2a20bb30..d25b059852 100644 --- a/src/plugins/platforms/xcb/qxcbintegration.cpp +++ b/src/plugins/platforms/xcb/qxcbintegration.cpp @@ -472,21 +472,23 @@ QVariant QXcbIntegration::styleHint(QPlatformIntegration::StyleHint hint) const case QPlatformIntegration::StartDragVelocity: case QPlatformIntegration::UseRtlExtensions: case QPlatformIntegration::PasswordMaskCharacter: + case QPlatformIntegration::FlickMaximumVelocity: + case QPlatformIntegration::FlickDeceleration: // TODO using various xcb, gnome or KDE settings break; // Not implemented, use defaults + case QPlatformIntegration::FlickStartDistance: case QPlatformIntegration::StartDragDistance: { RETURN_VALID_XSETTINGS(xsNetDndDragThreshold); - // The default (in QPlatformTheme::defaultThemeHint) is 10 pixels, but // on a high-resolution screen it makes sense to increase it. - qreal dpi = 100.0; + qreal dpi = 100; if (const QXcbScreen *screen = connection()->primaryScreen()) { if (screen->logicalDpi().first > dpi) dpi = screen->logicalDpi().first; if (screen->logicalDpi().second > dpi) dpi = screen->logicalDpi().second; } - return 10.0 * dpi / 100.0; + return (hint == QPlatformIntegration::FlickStartDistance ? qreal(15) : qreal(10)) * dpi / qreal(100); } case QPlatformIntegration::ShowIsFullScreen: // X11 always has support for windows, but the -- cgit v1.2.3