- Timestamp:
- Oct 18, 2010 9:57:33 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/selector/UIVMPreviewWindow.cpp
r32431 r33189 148 148 QRect cr = contentsRect(); 149 149 /* Draw the background with the monitor and the shadow */ 150 painter.drawImage(cr.x(), cr.y(), *m_pbgImage); 150 if (m_pbgImage) 151 painter.drawImage(cr.x(), cr.y(), *m_pbgImage); 151 152 // painter.setPen(Qt::red); 152 153 // painter.drawRect(cr.adjusted(0, 0, -1, -1)); … … 185 186 } 186 187 /* Draw the glossy overlay last */ 187 painter.drawImage(m_vRect.x(), m_vRect.y(), *m_pGlossyImg); 188 if (m_pGlossyImg) 189 painter.drawImage(m_vRect.x(), m_vRect.y(), *m_pGlossyImg); 188 190 } 189 191 … … 388 390 void UIVMPreviewWindow::repaintBGImages() 389 391 { 392 /* Delete the old images */ 393 if (m_pbgImage) 394 delete m_pbgImage; 395 if (m_pGlossyImg) 396 delete m_pGlossyImg; 397 398 /* Check that there is enough room for our fancy stuff. If not we just 399 * draw nothing. */ 400 QRect cr = contentsRect(); 401 if ( cr.width() < 30 402 || cr.height() < 30) 403 return; 404 390 405 QPalette pal = palette(); 391 QRect cr = contentsRect();392 406 m_wRect = cr.adjusted(10, 10, -10, -10); 393 407 m_vRect = m_wRect.adjusted(m_vMargin, m_vMargin, -m_vMargin, -m_vMargin).adjusted(-3, -3, 3, 3); … … 425 439 #endif 426 440 /* Make a copy of the new bg image */ 427 if (m_pbgImage)428 delete m_pbgImage;429 441 m_pbgImage = new QImage(imageO); 430 442 … … 441 453 442 454 /* Paint the glossy path on a QImage */ 443 if (m_pGlossyImg)444 delete m_pGlossyImg;445 455 QImage image(m_vRect.size(), QImage::Format_ARGB32); 446 456 QColor bg1(Qt::white); /* We want blur to transparent _and_ white. */
Note:
See TracChangeset
for help on using the changeset viewer.