VirtualBox

Changeset 69726 in vbox


Ignore:
Timestamp:
Nov 17, 2017 3:48:58 PM (7 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:8694: Large HiDPI support cleanup/rework, removing unnecessary hard-coded margins, using scalable when necessary.

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

Legend:

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

    r69500 r69726  
    142142        {
    143143            /* Configure main-layout: */
    144             m_pMainLayout->setSpacing(5);
    145             /* Not sure 0 margins are default, but just to be safe: */
    146144            m_pMainLayout->setContentsMargins(0, 0, 0, 0);
    147145
     
    607605        AssertPtrReturnVoid(m_pMainLayout);
    608606        {
    609             /* Prepare main-layout: */
    610             m_pMainLayout->setSpacing(5);
    611             /* Not sure 0 margins are default, but just to be safe: */
     607            /* Configure main-layout: */
    612608            m_pMainLayout->setContentsMargins(0, 0, 0, 0);
    613609
     
    11711167        QVBoxLayout *pPageLayout = new QVBoxLayout(pPageContainer);
    11721168        AssertPtrReturn(pPageLayout, 0);
    1173         {
    1174             pPageLayout->setContentsMargins(10, 10, 10, 10);
    1175         }
    11761169        /* Create Log-Viewer: */
    11771170        QTextEdit *pLogViewer = new QTextEdit(pPageContainer);
  • trunk/src/VBox/Frontends/VirtualBox/src/VBoxLicenseViewer.cpp

    r69500 r69726  
    5858
    5959    QVBoxLayout *mainLayout = new QVBoxLayout (this);
    60     mainLayout->setSpacing (10);
    61     mainLayout->setContentsMargins(10, 10, 10, 10);
    6260    mainLayout->addWidget (mLicenseText);
    6361    mainLayout->addWidget (dbb);
  • trunk/src/VBox/Frontends/VirtualBox/src/extensions/QIManagerDialog.cpp

    r67967 r69726  
    121121        {
    122122            /* Configure layout: */
    123             centralWidget()->layout()->setContentsMargins(5, 5, 5, 5);
    124             centralWidget()->layout()->setSpacing(10);
     123            const int iL = qApp->style()->pixelMetric(QStyle::PM_LayoutLeftMargin) / 2;
     124            const int iT = qApp->style()->pixelMetric(QStyle::PM_LayoutTopMargin) / 2;
     125            const int iR = qApp->style()->pixelMetric(QStyle::PM_LayoutRightMargin) / 2;
     126            const int iB = qApp->style()->pixelMetric(QStyle::PM_LayoutBottomMargin) / 2;
     127            centralWidget()->layout()->setContentsMargins(iL, iT, iR, iB);
    125128
    126129            /* Configure central-widget: */
  • trunk/src/VBox/Frontends/VirtualBox/src/extensions/QIMessageBox.cpp

    r69500 r69726  
    174174        pMainLayout->setContentsMargins(40, 11, 40, 11);
    175175        pMainLayout->setSpacing(15);
    176 #else /* !VBOX_WS_MAC */
    177         pMainLayout->setContentsMargins(11, 11, 11, 11);
    178         pMainLayout->setSpacing(10);
    179 #endif /* !VBOX_WS_MAC */
     176#endif /* VBOX_WS_MAC */
    180177        /* Create top-layout: */
    181178        QHBoxLayout *pTopLayout = new QHBoxLayout;
  • trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataManager.cpp

    r69722 r69726  
    14451445#else /* !VBOX_WS_MAC */
    14461446            /* Set spacing/margin like in the selector window: */
    1447             m_pMainLayout->setSpacing(5);
    1448             m_pMainLayout->setContentsMargins(5, 5, 5, 5);
     1447            const int iL = qApp->style()->pixelMetric(QStyle::PM_LayoutLeftMargin) / 2;
     1448            const int iT = qApp->style()->pixelMetric(QStyle::PM_LayoutTopMargin) / 2;
     1449            const int iR = qApp->style()->pixelMetric(QStyle::PM_LayoutRightMargin) / 2;
     1450            const int iB = qApp->style()->pixelMetric(QStyle::PM_LayoutBottomMargin) / 2;
     1451            m_pMainLayout->setContentsMargins(iL, iT, iR, iB);
    14491452#endif /* !VBOX_WS_MAC */
    14501453            /* Prepare tool-bar: */
     
    15361539        {
    15371540            /* Configure layout: */
    1538             pLayout->setContentsMargins(0, 0, 3, 0);
     1541            const int iR = qApp->style()->pixelMetric(QStyle::PM_LayoutRightMargin) / 3;
     1542            pLayout->setContentsMargins(0, 0, iR, 0);
    15391543            /* Create chooser-filter: */
    15401544            m_pFilterOfChooser = new QLineEdit;
     
    16011605        {
    16021606            /* Configure layout: */
    1603             pLayout->setContentsMargins(3, 0, 0, 0);
     1607            const int iL = qApp->style()->pixelMetric(QStyle::PM_LayoutLeftMargin) / 3;
     1608            pLayout->setContentsMargins(iL, 0, 0, 0);
    16041609            /* Create data-filter: */
    16051610            m_pFilterOfData = new QLineEdit;
  • trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMediumDetailsWidget.cpp

    r69670 r69726  
    569569            /* Configure layout: */
    570570            pLayout->setVerticalSpacing(0);
    571             pLayout->setContentsMargins(5, 5, 5, 5);
    572571            pLayout->setColumnStretch(1, 1);
    573572
  • trunk/src/VBox/Frontends/VirtualBox/src/net/UINetworkManagerDialog.cpp

    r69550 r69726  
    7171    /* Create main-layout: */
    7272    QVBoxLayout *pMainLayout = new QVBoxLayout(centralWidget());
    73     pMainLayout->setContentsMargins(6, 6, 6, 6);
    7473
    7574    /* Create description-label: */
  • trunk/src/VBox/Frontends/VirtualBox/src/net/UINetworkRequestWidget.cpp

    r69550 r69726  
    2222/* Global includes: */
    2323# include <QTimer>
     24# include <QStyle>
    2425# include <QGridLayout>
    2526# include <QProgressBar>
     
    6970
    7071    /* Setup main-layout: */
    71     m_pMainLayout->setContentsMargins(6, 6, 6, 6);
     72    const int iL = qApp->style()->pixelMetric(QStyle::PM_LayoutLeftMargin) / 2;
     73    const int iT = qApp->style()->pixelMetric(QStyle::PM_LayoutTopMargin) / 2;
     74    const int iR = qApp->style()->pixelMetric(QStyle::PM_LayoutRightMargin) / 2;
     75    const int iB = qApp->style()->pixelMetric(QStyle::PM_LayoutBottomMargin) / 2;
     76    m_pMainLayout->setContentsMargins(iL, iT, iR, iB);
    7277
    7378    /* Setup progress-bar: */
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/UIInformationConfiguration.cpp

    r69500 r69726  
    6060    {
    6161        /* Configure layout: */
    62         m_pMainLayout->setContentsMargins(2, 0, 0, 0);
    6362        m_pMainLayout->setSpacing(0);
    6463    }
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/UIInformationRuntime.cpp

    r69500 r69726  
    6060    {
    6161        /* Configure layout: */
    62         m_pMainLayout->setContentsMargins(2, 0, 0, 0);
    6362        m_pMainLayout->setSpacing(0);
    6463    }
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/UIDesktopPane.cpp

    r69645 r69726  
    615615    /* Create main layout: */
    616616    QVBoxLayout *pMainLayout = new QVBoxLayout(m_pErrBox);
    617 #if   defined(VBOX_WS_MAC)
     617#ifdef VBOX_WS_MAC
    618618    pMainLayout->setContentsMargins(4, 5, 5, 5);
    619 #elif defined(VBOX_WS_WIN)
    620     pMainLayout->setContentsMargins(3, 5, 5, 0);
    621 #elif defined(VBOX_WS_X11)
    622     pMainLayout->setContentsMargins(0, 5, 5, 5);
    623 #endif
    624     pMainLayout->setSpacing(10);
     619#else /* !VBOX_WS_MAC */
     620    const int iL = qApp->style()->pixelMetric(QStyle::PM_LayoutLeftMargin) / 3;
     621    const int iT = qApp->style()->pixelMetric(QStyle::PM_LayoutTopMargin) / 3;
     622    const int iR = qApp->style()->pixelMetric(QStyle::PM_LayoutRightMargin) / 3;
     623    pMainLayout->setContentsMargins(iL, iT, iR, 0);
     624#endif /* !VBOX_WS_MAC */
    625625
    626626    /* Create error label: */
     
    688688                AssertPtrReturnVoid(pLayoutWelcome);
    689689                {
    690                     /* Invent pixel metric: */
    691                     const int iMetric = QApplication::style()->pixelMetric(QStyle::PM_SmallIconSize) / 4;
    692 
    693690                    /* Configure layout: */
    694                     pLayoutWelcome->setContentsMargins(iMetric, 0, 0, 0);
    695                     pLayoutWelcome->setSpacing(10);
     691                    const int iL = qApp->style()->pixelMetric(QStyle::PM_LayoutLeftMargin) / 2;
     692                    pLayoutWelcome->setContentsMargins(iL, 0, 0, 0);
    696693
    697694                    /* Create welcome text label: */
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/UISelectorWindow.cpp

    r69552 r69726  
    18411841        {
    18421842            /* Configure tab-bar: */
    1843             m_pTabBarMachine->setContentsMargins(10, 0, 10, 0);
     1843            const int iL = qApp->style()->pixelMetric(QStyle::PM_LayoutLeftMargin) / 2;
     1844            const int iR = qApp->style()->pixelMetric(QStyle::PM_LayoutRightMargin) / 2;
     1845            m_pTabBarMachine->setContentsMargins(iL, 0, iR, 0);
    18441846
    18451847            /* Add into toolbar: */
     
    18521854        {
    18531855            /* Configure tab-bar: */
    1854             m_pTabBarGlobal->setContentsMargins(10, 0, 10, 0);
     1856            const int iL = qApp->style()->pixelMetric(QStyle::PM_LayoutLeftMargin) / 2;
     1857            const int iR = qApp->style()->pixelMetric(QStyle::PM_LayoutRightMargin) / 2;
     1858            m_pTabBarGlobal->setContentsMargins(iL, 0, iR, 0);
    18551859
    18561860            /* Add into toolbar: */
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/UIToolsPaneGlobal.cpp

    r69057 r69726  
    219219    /* Create stacked-layout: */
    220220    m_pLayout = new QStackedLayout(this);
    221     AssertPtrReturnVoid(m_pLayout);
    222     {
    223         /* Configure layout: */
    224         m_pLayout->setSpacing(0);
    225         m_pLayout->setContentsMargins(3, 4, 5, 0);
    226     }
    227221
    228222    /* Create desktop pane: */
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/UIToolsPaneMachine.cpp

    r69057 r69726  
    272272    /* Create stacked-layout: */
    273273    m_pLayout = new QStackedLayout(this);
    274     AssertPtrReturnVoid(m_pLayout);
    275     {
    276         /* Configure layout: */
    277         m_pLayout->setSpacing(0);
    278         m_pLayout->setContentsMargins(3, 4, 5, 0);
    279     }
    280274
    281275    /* Create desktop pane: */
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooser.cpp

    r69500 r69726  
    2323# include <QVBoxLayout>
    2424# include <QStatusBar>
     25# include <QStyle>
    2526
    2627/* GUI includes: */
     
    109110    /* Setup main-layout: */
    110111    m_pMainLayout = new QVBoxLayout(this);
    111     m_pMainLayout->setContentsMargins(0, 0, 2, 0);
     112    const int iR = qApp->style()->pixelMetric(QStyle::PM_LayoutRightMargin) / 9;
     113    m_pMainLayout->setContentsMargins(0, 0, iR, 0);
    112114    m_pMainLayout->setSpacing(0);
    113115}
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/details/UIGDetails.cpp

    r69500 r69726  
    2222/* Qt includes: */
    2323# include <QApplication>
     24# include <QStyle>
    2425# include <QVBoxLayout>
    2526
     
    7374    /* Setup main-layout: */
    7475    m_pMainLayout = new QVBoxLayout(this);
    75     m_pMainLayout->setContentsMargins(2, 0, 0, 0);
     76    const int iL = qApp->style()->pixelMetric(QStyle::PM_LayoutLeftMargin) / 9;
     77    m_pMainLayout->setContentsMargins(iL, 0, 0, 0);
    7678    m_pMainLayout->setSpacing(0);
    7779}
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsNetwork.cpp

    r68435 r69726  
    12521252    AssertPtrReturnVoid(pMainLayout);
    12531253    {
    1254         /* Configure layout: */
    1255         pMainLayout->setContentsMargins(0, 5, 0, 5);
    1256 
    12571254        /* Creating tab-widget: */
    12581255        m_pTabWidget = new QITabWidget;
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsSerial.cpp

    r68435 r69726  
    562562    AssertPtrReturnVoid(pMainLayout);
    563563    {
    564         /* Configure layout: */
    565         pMainLayout->setContentsMargins(0, 5, 0, 5);
    566 
    567564        /* Creating tab-widget: */
    568565        m_pTabWidget = new QITabWidget;
  • trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIFilmContainer.cpp

    r69500 r69726  
    169169#ifdef VBOX_WS_MAC
    170170    m_pMainLayout->setContentsMargins(10, 10, 15, 10);
    171 #else /* VBOX_WS_MAC */
    172     m_pMainLayout->setContentsMargins(10, 10, 10, 10);
    173 #endif /* !VBOX_WS_MAC */
     171#endif /* VBOX_WS_MAC */
    174172
    175173    /* Add strech: */
  • trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIPopupBox.cpp

    r69500 r69726  
    5050    /* Setup main-layout: */
    5151    QVBoxLayout *pMainLayout = new QVBoxLayout(this);
    52     pMainLayout->setContentsMargins(10, 5, 5, 5);
    5352    /* Setup title-layout: */
    5453    QHBoxLayout *pTitleLayout = new QHBoxLayout;
  • trunk/src/VBox/Frontends/VirtualBox/src/widgets/UISpecialControls.cpp

    r69500 r69726  
    246246
    247247    QHBoxLayout *layout = new QHBoxLayout(this);
     248    layout->setContentsMargins(0, 0, 0, 0);
    248249    for (int i=0; i < aCount; ++i)
    249250    {
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/clonevd/UIWizardCloneVDPageExpert.cpp

    r69200 r69726  
    4949    QGridLayout *pMainLayout = new QGridLayout(this);
    5050    {
    51         pMainLayout->setContentsMargins(8, 6, 8, 6);
    52         pMainLayout->setSpacing(10);
    5351        m_pSourceDiskCnt = new QGroupBox(this);
    5452        {
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/clonevm/UIWizardCloneVMPageExpert.cpp

    r69500 r69726  
    4343    QGridLayout *pMainLayout = new QGridLayout(this);
    4444    {
    45         pMainLayout->setContentsMargins(8, 6, 8, 6);
    46         pMainLayout->setSpacing(10);
    4745        m_pNameCnt = new QGroupBox(this);
    4846        {
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/UIWizardExportAppPageExpert.cpp

    r68073 r69726  
    4747    QGridLayout *pMainLayout = new QGridLayout(this);
    4848    {
    49         pMainLayout->setContentsMargins(8, 6, 8, 6);
    50         pMainLayout->setSpacing(10);
    5149        m_pSelectorCnt = new QGroupBox(this);
    5250        {
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/firstrun/UIWizardFirstRunPageBasic.cpp

    r69500 r69726  
    6868    QVBoxLayout *pMainLayout = new QVBoxLayout(this);
    6969    {
    70         pMainLayout->setContentsMargins(8, 0, 8, 0);
    71         pMainLayout->setSpacing(10);
    7270        m_pLabel = new QIRichTextLabel(this);
    7371        QHBoxLayout *pSourceDiskLayout = new QHBoxLayout;
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/importappliance/UIWizardImportAppPageExpert.cpp

    r69500 r69726  
    4040    QVBoxLayout *pMainLayout = new QVBoxLayout(this);
    4141    {
    42         pMainLayout->setContentsMargins(8, 6, 8, 6);
    43         pMainLayout->setSpacing(10);
    4442        m_pApplianceCnt = new QGroupBox(this);
    4543        {
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvd/UIWizardNewVDPageExpert.cpp

    r69500 r69726  
    5555    QGridLayout *pMainLayout = new QGridLayout(this);
    5656    {
    57         pMainLayout->setContentsMargins(8, 6, 8, 6);
    58         pMainLayout->setSpacing(10);
    5957        m_pLocationCnt = new QGroupBox(this);
    6058        {
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageExpert.cpp

    r69500 r69726  
    5050    QVBoxLayout *pMainLayout = new QVBoxLayout(this);
    5151    {
    52         pMainLayout->setContentsMargins(8, 6, 8, 6);
    53         pMainLayout->setSpacing(10);
    5452        m_pNameAndSystemCnt = new QGroupBox(this);
    5553        {
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