Changeset 88475 in vbox for trunk/src/VBox/Frontends/VirtualBox
- Timestamp:
- Apr 12, 2021 6:16:18 PM (4 years ago)
- svn:sync-xref-src-repo-rev:
- 143732
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/helpbrowser/UIHelpViewer.cpp
r88474 r88475 642 642 if (m_fOverlayMode) 643 643 { 644 QSize size(qMin((int)(0.9 * width()), m_overlayPixmap.width()), 645 qMin((int)(0.9 * height()), height())); 644 /* Scale the image to 1005 as long as it fits into avaible space (minus some margins and scrollbar sizes): */ 645 int vWidth = 0; 646 if (verticalScrollBar() && verticalScrollBar()->isVisible()) 647 vWidth = verticalScrollBar()->width(); 648 int hMargin = qApp->style()->pixelMetric(QStyle::PM_LayoutLeftMargin) + 649 qApp->style()->pixelMetric(QStyle::PM_LayoutRightMargin) + vWidth; 650 651 int hHeight = 0; 652 if (horizontalScrollBar() && horizontalScrollBar()->isVisible()) 653 hHeight = horizontalScrollBar()->height(); 654 int vMargin = qApp->style()->pixelMetric(QStyle::PM_LayoutTopMargin) + 655 qApp->style()->pixelMetric(QStyle::PM_LayoutBottomMargin) + hHeight; 656 657 QSize size(qMin(width() - hMargin, m_overlayPixmap.width()), 658 qMin(height() - vMargin, m_overlayPixmap.height())); 646 659 m_pOverlayLabel->setPixmap(m_overlayPixmap.scaled(size, Qt::KeepAspectRatio, Qt::SmoothTransformation)); 647 int x = 0.5 * (width() - m_pOverlayLabel->width()); 648 int y = 0.5 * (height() - m_pOverlayLabel->height()); 660 /* Center the label: */ 661 int x = 0.5 * (width() - vWidth - m_pOverlayLabel->width()); 662 int y = 0.5 * (height() - hHeight - m_pOverlayLabel->height()); 649 663 m_pOverlayLabel->move(x, y); 650 664 m_pOverlayLabel->show();
Note:
See TracChangeset
for help on using the changeset viewer.