diff options
Diffstat (limited to 'src/widgets/styles/qwindowsstyle.cpp')
-rw-r--r-- | src/widgets/styles/qwindowsstyle.cpp | 50 |
1 files changed, 4 insertions, 46 deletions
diff --git a/src/widgets/styles/qwindowsstyle.cpp b/src/widgets/styles/qwindowsstyle.cpp index 3eca9aef7f..b41ad4249e 100644 --- a/src/widgets/styles/qwindowsstyle.cpp +++ b/src/widgets/styles/qwindowsstyle.cpp @@ -42,7 +42,6 @@ #if !defined(QT_NO_STYLE_WINDOWS) || defined(QT_PLUGIN) -#include <private/qsystemlibrary_p.h> #include "qapplication.h" #include "qbitmap.h" #include "qdrawutil.h" // for now @@ -87,26 +86,7 @@ QT_END_INCLUDE_NAMESPACE # define COLOR_GRADIENTINACTIVECAPTION 28 # endif - -typedef struct -{ - DWORD cbSize; - HICON hIcon; - int iSysImageIndex; - int iIcon; - WCHAR szPath[MAX_PATH]; -} QSHSTOCKICONINFO; - -#define _SHGFI_SMALLICON 0x000000001 -#define _SHGFI_LARGEICON 0x000000000 -#define _SHGFI_ICON 0x000000100 -#define _SIID_SHIELD 77 - -typedef HRESULT (WINAPI *PtrSHGetStockIconInfo)(int siid, int uFlags, QSHSTOCKICONINFO *psii); -static PtrSHGetStockIconInfo pSHGetStockIconInfo = 0; - Q_GUI_EXPORT HICON qt_pixmapToWinHICON(const QPixmap &); -Q_GUI_EXPORT QPixmap qt_pixmapFromWinHICON(HICON icon); #endif //Q_OS_WIN QT_BEGIN_INCLUDE_NAMESPACE @@ -122,13 +102,6 @@ enum QSliderDirection { SlUp, SlDown, SlLeft, SlRight }; QWindowsStylePrivate::QWindowsStylePrivate() : alt_down(false), menuBarTimer(0) { -#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) - if ((QSysInfo::WindowsVersion >= QSysInfo::WV_VISTA - && (QSysInfo::WindowsVersion & QSysInfo::WV_NT_based))) { - QSystemLibrary shellLib(QLatin1String("shell32")); - pSHGetStockIconInfo = (PtrSHGetStockIconInfo)shellLib.resolve("SHGetStockIconInfo"); - } -#endif } qreal QWindowsStylePrivate::appDevicePixelRatio() @@ -305,25 +278,15 @@ int QWindowsStylePrivate::pixelMetricFromSystemDp(QStyle::PixelMetric pm, const #if defined(Q_OS_WIN) && !defined(Q_OS_WINRT) switch (pm) { case QStyle::PM_DockWidgetFrameWidth: -# ifndef Q_OS_WINCE return GetSystemMetrics(SM_CXFRAME); -# else - return GetSystemMetrics(SM_CXDLGFRAME); -# endif - break; case QStyle::PM_TitleBarHeight: if (widget && (widget->windowType() == Qt::Tool)) { // MS always use one less than they say -# ifndef Q_OS_WINCE return GetSystemMetrics(SM_CYSMCAPTION) - 1; -# else - return GetSystemMetrics(SM_CYCAPTION) - 1; -# endif } return GetSystemMetrics(SM_CYCAPTION) - 1; -# ifndef Q_OS_WINCE case QStyle::PM_ScrollBarExtent: { NONCLIENTMETRICS ncm; @@ -332,14 +295,9 @@ int QWindowsStylePrivate::pixelMetricFromSystemDp(QStyle::PixelMetric pm, const return qMax(ncm.iScrollHeight, ncm.iScrollWidth); } break; -# endif // !Q_OS_WINCE case QStyle::PM_MdiSubWindowFrameWidth: -# ifndef Q_OS_WINCE return GetSystemMetrics(SM_CYFRAME); -# else - return GetSystemMetrics(SM_CYDLGFRAME); -# endif default: break; @@ -476,7 +434,7 @@ int QWindowsStyle::pixelMetric(PixelMetric pm, const QStyleOption *opt, const QW QPixmap QWindowsStyle::standardPixmap(StandardPixmap standardPixmap, const QStyleOption *opt, const QWidget *widget) const { -#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) && !defined(Q_OS_WINRT) +#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT) QPixmap desktopIcon; switch(standardPixmap) { case SP_DriveCDIcon: @@ -515,7 +473,7 @@ QPixmap QWindowsStyle::standardPixmap(StandardPixmap standardPixmap, const QStyl if (!desktopIcon.isNull()) { return desktopIcon; } -#endif // Q_OS_WIN && !Q_OS_WINCE && !Q_OS_WINRT +#endif // Q_OS_WIN && !Q_OS_WINRT return QCommonStyle::standardPixmap(standardPixmap, opt, widget); } @@ -592,12 +550,12 @@ int QWindowsStyle::styleHint(StyleHint hint, const QStyleOption *opt, const QWid #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) +#if defined(Q_OS_WIN) && !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 +#endif // Q_OS_WIN && !Q_OS_WINRT ret = 400; break; } |