VirtualBox

Changeset 69700 in vbox for trunk


Ignore:
Timestamp:
Nov 15, 2017 10:57:13 AM (7 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:8694: HiDPI support for session information dialog.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/UIInformationItem.cpp

    r69500 r69700  
    153153    /* Details templates: */
    154154    static const char *sSectionBoldTpl =
    155         "<tr><td width=22 rowspan=%1 align=left><img src=\"image://%2\" /></td>"
    156             "<td><b><nobr>%3</nobr></b></td></tr>"
    157             "%4";
     155        "<tr><td width=%1 rowspan=%2 align=left><img src=\"image://%3\" /></td>"
     156            "<td><b><nobr>%4</nobr></b></td></tr>"
     157            "%5";
    158158    static const char *sSectionItemTpl2 =
    159159        "<tr><td width=200><nobr>%1</nobr></td><td/><td>%2</td></tr>";
     
    162162    /* Initialize icon tag: */
    163163    const QString strIconTag = QString("image://%1").arg(m_strIcon);
     164
     165    /* Get icon metric: */
     166    const int iIconMetric = QApplication::style()->pixelMetric(QStyle::PM_SmallIconSize);
    164167
    165168    /* Compose details report: */
     
    172175
    173176        /* Format the entire item: */
    174         report = sectionTpl.arg(m_text.count() + 1) /* rows */
     177        report = sectionTpl.arg(1.375 * iIconMetric)
     178                           .arg(m_text.count() + 1) /* rows */
    175179                           .arg(m_strIcon, /* icon */
    176180                                m_strName, /* title */
     
    179183
    180184    /* Add pixmap to text-document as image resource: */
    181     m_pTextDocument->addResource(QTextDocument::ImageResource, QUrl(strIconTag), UIIconPool::pixmap(m_strIcon));
     185    m_pTextDocument->addResource(QTextDocument::ImageResource, QUrl(strIconTag),
     186                                 UIIconPool::iconSet(m_strIcon).pixmap(iIconMetric, iIconMetric));
    182187
    183188    /* Set html-data: */
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