VirtualBox

Changeset 67217 in vbox for trunk


Ignore:
Timestamp:
Jun 1, 2017 4:55:31 PM (7 years ago)
Author:
vboxsync
Message:

FE/Qt: Selector UI: Tools pane: Snapshot pane: A bit of HiDPI care.

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

Legend:

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

    r67214 r67217  
    972972        "<table border=0 cellspacing=1 cellpadding=0>%1</table>";
    973973    static const char *sSectionHrefTpl =
    974         "<tr><td width=%7 rowspan=%1 align=left><img width=%6 height=%6 src='%2'></td>"
     974        "<tr><td width=%6 rowspan=%1 align=left><img src='%2'></td>"
    975975            "<td colspan=3><b><a href='%3'><nobr>%4</nobr></a></b></td></tr>"
    976976            "%5"
    977977        "<tr><td colspan=3><font size=1>&nbsp;</font></td></tr>";
    978978    static const char *sSectionBoldTpl =
    979         "<tr><td width=%7 rowspan=%1 align=left><img width=%6 height=%6 src='%2'></td>"
     979        "<tr><td width=%6 rowspan=%1 align=left><img src='%2'></td>"
    980980            "<td colspan=3><!-- %3 --><b><nobr>%4</nobr></b></td></tr>"
    981981            "%5"
     
    10211021        strReport += strSectionTpl
    10221022            .arg(2 + iRowCount) /* rows */
    1023             .arg(":/machine_16px.png", /* icon */
     1023            .arg("details://general", /* icon */
    10241024                 "#general", /* link */
    10251025                 tr("General", "details report"), /* title */
    10261026                 strItem, /* items */
    1027                  QString::number(iIconMetric),
    10281027                 QString::number(iIndentMetric));
    10291028    }
     
    11191118        strReport += strSectionTpl
    11201119            .arg(2 + iRowCount) /* rows */
    1121             .arg(":/chipset_16px.png", /* icon */
     1120            .arg("details://system", /* icon */
    11221121                 "#system", /* link */
    11231122                 tr("System", "details report"), /* title */
    11241123                 strItem, /* items */
    1125                  QString::number(iIconMetric),
    11261124                 QString::number(iIndentMetric));
    11271125    }
     
    11761174        strReport += strSectionTpl
    11771175            .arg(2 + iRowCount) /* rows */
    1178             .arg(":/vrdp_16px.png", /* icon */
     1176            .arg("details://display", /* icon */
    11791177                 "#display", /* link */
    11801178                 tr("Display", "details report"), /* title */
    11811179                 strItem, /* items */
    1182                  QString::number(iIconMetric),
    11831180                 QString::number(iIndentMetric));
    11841181    }
     
    12461243        strReport += strSectionTpl
    12471244            .arg(2 + iRowCount) /* rows */
    1248             .arg(":/hd_16px.png", /* icon */
     1245            .arg("details://storage", /* icon */
    12491246                 "#storage", /* link */
    12501247                 tr("Storage", "details report"), /* title */
    12511248                 strItem, /* items */
    1252                  QString::number(iIconMetric),
    12531249                 QString::number(iIndentMetric));
    12541250    }
     
    12791275        strReport += strSectionTpl
    12801276            .arg(2 + iRowCount) /* rows */
    1281             .arg(":/sound_16px.png", /* icon */
     1277            .arg("details://audio", /* icon */
    12821278                 "#audio", /* link */
    12831279                 tr("Audio", "details report"), /* title */
    12841280                 strItem, /* items */
    1285                  QString::number(iIconMetric),
    12861281                 QString::number(iIndentMetric));
    12871282    }
     
    13521347        strReport += strSectionTpl
    13531348            .arg(2 + iRowCount) /* rows */
    1354             .arg(":/nw_16px.png", /* icon */
     1349            .arg("details://network", /* icon */
    13551350                 "#network", /* link */
    13561351                 tr("Network", "details report"), /* title */
    13571352                 strItem, /* items */
    1358                  QString::number(iIconMetric),
    13591353                 QString::number(iIndentMetric));
    13601354    }
     
    14041398        strReport += strSectionTpl
    14051399            .arg(2 + iRowCount) /* rows */
    1406             .arg(":/serial_port_16px.png", /* icon */
     1400            .arg("details://serialPorts", /* icon */
    14071401                 "#serialPorts", /* link */
    14081402                 tr("Serial Ports", "details report"), /* title */
    14091403                 strItem, /* items */
    1410                  QString::number(iIconMetric),
    14111404                 QString::number(iIndentMetric));
    14121405    }
     
    14471440        const QString dummy = strSectionTpl /* strReport += strSectionTpl */
    14481441            .arg(2 + iRowCount) /* rows */
    1449             .arg(":/parallel_port_16px.png", /* icon */
     1442            .arg("details://parallelPorts", /* icon */
    14501443                 "#parallelPorts", /* link */
    14511444                 tr("Parallel Ports", "details report"), /* title */
    14521445                 strItem, /* items */
    1453                  QString::number(iIconMetric),
    14541446                 QString::number(iIndentMetric));
    14551447        Q_UNUSED(dummy);
     
    14901482            strReport += strSectionTpl
    14911483                .arg(2 + iRowCount) /* rows */
    1492                 .arg(":/usb_16px.png", /* icon */
     1484                .arg("details://usb", /* icon */
    14931485                     "#usb", /* link */
    14941486                     tr("USB", "details report"), /* title */
    14951487                     strItem, /* items */
    1496                      QString::number(iIconMetric),
    14971488                     QString::number(iIndentMetric));
    14981489        }
     
    15161507        strReport += strSectionTpl
    15171508            .arg(2 + iRowCount) /* rows */
    1518             .arg(":/sf_16px.png", /* icon */
     1509            .arg("details://sharedFolders", /* icon */
    15191510                 "#sfolders", /* link */
    15201511                 tr("Shared Folders", "details report"), /* title */
    15211512                 strItem, /* items */
    1522                  QString::number(iIconMetric),
    15231513                 QString::number(iIndentMetric));
    15241514    }
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/UISnapshotDetailsWidget.cpp

    r67176 r67217  
    3333
    3434/* GUI includes: */
     35# include "UIConverter.h"
    3536# include "UIDesktopWidgetWatchdog.h"
     37# include "UIExtraDataDefs.h"
     38# include "UIIconPool.h"
    3639# include "UISnapshotDetailsWidget.h"
    3740# include "UIMessageCenter.h"
     
    566569                m_pBrowserDetails->setSizePolicy(policy);
    567570                m_pBrowserDetails->setFocus();
     571                /* Determine icon metric: */
     572                const QStyle *pStyle = QApplication::style();
     573                const int iIconMetric = pStyle->pixelMetric(QStyle::PM_SmallIconSize);
     574                const QSize iconSize = QSize(iIconMetric, iIconMetric);
     575                /* Register DetailsElementType icons in the m_pBrowserDetails document: */
     576                // WORKAROUND:
     577                // Unfortunatelly we can't just enumerate types within
     578                // cycle since they have exceptions like 'parallel' case.
     579                QList<DetailsElementType> types;
     580                types << DetailsElementType_General
     581                      << DetailsElementType_System
     582                      << DetailsElementType_Preview
     583                      << DetailsElementType_Display
     584                      << DetailsElementType_Storage
     585                      << DetailsElementType_Audio
     586                      << DetailsElementType_Network
     587                      << DetailsElementType_Serial
     588#ifdef VBOX_WITH_PARALLEL_PORTS
     589                      << DetailsElementType_Parallel
     590#endif /* VBOX_WITH_PARALLEL_PORTS */
     591                      << DetailsElementType_USB
     592                      << DetailsElementType_SF
     593                      << DetailsElementType_UI
     594                      << DetailsElementType_Description;
     595                foreach (const DetailsElementType &enmType, types)
     596                    m_pBrowserDetails->document()->addResource(
     597                        QTextDocument::ImageResource,
     598                        QUrl(QString("details://%1").arg(gpConverter->toInternalString(enmType))),
     599                        QVariant(gpConverter->toIcon(enmType).pixmap(iconSize)));
    568600
    569601                /* Add to layout: */
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