VirtualBox

Changeset 101508 in vbox for trunk


Ignore:
Timestamp:
Oct 19, 2023 11:16:25 AM (12 months ago)
Author:
vboxsync
Message:

FE/Qt: bugref:10535. Overlaying OS arch. text onto type icons. Also for x64 for now until we are happy with the quality.

Location:
trunk/src/VBox/Frontends/VirtualBox/src/globals
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIIconPool.cpp

    r101500 r101508  
    722722    }
    723723
    724     //overlayArchitectureTextOnPixmap("A64", pixmap);
     724    overlayArchitectureTextOnPixmap(determineOSArchString(strOSTypeID), pixmap);
    725725    /* Return pixmap: */
    726726    return pixmap;
     727}
     728
     729QString UIIconPoolGeneral::determineOSArchString(const QString &osTypeId) const
     730{
     731    if (osTypeId.contains("_x64") || osTypeId.contains("_64"))
     732        return QString("x64");
     733    else if (osTypeId.contains("arm32"))
     734        return QString("A32");
     735    else if (osTypeId.contains("arm64"))
     736        return QString("A64");
     737    return QString("32");
    727738}
    728739
     
    757768    QFont font = qApp->font();
    758769    /* Set font' size wrt. @p pixmap height: */
    759     font.setPixelSize(0.3 * pixmap.rect().height());
     770    font.setPixelSize(0.31 * pixmap.rect().height());
    760771    font.setBold(true);
    761772    QPainter painter(&pixmap);
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIIconPool.h

    r101500 r101508  
    166166    /** Overlay text @p strArch on top of @p pixmap. */
    167167    void overlayArchitectureTextOnPixmap(const QString &strArch, QPixmap &pixmap) const;
    168 
     168    /** Returns the architecture text we overlay on guest OS type id icon.*/
     169    QString determineOSArchString(const QString &osTypeId) const;
    169170    /** Holds the singleton instance. */
    170171    static UIIconPoolGeneral *s_pInstance;
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