VirtualBox

Changeset 85444 in vbox for trunk/src/VBox/Frontends


Ignore:
Timestamp:
Jul 23, 2020 6:42:00 PM (4 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:9686, bugref:9510. Improving the warning sign we show when no GAs are available

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/monitor/performance/UIPerformanceMonitor.cpp

    r85413 r85444  
    305305void UIChart::retranslateUi()
    306306{
    307     m_strGAWarning = QApplication::translate("UIVMInformationDialog", "No guest additions! This metric requires guest additions to work properly.");
     307    m_strGAWarning = QApplication::translate("UIVMInformationDialog", "This metric requires guest additions to work.");
    308308    m_strResetActionLabel = QApplication::translate("UIVMInformationDialog", "Reset");
    309309    m_strPieChartToggleActionLabel = QApplication::translate("UIVMInformationDialog", "Show Pie Chart");
     
    552552{
    553553    painter.setPen(Qt::NoPen);
    554     painter.setBrush(QColor(60, 60, 60, 80));
    555     painter.drawRect(QRect(0, 0, width(), height()));
     554    painter.setBrush(QColor(255, 255, 255, 150));
     555    painter.drawRect(m_lineChartRect);
    556556    painter.setPen(QColor(20, 20, 20, 180));
    557557    QFont font = painter.font();
     558    int iFontSize = 64;
     559    do {
     560        font.setPixelSize(iFontSize);
     561        --iFontSize;
     562    }while(QFontMetrics(font).width(m_strGAWarning) >= m_lineChartRect.width());
    558563    font.setBold(true);
    559     /** @todo make this size dynamic. aka. autoscale the font. */
    560     font.setPixelSize(16);
    561564    painter.setFont(font);
    562     painter.drawText(2 * m_iMarginLeft, 15 * m_iMarginTop, m_strGAWarning);
     565    painter.drawText(m_lineChartRect, m_strGAWarning);
    563566}
    564567
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette