| 1 | // Copyright (C) 2016 The Qt Company Ltd. |
| 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only |
| 3 | |
| 4 | #ifndef QWINDOWSSTYLE_P_P_H |
| 5 | #define QWINDOWSSTYLE_P_P_H |
| 6 | |
| 7 | // |
| 8 | // W A R N I N G |
| 9 | // ------------- |
| 10 | // |
| 11 | // This file is not part of the Qt API. It exists for the convenience |
| 12 | // of qapplication_*.cpp, qwidget*.cpp and qfiledialog.cpp. This header |
| 13 | // file may change from version to version without notice, or even be removed. |
| 14 | // |
| 15 | // We mean it. |
| 16 | // |
| 17 | |
| 18 | #include <QtWidgets/private/qtwidgetsglobal_p.h> |
| 19 | #include "qwindowsstyle_p.h" |
| 20 | #include "qcommonstyle_p.h" |
| 21 | |
| 22 | #if QT_CONFIG(style_windows) |
| 23 | #include <qlist.h> |
| 24 | |
| 25 | QT_BEGIN_NAMESPACE |
| 26 | |
| 27 | class Q_WIDGETS_EXPORT QWindowsStylePrivate : public QCommonStylePrivate |
| 28 | { |
| 29 | Q_DECLARE_PUBLIC(QWindowsStyle) |
| 30 | public: |
| 31 | enum { InvalidMetric = -23576 }; |
| 32 | |
| 33 | QWindowsStylePrivate(); |
| 34 | static int pixelMetricFromSystemDp(QStyle::PixelMetric pm, const QStyleOption *option = nullptr, const QWidget *widget = nullptr); |
| 35 | static int fixedPixelMetric(QStyle::PixelMetric pm); |
| 36 | static qreal nativeMetricScaleFactor(const QWidget *widget = nullptr); |
| 37 | |
| 38 | bool hasSeenAlt(const QWidget *widget) const; |
| 39 | bool altDown() const { return alt_down; } |
| 40 | bool alt_down = false; |
| 41 | QList<const QWidget *> seenAlt; |
| 42 | |
| 43 | QColor inactiveCaptionText; |
| 44 | QColor activeCaptionColor; |
| 45 | QColor activeGradientCaptionColor; |
| 46 | QColor inactiveCaptionColor; |
| 47 | QColor inactiveGradientCaptionColor; |
| 48 | |
| 49 | enum { |
| 50 | windowsItemFrame = 2, // menu item frame width |
| 51 | windowsSepHeight = 9, // separator item height |
| 52 | windowsItemHMargin = 3, // menu item hor text margin |
| 53 | windowsItemVMargin = 2, // menu item ver text margin |
| 54 | windowsArrowHMargin = 6, // arrow horizontal margin |
| 55 | windowsRightBorder = 15, // right border on windows |
| 56 | windowsCheckMarkWidth = 12 // checkmarks width on windows |
| 57 | }; |
| 58 | }; |
| 59 | |
| 60 | QT_END_NAMESPACE |
| 61 | |
| 62 | #endif // style_windows |
| 63 | |
| 64 | #endif //QWINDOWSSTYLE_P_P_H |
| 65 | ; |
| 66 | |