VirtualBox

Changeset 70530 in vbox for trunk/src


Ignore:
Timestamp:
Jan 11, 2018 10:39:18 AM (7 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:8694: Runtime UI: A bit of layout fixes for VM close dialog.

File:
1 edited

Legend:

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

    r70523 r70530  
    174174    QVBoxLayout *pMainLayout = new QVBoxLayout(this);
    175175    {
     176        /* Configure layout: */
     177#ifdef VBOX_WS_MAC
     178        pMainLayout->setContentsMargins(40, 20, 40, 20);
     179        pMainLayout->setSpacing(15);
     180#else
     181        pMainLayout->setSpacing(qApp->style()->pixelMetric(QStyle::PM_LayoutVerticalSpacing) * 2);
     182#endif
     183
    176184        /* Prepare 'top' layout: */
    177185        QHBoxLayout *pTopLayout = new QHBoxLayout;
    178186        {
     187            /* Configure layout: */
     188#ifdef VBOX_WS_MAC
     189            pTopLayout->setSpacing(20);
     190#else
     191            pTopLayout->setSpacing(qApp->style()->pixelMetric(QStyle::PM_LayoutHorizontalSpacing) * 2);
     192#endif
     193
    179194            /* Prepare 'top-left' layout: */
    180195            QVBoxLayout *pTopLeftLayout = new QVBoxLayout;
     
    189204                    m_pIcon->setPixmap(icon.pixmap(iIconMetric, iIconMetric));
    190205                }
    191                 /* Configure layout: */
    192                 pTopLeftLayout->setContentsMargins(0, 0, 0, 0);
     206
     207                /* Add into layout: */
    193208                pTopLeftLayout->addWidget(m_pIcon);
    194209                pTopLeftLayout->addStretch();
     
    198213            {
    199214                /* Configure layout: */
    200                 // WORKAROUND:
    201                 // Why do we need it? It should be the default one, but it's not..
    202215#ifdef VBOX_WS_MAC
    203216                pTopRightLayout->setSpacing(10);
     
    212225                {
    213226                    /* Configure layout: */
    214                     // WORKAROUND:
    215                     // Why do we need it? It should be the default one, but it's not..
    216227#ifdef VBOX_WS_MAC
    217228                    pChoiceLayout->setSpacing(10);
     
    284295                    /* Prepare 'discard' check-box: */
    285296                    m_pDiscardCheckBox = new QCheckBox(this);
    286                     /* Configure layout: */
    287                     pChoiceLayout->setContentsMargins(0, 0, 0, 0);
     297
     298                    /* Add into layout: */
    288299                    pChoiceLayout->addWidget(m_pDetachIcon, 0, 0);
    289300                    pChoiceLayout->addWidget(m_pDetachRadio, 0, 1);
     
    296307                    pChoiceLayout->addWidget(m_pDiscardCheckBox, 4, 1);
    297308                }
    298                 /* Configure layout: */
    299                 pTopRightLayout->setContentsMargins(0, 0, 0, 0);
     309
     310                /* Add into layout: */
    300311                pTopRightLayout->addWidget(m_pLabel);
    301312                pTopRightLayout->addItem(pChoiceLayout);
    302313            }
    303             /* Configure layout: */
    304             pTopLayout->setContentsMargins(0, 0, 0, 0);
    305 #ifdef VBOX_WS_MAC
    306             pTopLayout->setSpacing(20);
    307 #else
    308             pTopLayout->setSpacing(qApp->style()->pixelMetric(QStyle::PM_LayoutHorizontalSpacing) * 2);
    309 #endif
     314
     315            /* Add into layout: */
    310316            pTopLayout->addItem(pTopLeftLayout);
    311317            pTopLayout->addItem(pTopRightLayout);
    312318        }
     319
    313320        /* Prepare button-box: */
    314321        QIDialogButtonBox *pButtonBox = new QIDialogButtonBox(this);
     
    320327            connect(pButtonBox, SIGNAL(helpRequested()), &msgCenter(), SLOT(sltShowHelpHelpDialog()));
    321328        }
    322         /* Configure layout: */
    323 #ifdef VBOX_WS_MAC
    324         pMainLayout->setContentsMargins(40, 20, 40, 20);
    325 #endif /* VBOX_WS_MAC */
     329
     330        /* Add into layout: */
    326331        pMainLayout->addItem(pTopLayout);
    327332        pMainLayout->addWidget(pButtonBox);
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