Changeset 865 for trunk/src/gui
- Timestamp:
- May 16, 2011, 4:09:34 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/vendor/nokia/qt/4.7.3 (added) merged: 864 /branches/vendor/nokia/qt/current merged: 863 /branches/vendor/nokia/qt/4.7.2 removed
- Property svn:mergeinfo changed
-
trunk/src/gui/image/qpixmap_s60.cpp
r846 r865 600 600 } 601 601 602 Q_GUI_EXPORT int qt_defaultDpiX(); 603 Q_GUI_EXPORT int qt_defaultDpiY(); 604 602 605 int QS60PixmapData::metric(QPaintDevice::PaintDeviceMetric metric) const 603 606 { … … 610 613 case QPaintDevice::PdmHeight: 611 614 return cfbsBitmap->SizeInPixels().iHeight; 612 case QPaintDevice::PdmWidthMM: { 613 TInt twips = cfbsBitmap->SizeInTwips().iWidth; 614 return (int)(twips * (25.4/KTwipsPerInch)); 615 } 616 case QPaintDevice::PdmHeightMM: { 617 TInt twips = cfbsBitmap->SizeInTwips().iHeight; 618 return (int)(twips * (25.4/KTwipsPerInch)); 619 } 615 case QPaintDevice::PdmWidthMM: 616 return qRound(cfbsBitmap->SizeInPixels().iWidth * 25.4 / qt_defaultDpiX()); 617 case QPaintDevice::PdmHeightMM: 618 return qRound(cfbsBitmap->SizeInPixels().iHeight * 25.4 / qt_defaultDpiY()); 620 619 case QPaintDevice::PdmNumColors: 621 620 return TDisplayModeUtils::NumDisplayModeColors(cfbsBitmap->DisplayMode()); 622 621 case QPaintDevice::PdmDpiX: 623 case QPaintDevice::PdmPhysicalDpiX: { 624 TReal inches = cfbsBitmap->SizeInTwips().iWidth / (TReal)KTwipsPerInch; 625 TInt pixels = cfbsBitmap->SizeInPixels().iWidth; 626 return pixels / inches; 627 } 622 case QPaintDevice::PdmPhysicalDpiX: 623 return qt_defaultDpiX(); 628 624 case QPaintDevice::PdmDpiY: 629 case QPaintDevice::PdmPhysicalDpiY: { 630 TReal inches = cfbsBitmap->SizeInTwips().iHeight / (TReal)KTwipsPerInch; 631 TInt pixels = cfbsBitmap->SizeInPixels().iHeight; 632 return pixels / inches; 633 } 625 case QPaintDevice::PdmPhysicalDpiY: 626 return qt_defaultDpiY(); 634 627 case QPaintDevice::PdmDepth: 635 628 return TDisplayModeUtils::NumDisplayModeBitsPerPixel(cfbsBitmap->DisplayMode()); -
trunk/src/gui/kernel/qapplication_s60.cpp
r846 r865 1244 1244 qwidget->d_func()->setWindowTitle_sys(qwidget->windowTitle()); 1245 1245 #ifdef Q_WS_S60 1246 // If widget is fullscreen/minimized, hide status pane and button container otherwise show them. 1247 QWidget *const window = qwidget->window(); 1248 if (!window->parentWidget()) { // Only top level native windows have control over cba/status pane 1249 const bool decorationsVisible = !(window->windowState() & (Qt::WindowFullScreen | Qt::WindowMinimized)); 1250 const bool statusPaneVisibility = decorationsVisible; 1251 const bool isFullscreen = window->windowState() & Qt::WindowFullScreen; 1252 const bool cbaVisibilityHint = window->windowFlags() & Qt::WindowSoftkeysVisibleHint; 1253 const bool buttonGroupVisibility = (decorationsVisible || (isFullscreen && cbaVisibilityHint)); 1254 S60->setStatusPaneAndButtonGroupVisibility(statusPaneVisibility, buttonGroupVisibility); 1246 if (qwidget->isWindow()) { 1247 QWidget *const window = qwidget->window(); 1248 QWidget *parentWindow = window->parentWidget(); 1249 if (parentWindow) { 1250 while (parentWindow->parentWidget()) 1251 parentWindow = parentWindow->parentWidget(); 1252 } else { 1253 parentWindow = window; 1254 } 1255 1256 const bool parentDecorationsVisible = !(parentWindow->windowState() & (Qt::WindowFullScreen | Qt::WindowMinimized)); 1257 const bool parentIsFullscreen = parentWindow->windowState() & Qt::WindowFullScreen; 1258 const bool parentCbaVisibilityHint = parentWindow->windowFlags() & Qt::WindowSoftkeysVisibleHint; 1259 bool buttonGroupVisibility = (parentDecorationsVisible || (parentIsFullscreen && parentCbaVisibilityHint)); 1260 1261 // For non-toplevel normal and maximized windows, show cba if window has softkey 1262 // actions even if topmost parent is not showing cba. Do the same for fullscreen 1263 // windows that request it. 1264 if (!buttonGroupVisibility 1265 && window->parentWidget() 1266 && !(window->windowState() & Qt::WindowMinimized) 1267 && ((window->windowFlags() & Qt::WindowSoftkeysVisibleHint) || !(window->windowState() & Qt::WindowFullScreen))) { 1268 for (int i = 0; i < window->actions().size(); ++i) { 1269 if (window->actions().at(i)->softKeyRole() != QAction::NoSoftKey) { 1270 buttonGroupVisibility = true; 1271 break; 1272 } 1273 } 1274 } 1275 S60->setStatusPaneAndButtonGroupVisibility(parentDecorationsVisible, buttonGroupVisibility); 1255 1276 } 1256 1277 #endif -
trunk/src/gui/kernel/qwidget_s60.cpp
r846 r865 1185 1185 1186 1186 #ifdef Q_WS_S60 1187 bool decorationsVisible(false); 1188 if (!parentWidget()) { // Only top level native windows have control over cba/status pane 1189 // Hide window decoration when switching to fullscreen / minimized otherwise show decoration. 1190 // The window decoration visibility has to be changed before doing actual window state 1191 // change since in that order the availableGeometry will return directly the right size and 1192 // we will avoid unnecessary redraws 1193 decorationsVisible = !(newstate & (Qt::WindowFullScreen | Qt::WindowMinimized)); 1194 const bool statusPaneVisibility = decorationsVisible; 1195 const bool buttonGroupVisibility = (decorationsVisible || (isFullscreen && cbaRequested)); 1196 S60->setStatusPaneAndButtonGroupVisibility(statusPaneVisibility, buttonGroupVisibility); 1197 } 1187 // Hide window decoration when switching to fullscreen / minimized otherwise show decoration. 1188 // The window decoration visibility has to be changed before doing actual window state 1189 // change since in that order the availableGeometry will return directly the right size and 1190 // we will avoid unnecessary redraws 1191 Qt::WindowStates comparisonState = newstate; 1192 QWidget *parentWindow = parentWidget(); 1193 if (parentWindow) { 1194 while (parentWindow->parentWidget()) 1195 parentWindow = parentWindow->parentWidget(); 1196 comparisonState = parentWindow->windowState(); 1197 } else { 1198 parentWindow = this; 1199 } 1200 1201 const bool decorationsVisible = !(comparisonState & (Qt::WindowFullScreen | Qt::WindowMinimized)); 1202 const bool parentIsFullscreen = comparisonState & Qt::WindowFullScreen; 1203 const bool parentCbaVisibilityHint = parentWindow->windowFlags() & Qt::WindowSoftkeysVisibleHint; 1204 bool buttonGroupVisibility = (decorationsVisible || (parentIsFullscreen && parentCbaVisibilityHint)); 1205 1206 // For non-toplevel normal and maximized windows, show cba if window has softkey 1207 // actions even if topmost parent is not showing cba. Do the same for fullscreen 1208 // windows that request it. 1209 if (!buttonGroupVisibility 1210 && parentWidget() 1211 && !(newstate & Qt::WindowMinimized) 1212 && ((windowFlags() & Qt::WindowSoftkeysVisibleHint) || !(newstate & Qt::WindowFullScreen))) { 1213 for (int i = 0; i < actions().size(); ++i) { 1214 if (actions().at(i)->softKeyRole() != QAction::NoSoftKey) { 1215 buttonGroupVisibility = true; 1216 break; 1217 } 1218 } 1219 } 1220 S60->setStatusPaneAndButtonGroupVisibility(decorationsVisible, buttonGroupVisibility); 1221 1198 1222 #endif // Q_WS_S60 1199 1223 -
trunk/src/gui/styles/qs60style.cpp
r846 r865 2644 2644 //native items have small empty areas at the beginning and end of menu item 2645 2645 sz.setWidth(sz.width() + 2 * pixelMetric(PM_MenuHMargin) + 2 * QS60StylePrivate::pixelMetric(PM_FrameCornerWidth)); 2646 if (QS60StylePrivate::isTouchSupported()) 2646 if (QS60StylePrivate::isTouchSupported()) { 2647 2647 //Make itemview easier to use in touch devices 2648 sz.setHeight(sz.height() + 2 * pixelMetric(PM_FocusFrameVMargin)); 2648 2649 //QCommonStyle does not adjust height with horizontal margin, it only adjusts width 2649 sz.setHeight(sz.height() + 2 * pixelMetric(PM_FocusFrameVMargin) - 8); //QCommonstyle adds 8 to height that this style handles through PM values 2650 if (ct == CT_MenuItem) 2651 sz.setHeight(sz.height() - 8); //QCommonstyle adds 8 to height that this style handles through PM values 2652 } 2650 2653 break; 2651 2654 #ifndef QT_NO_COMBOBOX
Note:
See TracChangeset
for help on using the changeset viewer.