Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qwizard_win.cpp
Go to the documentation of this file.
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// Qt-Security score:significant reason:default
4
5#include <QtWidgets/private/qtwidgetsglobal_p.h>
6
7#if QT_CONFIG(style_windowsvista)
8
9#include "qwizard_win_p.h"
10#include <private/qapplication_p.h>
11#include <private/qwindowsfontdatabasebase_p.h>
12#include <qpa/qplatformwindow.h>
13#include <qpa/qplatformwindow_p.h>
14#include "qwizard.h"
15#include "qpaintengine.h"
16#include "qapplication.h"
17#include <QtCore/QOperatingSystemVersion>
18#include <QtCore/QVariant>
19#include <QtCore/QDebug>
20#include <QtGui/QMouseEvent>
21#include <QtGui/QWindow>
22#include <QtGui/private/qhighdpiscaling_p.h>
23
24#include <uxtheme.h>
25#include <vssym32.h>
26#include <dwmapi.h>
27
28// ### move to qmargins.h
29Q_DECLARE_METATYPE(QMargins)
30
31#ifndef WM_DWMCOMPOSITIONCHANGED
32# define WM_DWMCOMPOSITIONCHANGED 0x031E
33#endif
34
35QT_BEGIN_NAMESPACE
36
37qreal QVistaHelper::m_devicePixelRatio = 1.0;
38
39/******************************************************************************
40** QVistaBackButton
41*/
42
43QVistaBackButton::QVistaBackButton(QWidget *widget)
44 : QAbstractButton(widget)
45{
46 setFocusPolicy(Qt::NoFocus);
47 // Native dialogs use ALT-Left even in RTL mode, so do the same, even if it might be counter-intuitive.
48#if QT_CONFIG(shortcut)
49 setShortcut(QKeySequence(Qt::ALT | Qt::Key_Left));
50#endif
51}
52
53QSize QVistaBackButton::sizeHint() const
54{
55 ensurePolished();
56 int size = int(QStyleHelper::dpiScaled(32, this));
57 int width = size, height = size;
58 return QSize(width, height);
59}
60
61void QVistaBackButton::enterEvent(QEnterEvent *event)
62{
63 if (isEnabled())
64 update();
65 QAbstractButton::enterEvent(event);
66}
67
68void QVistaBackButton::leaveEvent(QEvent *event)
69{
70 if (isEnabled())
71 update();
72 QAbstractButton::leaveEvent(event);
73}
74
75void QVistaBackButton::paintEvent(QPaintEvent *)
76{
77 QPainter p(this);
78 QRect r = rect();
79 const HANDLE theme = OpenThemeData(0, L"Navigation");
80 //RECT rect;
81 QPoint origin;
82 const HDC hdc = QVistaHelper::backingStoreDC(parentWidget(), &origin);
83 RECT clipRect;
84 int xoffset = origin.x() + QWidget::mapToParent(r.topLeft()).x() - 1;
85 int yoffset = origin.y() + QWidget::mapToParent(r.topLeft()).y() - 1;
86 const qreal dpr = devicePixelRatio();
87 const QRect rDp = QRect(r.topLeft() * dpr, r.size() * dpr);
88 const int xoffsetDp = xoffset * dpr;
89 const int yoffsetDp = yoffset * dpr;
90
91 clipRect.top = rDp.top() + yoffsetDp;
92 clipRect.bottom = rDp.bottom() + yoffsetDp;
93 clipRect.left = rDp.left() + xoffsetDp;
94 clipRect.right = rDp.right() + xoffsetDp;
95
96 int state = NAV_BB_NORMAL;
97 if (!isEnabled())
98 state = NAV_BB_DISABLED;
99 else if (isDown())
100 state = NAV_BB_PRESSED;
101 else if (underMouse())
102 state = NAV_BB_HOT;
103
104 DrawThemeBackground(theme, hdc,
105 layoutDirection() == Qt::LeftToRight ? NAV_BACKBUTTON : NAV_FORWARDBUTTON,
106 state, &clipRect, &clipRect);
107}
108
109/******************************************************************************
110** QVistaHelper
111*/
112
113QVistaHelper::QVistaHelper(QWizard *wizard)
114 : QObject(wizard)
115 , pressed(false)
116 , wizard(wizard)
117 , backButton_(0)
118{
119 QVistaHelper::m_devicePixelRatio = wizard->devicePixelRatio();
120
121 backButton_ = new QVistaBackButton(wizard);
122 backButton_->hide();
123
124 iconSpacing = QStyleHelper::dpiScaled(7, wizard);
125}
126
127QVistaHelper::~QVistaHelper() = default;
128
129void QVistaHelper::updateCustomMargins(bool vistaMargins)
130{
131 using namespace QNativeInterface::Private;
132
133 if (QWindow *window = wizard->windowHandle()) {
134 // Reduce top frame to zero since we paint it ourselves. Use
135 // device pixel to avoid rounding errors.
136 const QMargins customMarginsDp = vistaMargins
137 ? QMargins(0, -titleBarSizeDp(), 0, 0)
138 : QMargins();
139 const QVariant customMarginsV = QVariant::fromValue(customMarginsDp);
140 // The dynamic property takes effect when creating the platform window.
141 window->setProperty("_q_windowsCustomMargins", customMarginsV);
142 // If a platform window exists, change via native interface.
143 if (auto platformWindow = dynamic_cast<QWindowsWindow *>(window->handle()))
144 platformWindow->setCustomMargins(customMarginsDp);
145 }
146}
147
148void QVistaHelper::disconnectBackButton()
149{
150 if (backButton_) // Leave QStyleSheetStyle's connections on destroyed() intact.
151 backButton_->disconnect(SIGNAL(clicked()));
152}
153
154QColor QVistaHelper::basicWindowFrameColor()
155{
156 DWORD rgb;
157 const HANDLE hTheme = OpenThemeData(GetDesktopWindow(), L"WINDOW");
158 GetThemeColor(hTheme, WP_CAPTION, CS_ACTIVE,
159 wizard->isActiveWindow() ? TMT_FILLCOLORHINT : TMT_BORDERCOLORHINT, &rgb);
160 BYTE r = GetRValue(rgb);
161 BYTE g = GetGValue(rgb);
162 BYTE b = GetBValue(rgb);
163 return QColor(r, g, b);
164}
165
166bool QVistaHelper::setDWMTitleBar(TitleBarChangeType type)
167{
168 MARGINS mar = {0, 0, 0, 0};
169 if (type == NormalTitleBar)
170 mar.cyTopHeight = 0;
171 else
172 mar.cyTopHeight = (titleBarSize() + topOffset(wizard)) * QVistaHelper::m_devicePixelRatio;
173 if (const HWND wizardHandle = wizardHWND()) {
174 if (SUCCEEDED(DwmExtendFrameIntoClientArea(wizardHandle, &mar)))
175 return true;
176 }
177 return false;
178}
179
180Q_GUI_EXPORT HICON qt_pixmapToWinHICON(const QPixmap &);
181
182static LOGFONT getCaptionLogFont(HANDLE hTheme)
183{
184 LOGFONT result = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, { 0 } };
185
186 if (!hTheme || FAILED(GetThemeSysFont(hTheme, TMT_CAPTIONFONT, &result))) {
187 NONCLIENTMETRICS ncm;
188 ncm.cbSize = sizeof(NONCLIENTMETRICS);
189 SystemParametersInfo(SPI_GETNONCLIENTMETRICS, sizeof(NONCLIENTMETRICS), &ncm, false);
190 result = ncm.lfMessageFont;
191 }
192 return result;
193}
194
195static bool getCaptionQFont(int dpi, QFont *result)
196{
197 const HANDLE hTheme = OpenThemeData(GetDesktopWindow(), L"WINDOW");
198 if (!hTheme)
199 return false;
200 // Call into QWindowsNativeInterface to convert the LOGFONT into a QFont.
201 const LOGFONT logFont = getCaptionLogFont(hTheme);
202 *result = QWindowsFontDatabaseBase::LOGFONT_to_QFont(logFont, dpi);
203 return true;
204}
205
206void QVistaHelper::drawTitleBar(QPainter *painter)
207{
208 Q_ASSERT(backButton_);
209 QPoint origin;
210 const bool isWindow = wizard->isWindow();
211 const HDC hdc = QVistaHelper::backingStoreDC(wizard, &origin);
212
213 if (isWindow)
214 drawBlackRect(QRect(0, 0, wizard->width(),
215 titleBarSize() + topOffset(wizard)), hdc);
216 // The button is positioned in QWizardPrivate::handleAeroStyleChange(),
217 // all calculation is relative to it.
218 const int btnTop = backButton_->mapToParent(QPoint()).y();
219 const int btnHeight = backButton_->size().height();
220 const int verticalCenter = (btnTop + btnHeight / 2) - 1;
221
222 const QString text = wizard->window()->windowTitle();
223 QFont font;
224 if (!isWindow || !getCaptionQFont(wizard->logicalDpiY() * wizard->devicePixelRatio(), &font))
225 font = QApplication::font("QMdiSubWindowTitleBar");
226 const QFontMetrics fontMetrics(font);
227 const QRect brect = fontMetrics.boundingRect(text);
228 const int glowOffset = glowSize(wizard);
229 int textHeight = brect.height() + 2 * glowOffset;
230 int textWidth = brect.width() + 2 * glowOffset;
231
232 const int titleLeft = (wizard->layoutDirection() == Qt::LeftToRight
233 ? titleOffset() - glowOffset
234 : wizard->width() - titleOffset() - textWidth + glowOffset);
235
236 const QRect textRectangle(titleLeft, verticalCenter - textHeight / 2, textWidth, textHeight);
237 if (isWindow) {
238 drawTitleText(painter, text, textRectangle, hdc);
239 } else {
240 painter->save();
241 painter->setFont(font);
242 painter->drawText(textRectangle, Qt::AlignVCenter | Qt::AlignHCenter, text);
243 painter->restore();
244 }
245
246 const QIcon windowIcon = wizard->windowIcon();
247 if (!windowIcon.isNull()) {
248 const int size = QVistaHelper::iconSize(wizard);
249 const int iconLeft = (wizard->layoutDirection() == Qt::LeftToRight
250 ? leftMargin(wizard)
251 : wizard->width() - leftMargin(wizard) - size);
252
253 const QPoint pos(origin.x() + iconLeft, origin.y() + verticalCenter - size / 2);
254 const QPoint posDp = pos * QVistaHelper::m_devicePixelRatio;
255 const HICON hIcon = qt_pixmapToWinHICON(windowIcon.pixmap(QSize(size, size), QVistaHelper::m_devicePixelRatio));
256 DrawIconEx(hdc, posDp.x(), posDp.y(), hIcon, 0, 0, 0, NULL, DI_NORMAL | DI_COMPAT);
257 DestroyIcon(hIcon);
258 }
259}
260
261void QVistaHelper::setTitleBarIconAndCaptionVisible(bool visible)
262{
263 WTA_OPTIONS opt;
264 opt.dwFlags = WTNCA_NODRAWICON | WTNCA_NODRAWCAPTION;
265 if (visible)
266 opt.dwMask = 0;
267 else
268 opt.dwMask = WTNCA_NODRAWICON | WTNCA_NODRAWCAPTION;
269 if (const HWND handle = wizardHWND())
270 SetWindowThemeAttribute(handle, WTA_NONCLIENT, &opt, sizeof(WTA_OPTIONS));
271}
272
273bool QVistaHelper::winEvent(MSG* msg, qintptr *result)
274{
275 switch (msg->message) {
276 case WM_NCHITTEST: {
277 LRESULT lResult;
278 // Perform hit testing using DWM
279 if (DwmDefWindowProc(msg->hwnd, msg->message, msg->wParam, msg->lParam, &lResult)) {
280 // DWM returned a hit, no further processing necessary
281 *result = lResult;
282 } else {
283 // DWM didn't return a hit, process using DefWindowProc
284 lResult = DefWindowProc(msg->hwnd, msg->message, msg->wParam, msg->lParam);
285 // If DefWindowProc returns a window caption button, just return HTCLIENT (client area).
286 // This avoid unnecessary hits to Windows NT style caption buttons which aren't visible but are
287 // located just under the Aero style window close button.
288 if (lResult == HTCLOSE || lResult == HTMAXBUTTON || lResult == HTMINBUTTON || lResult == HTHELP)
289 *result = HTCLIENT;
290 else
291 *result = lResult;
292 }
293 break;
294 }
295 default:
296 LRESULT lResult;
297 // Pass to DWM to handle
298 if (DwmDefWindowProc(msg->hwnd, msg->message, msg->wParam, msg->lParam, &lResult))
299 *result = lResult;
300 // If the message wasn't handled by DWM, continue processing it as normal
301 else
302 return false;
303 }
304
305 return true;
306}
307
308void QVistaHelper::setMouseCursor(QPoint pos)
309{
310#ifndef QT_NO_CURSOR
311 if (rtTop.contains(pos))
312 wizard->setCursor(Qt::SizeVerCursor);
313 else
314 wizard->setCursor(Qt::ArrowCursor);
315#endif
316}
317
318void QVistaHelper::mouseEvent(QEvent *event)
319{
320 switch (event->type()) {
321 case QEvent::MouseMove:
322 mouseMoveEvent(static_cast<QMouseEvent *>(event));
323 break;
324 case QEvent::MouseButtonPress:
325 mousePressEvent(static_cast<QMouseEvent *>(event));
326 break;
327 case QEvent::MouseButtonRelease:
328 mouseReleaseEvent(static_cast<QMouseEvent *>(event));
329 break;
330 default:
331 break;
332 }
333}
334
335bool QVistaHelper::handleWinEvent(MSG *message, qintptr *result)
336{
337 bool status = false;
338 if (wizard->wizardStyle() == QWizard::AeroStyle) {
339 status = winEvent(message, result);
340 if (message->message == WM_NCPAINT)
341 wizard->update();
342 }
343 return status;
344}
345
346void QVistaHelper::resizeEvent(QResizeEvent * event)
347{
348 Q_UNUSED(event);
349 rtTop = QRect (0, 0, wizard->width(), frameSize());
350 int height = captionSize() + topOffset(wizard);
351 rtTitle = QRect (0, frameSize(), wizard->width(), height);
352}
353
354void QVistaHelper::paintEvent(QPaintEvent *event)
355{
356 Q_UNUSED(event);
357 QPainter painter(wizard);
358 drawTitleBar(&painter);
359}
360
361void QVistaHelper::mouseMoveEvent(QMouseEvent *event)
362{
363 if (wizard->windowState() & Qt::WindowMaximized) {
364 event->ignore();
365 return;
366 }
367
368 QRect rect = wizard->geometry();
369 if (pressed) {
370 switch (change) {
371 case resizeTop:
372 {
373 const int dy = event->pos().y() - pressedPos.y();
374 if ((dy > 0 && rect.height() > wizard->minimumHeight())
375 || (dy < 0 && rect.height() < wizard->maximumHeight()))
376 rect.setTop(rect.top() + dy);
377 }
378 break;
379 case movePosition: {
380 QPoint newPos = event->pos() - pressedPos;
381 rect.moveLeft(rect.left() + newPos.x());
382 rect.moveTop(rect.top() + newPos.y());
383 break; }
384 default:
385 break;
386 }
387 wizard->setGeometry(rect);
388
389 } else {
390 setMouseCursor(event->pos());
391 }
392 event->ignore();
393}
394
395void QVistaHelper::mousePressEvent(QMouseEvent *event)
396{
397 change = noChange;
398
399 if (event->button() != Qt::LeftButton || wizard->windowState() & Qt::WindowMaximized) {
400 event->ignore();
401 return;
402 }
403
404 if (rtTitle.contains(event->pos())) {
405 change = movePosition;
406 } else if (rtTop.contains(event->pos()))
407 change = resizeTop;
408
409 if (change != noChange) {
410 setMouseCursor(event->pos());
411 pressed = true;
412 pressedPos = event->pos();
413 } else {
414 event->ignore();
415 }
416}
417
418void QVistaHelper::mouseReleaseEvent(QMouseEvent *event)
419{
420 change = noChange;
421 if (pressed) {
422 pressed = false;
423 wizard->releaseMouse();
424 setMouseCursor(event->pos());
425 }
426 event->ignore();
427}
428
429static inline LPARAM pointToLParam(const QPointF &p, const QWidget *w)
430{
431 const auto point = QHighDpi::toNativePixels(p, w->screen()).toPoint();
432 return MAKELPARAM(point.x(), point.y());
433}
434
435bool QVistaHelper::eventFilter(QObject *obj, QEvent *event)
436{
437 if (obj != wizard)
438 return QObject::eventFilter(obj, event);
439
440 if (event->type() == QEvent::MouseMove) {
441 QMouseEvent *mouseEvent = static_cast<QMouseEvent*>(event);
442 qintptr result;
443 MSG msg;
444 msg.message = WM_NCHITTEST;
445 msg.wParam = 0;
446 msg.lParam = pointToLParam(mouseEvent->globalPosition(), wizard);
447 msg.hwnd = wizardHWND();
448 winEvent(&msg, &result);
449 msg.wParam = result;
450 msg.message = WM_NCMOUSEMOVE;
451 winEvent(&msg, &result);
452 } else if (event->type() == QEvent::MouseButtonPress) {
453 QMouseEvent *mouseEvent = static_cast<QMouseEvent*>(event);
454
455 if (mouseEvent->button() == Qt::LeftButton) {
456 qintptr result;
457 MSG msg;
458 msg.message = WM_NCHITTEST;
459 msg.wParam = 0;
460 msg.lParam = pointToLParam(mouseEvent->globalPosition(), wizard);
461 msg.hwnd = wizardHWND();
462 winEvent(&msg, &result);
463 msg.wParam = result;
464 msg.message = WM_NCLBUTTONDOWN;
465 winEvent(&msg, &result);
466 }
467 } else if (event->type() == QEvent::MouseButtonRelease) {
468 QMouseEvent *mouseEvent = static_cast<QMouseEvent*>(event);
469
470 if (mouseEvent->button() == Qt::LeftButton) {
471 qintptr result;
472 MSG msg;
473 msg.message = WM_NCHITTEST;
474 msg.wParam = 0;
475 msg.lParam = pointToLParam(mouseEvent->globalPosition(), wizard);
476 msg.hwnd = wizardHWND();
477 winEvent(&msg, &result);
478 msg.wParam = result;
479 msg.message = WM_NCLBUTTONUP;
480 winEvent(&msg, &result);
481 }
482 }
483
484 return false;
485}
486
487// Return a HDC for the wizard along with the transformation if the
488// wizard is a child window.
489HDC QVistaHelper::backingStoreDC(const QWidget *wizard, QPoint *offset)
490{
491 HDC hdc = static_cast<HDC>(QGuiApplication::platformNativeInterface()->nativeResourceForBackingStore(QByteArrayLiteral("getDC"), wizard->backingStore()));
492 *offset = QPoint(0, 0);
493 if (!wizard->windowHandle())
494 if (QWidget *nativeParent = wizard->nativeParentWidget())
495 *offset = wizard->mapTo(nativeParent, *offset);
496 return hdc;
497}
498
499HWND QVistaHelper::wizardHWND() const
500{
501 // Obtain the HWND if the wizard is a top-level window.
502 // Do not use winId() as this enforces native children of the parent
503 // widget when called before show() as happens when calling setWizardStyle().
504 if (QWindow *window = wizard->windowHandle())
505 if (window->handle())
506 if (void *vHwnd = QGuiApplication::platformNativeInterface()->nativeResourceForWindow(QByteArrayLiteral("handle"), window))
507 return static_cast<HWND>(vHwnd);
508 qWarning().nospace() << "Failed to obtain HWND for wizard.";
509 return 0;
510}
511
512void QVistaHelper::drawTitleText(QPainter *painter, const QString &text, const QRect &rect, HDC hdc)
513{
514 Q_UNUSED(painter);
515
516 const QRect rectDp = QRect(rect.topLeft() * QVistaHelper::m_devicePixelRatio,
517 rect.size() * QVistaHelper::m_devicePixelRatio);
518 const HANDLE hTheme = OpenThemeData(GetDesktopWindow(), L"WINDOW");
519 if (!hTheme)
520 return;
521 // Set up a memory DC and bitmap that we'll draw into
522 HDC dcMem;
523 HBITMAP bmp;
524 BITMAPINFO dib;
525 ZeroMemory(&dib, sizeof(dib));
526 dcMem = CreateCompatibleDC(hdc);
527
528 dib.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
529 dib.bmiHeader.biWidth = rectDp.width();
530 dib.bmiHeader.biHeight = -rectDp.height();
531 dib.bmiHeader.biPlanes = 1;
532 dib.bmiHeader.biBitCount = 32;
533 dib.bmiHeader.biCompression = BI_RGB;
534
535 bmp = CreateDIBSection(hdc, &dib, DIB_RGB_COLORS, NULL, NULL, 0);
536
537 // Set up the DC
538 const LOGFONT captionLogFont = getCaptionLogFont(hTheme);
539 const HFONT hCaptionFont = CreateFontIndirect(&captionLogFont);
540 auto hOldBmp = reinterpret_cast<HBITMAP>(SelectObject(dcMem, (HGDIOBJ) bmp));
541 auto hOldFont = reinterpret_cast<HFONT>(SelectObject(dcMem, (HGDIOBJ) hCaptionFont));
542
543 // Draw the text!
544 DTTOPTS dto;
545 memset(&dto, 0, sizeof(dto));
546 dto.dwSize = sizeof(dto);
547 const UINT uFormat = DT_SINGLELINE|DT_CENTER|DT_VCENTER|DT_NOPREFIX;
548 RECT rctext ={0,0, rectDp.width(), rectDp.height()};
549
550 dto.dwFlags = DTT_COMPOSITED|DTT_GLOWSIZE;
551 dto.iGlowSize = glowSize(wizard);
552
553 DrawThemeTextEx(hTheme, dcMem, 0, 0, reinterpret_cast<LPCWSTR>(text.utf16()), -1, uFormat, &rctext, &dto );
554 BitBlt(hdc, rectDp.left(), rectDp.top(), rectDp.width(), rectDp.height(), dcMem, 0, 0, SRCCOPY);
555 SelectObject(dcMem, (HGDIOBJ) hOldBmp);
556 SelectObject(dcMem, (HGDIOBJ) hOldFont);
557 DeleteObject(bmp);
558 DeleteObject(hCaptionFont);
559 DeleteDC(dcMem);
560 //ReleaseDC(hwnd, hdc);
561}
562
563void QVistaHelper::drawBlackRect(const QRect &rect, HDC hdc)
564{
565 // Set up a memory DC and bitmap that we'll draw into
566 const QRect rectDp = QRect(rect.topLeft() * QVistaHelper::m_devicePixelRatio,
567 rect.size() * QVistaHelper::m_devicePixelRatio);
568 HDC dcMem;
569 HBITMAP bmp;
570 BITMAPINFO dib;
571 ZeroMemory(&dib, sizeof(dib));
572 dcMem = CreateCompatibleDC(hdc);
573
574 dib.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
575 dib.bmiHeader.biWidth = rectDp.width();
576 dib.bmiHeader.biHeight = -rectDp.height();
577 dib.bmiHeader.biPlanes = 1;
578 dib.bmiHeader.biBitCount = 32;
579 dib.bmiHeader.biCompression = BI_RGB;
580
581 bmp = CreateDIBSection(hdc, &dib, DIB_RGB_COLORS, NULL, NULL, 0);
582 auto hOldBmp = reinterpret_cast<HBITMAP>(SelectObject(dcMem, (HGDIOBJ) bmp));
583
584 BitBlt(hdc, rectDp.left(), rectDp.top(), rectDp.width(), rectDp.height(), dcMem, 0, 0, SRCCOPY);
585 SelectObject(dcMem, (HGDIOBJ) hOldBmp);
586
587 DeleteObject(bmp);
588 DeleteDC(dcMem);
589}
590
591int QVistaHelper::frameSizeDp()
592{
593 return GetSystemMetrics(SM_CXSIZEFRAME) + GetSystemMetrics(SM_CXPADDEDBORDER);
594}
595
596int QVistaHelper::captionSizeDp()
597{
598 return GetSystemMetrics(SM_CYCAPTION);
599}
600
601int QVistaHelper::titleOffset()
602{
603 int iconOffset = wizard ->windowIcon().isNull() ? 0 : iconSize(wizard) + iconSpacing;
604 return leftMargin(wizard) + iconOffset;
605}
606
607int QVistaHelper::iconSize(const QPaintDevice *device)
608{
609 return QStyleHelper::dpiScaled(16, device); // Standard Aero
610}
611
612int QVistaHelper::glowSize(const QPaintDevice *device)
613{
614 return QStyleHelper::dpiScaled(10, device);
615}
616
617int QVistaHelper::topOffset(const QPaintDevice *device)
618{
619 static const int aeroOffset = QStyleHelper::dpiScaled(13, device);
620 return aeroOffset + titleBarSize();
621}
622
623QT_END_NAMESPACE
624
625#endif // style_windowsvista