diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2010-07-10 01:37:56 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2010-07-10 01:37:56 (GMT) |
commit | 6988f2bb36dafc2223c326b6fd21e49586b1379b (patch) | |
tree | 36ddaa20020353c998d30a127122cd6c5973d857 /src/gui/dialogs/qwizard_win.cpp | |
parent | 0de5087cf17e1c1c37da166b2f531525b9060d71 (diff) | |
parent | 1cfb16f694cf5649a8cef11bd096be3b20d06b36 (diff) | |
download | Qt-6988f2bb36dafc2223c326b6fd21e49586b1379b.zip Qt-6988f2bb36dafc2223c326b6fd21e49586b1379b.tar.gz Qt-6988f2bb36dafc2223c326b6fd21e49586b1379b.tar.bz2 |
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-1 into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-1: (59 commits)
Doc: Cleaning style and adding support for Creator
Add NTLMv2 authentication support to QAuthenticator.
QIODPLB: Sync behavior of ungetBlock() and ungetChar()
QFileIconProvider: Load icons on demand.
Doc: fixing offline style
Fix handling of SSL certificates with wildcard domain names
Doc: fixing examples link
doc: Fixed several qdoc warnings.
doc: Fixed several qdoc warnings.
SSL library loading: load system libs only once
Revert "SSL backend: load libraries for certificates only once"
doc: Fixed several qdoc warnings.
doc: Fixed several qdoc warnings.
doc: Fixed several qdoc warnings.
doc: Fixed several qdoc warnings.
doc: Fixed several qdoc warnings.
Doc: Adding support for Qt Creator style
doc: Fixed last of the declarative/QML qdoc warnings.
qdoc: Marked some missing declarative properties and functions as \internal.
qhelpgenerator: Fix namespace syntax checking.
...
Diffstat (limited to 'src/gui/dialogs/qwizard_win.cpp')
-rw-r--r-- | src/gui/dialogs/qwizard_win.cpp | 42 |
1 files changed, 28 insertions, 14 deletions
diff --git a/src/gui/dialogs/qwizard_win.cpp b/src/gui/dialogs/qwizard_win.cpp index e406cba..ad8801a 100644 --- a/src/gui/dialogs/qwizard_win.cpp +++ b/src/gui/dialogs/qwizard_win.cpp @@ -180,7 +180,8 @@ QVistaBackButton::QVistaBackButton(QWidget *widget) QSize QVistaBackButton::sizeHint() const { ensurePolished(); - int width = 32, height = 32; + int size = int(QStyleHelper::dpiScaled(32)); + int width = size, height = size; /* HANDLE theme = pOpenThemeData(0, L"Navigation"); SIZE size; @@ -213,8 +214,8 @@ void QVistaBackButton::paintEvent(QPaintEvent *) HANDLE theme = pOpenThemeData(0, L"Navigation"); //RECT rect; RECT clipRect; - int xoffset = QWidget::mapToParent(r.topLeft()).x(); - int yoffset = QWidget::mapToParent(r.topLeft()).y(); + int xoffset = QWidget::mapToParent(r.topLeft()).x() - 1; + int yoffset = QWidget::mapToParent(r.topLeft()).y() - 1; clipRect.top = r.top() + yoffset; clipRect.bottom = r.bottom() + yoffset; @@ -245,6 +246,11 @@ QVistaHelper::QVistaHelper(QWizard *wizard) is_vista = resolveSymbols(); if (is_vista) backButton_ = new QVistaBackButton(wizard); + + // Handle diff between Windows 7 and Vista + iconSpacing = QStyleHelper::dpiScaled(7); + textSpacing = QSysInfo::WindowsVersion >= QSysInfo::WV_WINDOWS7 ? + iconSpacing : QStyleHelper::dpiScaled(20); } QVistaHelper::~QVistaHelper() @@ -308,18 +314,15 @@ bool QVistaHelper::setDWMTitleBar(TitleBarChangeType type) void QVistaHelper::drawTitleBar(QPainter *painter) { - if (vistaState() == VistaAero) - drawBlackRect( - QRect(0, 0, wizard->width(), titleBarSize() + topOffset()), - painter->paintEngine()->getDC()); + HDC hdc = painter->paintEngine()->getDC(); + if (vistaState() == VistaAero) + drawBlackRect(QRect(0, 0, wizard->width(), + titleBarSize() + topOffset()), hdc); Q_ASSERT(backButton_); const int btnTop = backButton_->mapToParent(QPoint()).y(); const int btnHeight = backButton_->size().height(); - const int verticalCenter = (btnTop + btnHeight / 2); - - wizard->windowIcon().paint( - painter, QRect(leftMargin(), verticalCenter - iconSize() / 2, iconSize(), iconSize())); + const int verticalCenter = (btnTop + btnHeight / 2) - 1; const QString text = wizard->window()->windowTitle(); const QFont font = QApplication::font("QWorkspaceTitleBar"); @@ -327,14 +330,25 @@ void QVistaHelper::drawTitleBar(QPainter *painter) const QRect brect = fontMetrics.boundingRect(text); int textHeight = brect.height(); int textWidth = brect.width(); + int glowOffset = 0; + if (vistaState() == VistaAero) { textHeight += 2 * glowSize(); textWidth += 2 * glowSize(); + glowOffset = glowSize(); } + drawTitleText( painter, text, - QRect(titleOffset(), verticalCenter - textHeight / 2, textWidth, textHeight), - painter->paintEngine()->getDC()); + QRect(titleOffset() - glowOffset, verticalCenter - textHeight / 2, textWidth, textHeight), + hdc); + + if (!wizard->windowIcon().isNull()) { + QRect rect(leftMargin(), verticalCenter - iconSize() / 2, iconSize(), iconSize()); + HICON hIcon = wizard->windowIcon().pixmap(iconSize()).toWinHICON(); + DrawIconEx(hdc, rect.left(), rect.top(), hIcon, 0, 0, 0, NULL, DI_NORMAL | DI_COMPAT); + DestroyIcon(hIcon); + } } void QVistaHelper::setTitleBarIconAndCaptionVisible(bool visible) @@ -734,7 +748,7 @@ bool QVistaHelper::resolveSymbols() int QVistaHelper::titleOffset() { - int iconOffset = wizard ->windowIcon().isNull() ? 0 : iconSize() + padding(); + int iconOffset = wizard ->windowIcon().isNull() ? 0 : iconSize() + textSpacing; return leftMargin() + iconOffset; } |