Changeset 846 for trunk/src/gui/dialogs/qwizard_win.cpp
- Timestamp:
- May 5, 2011, 5:36:53 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/vendor/nokia/qt/4.7.2 (added) merged: 845 /branches/vendor/nokia/qt/current merged: 844 /branches/vendor/nokia/qt/4.6.3 removed
- Property svn:mergeinfo changed
-
trunk/src/gui/dialogs/qwizard_win.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 44 44 45 45 #include "qwizard_win_p.h" 46 #include "qlibrary.h"46 #include <private/qsystemlibrary_p.h> 47 47 #include "qwizard.h" 48 48 #include "qpaintengine.h" … … 181 181 { 182 182 ensurePolished(); 183 int width = 32, height = 32; 183 int size = int(QStyleHelper::dpiScaled(32)); 184 int width = size, height = size; 184 185 /* 185 186 HANDLE theme = pOpenThemeData(0, L"Navigation"); … … 214 215 //RECT rect; 215 216 RECT clipRect; 216 int xoffset = QWidget::mapToParent(r.topLeft()).x() ;217 int yoffset = QWidget::mapToParent(r.topLeft()).y() ;217 int xoffset = QWidget::mapToParent(r.topLeft()).x() - 1; 218 int yoffset = QWidget::mapToParent(r.topLeft()).y() - 1; 218 219 219 220 clipRect.top = r.top() + yoffset; … … 238 239 239 240 QVistaHelper::QVistaHelper(QWizard *wizard) 240 : pressed(false) 241 : QObject(wizard) 242 , pressed(false) 241 243 , wizard(wizard) 242 244 , backButton_(0) … … 245 247 if (is_vista) 246 248 backButton_ = new QVistaBackButton(wizard); 249 250 // Handle diff between Windows 7 and Vista 251 iconSpacing = QStyleHelper::dpiScaled(7); 252 textSpacing = QSysInfo::WindowsVersion >= QSysInfo::WV_WINDOWS7 ? 253 iconSpacing : QStyleHelper::dpiScaled(20); 247 254 } 248 255 … … 308 315 void QVistaHelper::drawTitleBar(QPainter *painter) 309 316 { 317 HDC hdc = painter->paintEngine()->getDC(); 318 310 319 if (vistaState() == VistaAero) 311 drawBlackRect( 312 QRect(0, 0, wizard->width(), titleBarSize() + topOffset()), 313 painter->paintEngine()->getDC()); 314 320 drawBlackRect(QRect(0, 0, wizard->width(), 321 titleBarSize() + topOffset()), hdc); 315 322 Q_ASSERT(backButton_); 316 323 const int btnTop = backButton_->mapToParent(QPoint()).y(); 317 324 const int btnHeight = backButton_->size().height(); 318 const int verticalCenter = (btnTop + btnHeight / 2); 319 320 wizard->windowIcon().paint( 321 painter, QRect(leftMargin(), verticalCenter - iconSize() / 2, iconSize(), iconSize())); 325 const int verticalCenter = (btnTop + btnHeight / 2) - 1; 322 326 323 327 const QString text = wizard->window()->windowTitle(); … … 327 331 int textHeight = brect.height(); 328 332 int textWidth = brect.width(); 333 int glowOffset = 0; 334 329 335 if (vistaState() == VistaAero) { 330 336 textHeight += 2 * glowSize(); 331 337 textWidth += 2 * glowSize(); 332 } 338 glowOffset = glowSize(); 339 } 340 333 341 drawTitleText( 334 342 painter, text, 335 QRect(titleOffset(), verticalCenter - textHeight / 2, textWidth, textHeight), 336 painter->paintEngine()->getDC()); 343 QRect(titleOffset() - glowOffset, verticalCenter - textHeight / 2, textWidth, textHeight), 344 hdc); 345 346 if (!wizard->windowIcon().isNull()) { 347 QRect rect(leftMargin(), verticalCenter - iconSize() / 2, iconSize(), iconSize()); 348 HICON hIcon = wizard->windowIcon().pixmap(iconSize()).toWinHICON(); 349 DrawIconEx(hdc, rect.left(), rect.top(), hIcon, 0, 0, 0, NULL, DI_NORMAL | DI_COMPAT); 350 DestroyIcon(hIcon); 351 } 337 352 } 338 353 … … 692 707 if (!tried) { 693 708 tried = true; 694 Q Library dwmLib(QString::fromAscii("dwmapi"));709 QSystemLibrary dwmLib(L"dwmapi"); 695 710 pDwmIsCompositionEnabled = 696 711 (PtrDwmIsCompositionEnabled)dwmLib.resolve("DwmIsCompositionEnabled"); … … 700 715 (PtrDwmExtendFrameIntoClientArea)dwmLib.resolve("DwmExtendFrameIntoClientArea"); 701 716 } 702 Q Library themeLib(QString::fromAscii("uxtheme"));717 QSystemLibrary themeLib(L"uxtheme"); 703 718 pIsAppThemed = (PtrIsAppThemed)themeLib.resolve("IsAppThemed"); 704 719 if (pIsAppThemed) { … … 734 749 int QVistaHelper::titleOffset() 735 750 { 736 int iconOffset = wizard ->windowIcon().isNull() ? 0 : iconSize() + padding();751 int iconOffset = wizard ->windowIcon().isNull() ? 0 : iconSize() + textSpacing; 737 752 return leftMargin() + iconOffset; 738 753 }
Note:
See TracChangeset
for help on using the changeset viewer.