From 0ed68f3f58c63bd1496cb268bd83881da180051f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Lind?= Date: Wed, 21 May 2014 13:57:09 +0200 Subject: Refactor the sloppy submenu logic And enable the style to control the behavior of the sloppy submenus [ChangeLog][QtWidgets][QMenu] QMenu now pick up how "sloppy" submenus behave from the style Task-number: QTBUG-20094 Change-Id: Ib1a9770d9b63028033cc360ae236471449d00267 Reviewed-by: Friedemann Kleint Reviewed-by: Gabriel de Dietrich --- src/widgets/styles/qwindowsstyle.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/widgets/styles/qwindowsstyle.cpp') diff --git a/src/widgets/styles/qwindowsstyle.cpp b/src/widgets/styles/qwindowsstyle.cpp index 2f04a20cd0..b26e329628 100644 --- a/src/widgets/styles/qwindowsstyle.cpp +++ b/src/widgets/styles/qwindowsstyle.cpp @@ -594,6 +594,17 @@ int QWindowsStyle::styleHint(StyleHint hint, const QStyleOption *opt, const QWid break; } #endif // Q_OS_WIN && !Q_OS_WINRT + case SH_Menu_SubMenuSloppyCloseTimeout: + case SH_Menu_SubMenuPopupDelay: { +#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) && !defined(Q_OS_WINRT) + DWORD delay; + if (SystemParametersInfo(SPI_GETMENUSHOWDELAY, 0, &delay, 0)) + ret = delay; + else +#endif // Q_OS_WIN && !Q_OS_WINCE && !Q_OS_WINRT + ret = 400; + break; + } #ifndef QT_NO_RUBBERBAND case SH_RubberBand_Mask: if (const QStyleOptionRubberBand *rbOpt = qstyleoption_cast(opt)) { -- cgit v1.2.3