VirtualBox

Changeset 70523 in vbox for trunk/src/VBox/Frontends


Ignore:
Timestamp:
Jan 10, 2018 5:22:30 PM (7 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:8694: Not that easy on macOS, fixes for r119246.

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

Legend:

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

    r69823 r70523  
    102102    {
    103103        /* Configure layout: */
    104         const int iS0 = qApp->style()->pixelMetric(QStyle::PM_LayoutHorizontalSpacing) * 2;
    105         pLayout->setSpacing(iS0);
     104#ifdef VBOX_WS_MAC
     105        pLayout->setSpacing(20);
     106        pLayout->setContentsMargins(40, 20, 40, 20);
     107#else
     108        pLayout->setSpacing(qApp->style()->pixelMetric(QStyle::PM_LayoutHorizontalSpacing) * 2);
     109#endif
    106110
    107111        /* Create sub-layout: */
     
    132136        {
    133137            /* Configure layout: */
    134             const int iS2 = qApp->style()->pixelMetric(QStyle::PM_LayoutVerticalSpacing) / 2;
    135             pSubLayout2->setSpacing(iS2);
     138#ifdef VBOX_WS_MAC
     139            pSubLayout2->setSpacing(5);
     140#else
     141            pSubLayout2->setSpacing(qApp->style()->pixelMetric(QStyle::PM_LayoutVerticalSpacing) / 2);
     142#endif
    136143
    137144            /* Create name label: */
     
    165172        {
    166173            /* Configure layout: */
    167             const int iS3 = qApp->style()->pixelMetric(QStyle::PM_LayoutVerticalSpacing) / 2;
    168             pSubLayout3->setSpacing(iS3);
     174#ifdef VBOX_WS_MAC
     175            pSubLayout3->setSpacing(5);
     176#else
     177            pSubLayout3->setSpacing(qApp->style()->pixelMetric(QStyle::PM_LayoutVerticalSpacing) / 2);
     178#endif
    169179
    170180            /* Create description label: */
  • trunk/src/VBox/Frontends/VirtualBox/src/extensions/QIArrowSplitter.cpp

    r69821 r70523  
    236236        /* Configure main-layout: */
    237237        m_pMainLayout->setContentsMargins(0, 0, 0, 0);
    238         const int iS = qApp->style()->pixelMetric(QStyle::PM_LayoutVerticalSpacing) / 2;
    239         m_pMainLayout->setSpacing(iS);
     238#ifdef VBOX_WS_MAC
     239        m_pMainLayout->setSpacing(5);
     240#else
     241        m_pMainLayout->setSpacing(qApp->style()->pixelMetric(QStyle::PM_LayoutVerticalSpacing) / 2);
     242#endif
    240243        /* Create button-layout: */
    241244        QHBoxLayout *pButtonLayout = new QHBoxLayout;
  • trunk/src/VBox/Frontends/VirtualBox/src/hostnetwork/UIHostNetworkManager.cpp

    r69821 r70523  
    815815        layout()->setSpacing(10);
    816816#else
    817         const int iS = qApp->style()->pixelMetric(QStyle::PM_LayoutVerticalSpacing) / 2;
    818         layout()->setSpacing(iS);
     817        layout()->setSpacing(qApp->style()->pixelMetric(QStyle::PM_LayoutVerticalSpacing) / 2);
    819818#endif
    820819
  • trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerWidget.cpp

    r70519 r70523  
    485485        layout()->setSpacing(10);
    486486#else
    487         const int iS = qApp->style()->pixelMetric(QStyle::PM_LayoutVerticalSpacing) / 2;
    488         layout()->setSpacing(iS);
     487        layout()->setSpacing(qApp->style()->pixelMetric(QStyle::PM_LayoutVerticalSpacing) / 2);
    489488#endif
    490489
  • trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMediumManager.cpp

    r70487 r70523  
    15221522        layout()->setSpacing(10);
    15231523#else
    1524         const int iS = qApp->style()->pixelMetric(QStyle::PM_LayoutVerticalSpacing) / 2;
    1525         layout()->setSpacing(iS);
     1524        layout()->setSpacing(qApp->style()->pixelMetric(QStyle::PM_LayoutVerticalSpacing) / 2);
    15261525#endif
    15271526
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIIndicatorsPool.cpp

    r69821 r70523  
    12861286        /* Configure main-layout: */
    12871287        m_pMainLayout->setContentsMargins(0, 0, 0, 0);
    1288         const int iS = qApp->style()->pixelMetric(QStyle::PM_LayoutHorizontalSpacing) / 2;
    1289         m_pMainLayout->setSpacing(iS);
     1288#ifdef VBOX_WS_MAC
     1289        m_pMainLayout->setSpacing(5);
     1290#else
     1291        m_pMainLayout->setSpacing(qApp->style()->pixelMetric(QStyle::PM_LayoutHorizontalSpacing) / 2);
     1292#endif
    12901293        /* Update pool: */
    12911294        updatePool();
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIStatusBarEditorWindow.cpp

    r69821 r70523  
    545545            /* Configure button-layout: */
    546546            m_pButtonLayout->setContentsMargins(0, 0, 0, 0);
    547             const int iS = qApp->style()->pixelMetric(QStyle::PM_LayoutHorizontalSpacing) / 2;
    548             m_pButtonLayout->setSpacing(iS);
     547#ifdef VBOX_WS_MAC
     548            m_pButtonLayout->setSpacing(5);
     549#else
     550            m_pButtonLayout->setSpacing(qApp->style()->pixelMetric(QStyle::PM_LayoutHorizontalSpacing) / 2);
     551#endif
    549552            /* Add button-layout into main-layout: */
    550553            m_pMainLayout->addLayout(m_pButtonLayout);
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIVMCloseDialog.cpp

    r69823 r70523  
    200200                // WORKAROUND:
    201201                // Why do we need it? It should be the default one, but it's not..
    202                 const int iS1 = qApp->style()->pixelMetric(QStyle::PM_LayoutVerticalSpacing);
    203                 pTopRightLayout->setSpacing(iS1);
     202#ifdef VBOX_WS_MAC
     203                pTopRightLayout->setSpacing(10);
     204#else
     205                pTopRightLayout->setSpacing(qApp->style()->pixelMetric(QStyle::PM_LayoutVerticalSpacing));
     206#endif
    204207
    205208                /* Prepare 'text' label: */
     
    211214                    // WORKAROUND:
    212215                    // Why do we need it? It should be the default one, but it's not..
    213                     const int iS2 = qApp->style()->pixelMetric(QStyle::PM_LayoutVerticalSpacing);
    214                     pChoiceLayout->setSpacing(iS2);
     216#ifdef VBOX_WS_MAC
     217                    pChoiceLayout->setSpacing(10);
     218#else
     219                    pChoiceLayout->setSpacing(qApp->style()->pixelMetric(QStyle::PM_LayoutVerticalSpacing));
     220#endif
    215221
    216222                    /* Prepare icon metric: */
     
    279285                    m_pDiscardCheckBox = new QCheckBox(this);
    280286                    /* Configure layout: */
    281 #ifdef VBOX_WS_MAC
    282                     pChoiceLayout->setSpacing(15);
    283 #endif
    284287                    pChoiceLayout->setContentsMargins(0, 0, 0, 0);
    285288                    pChoiceLayout->addWidget(m_pDetachIcon, 0, 0);
     
    294297                }
    295298                /* Configure layout: */
    296 #ifdef VBOX_WS_MAC
    297                 pTopRightLayout->setSpacing(15);
    298 #endif
    299299                pTopRightLayout->setContentsMargins(0, 0, 0, 0);
    300300                pTopRightLayout->addWidget(m_pLabel);
     
    303303            /* Configure layout: */
    304304            pTopLayout->setContentsMargins(0, 0, 0, 0);
    305             const int iS3 = qApp->style()->pixelMetric(QStyle::PM_LayoutHorizontalSpacing) * 2;
    306             pTopLayout->setSpacing(iS3);
     305#ifdef VBOX_WS_MAC
     306            pTopLayout->setSpacing(20);
     307#else
     308            pTopLayout->setSpacing(qApp->style()->pixelMetric(QStyle::PM_LayoutHorizontalSpacing) * 2);
     309#endif
    307310            pTopLayout->addItem(pTopLeftLayout);
    308311            pTopLayout->addItem(pTopRightLayout);
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/UISnapshotPane.cpp

    r69821 r70523  
    12421242        layout()->setSpacing(10);
    12431243#else
    1244         const int iS = qApp->style()->pixelMetric(QStyle::PM_LayoutVerticalSpacing) / 2;
    1245         layout()->setSpacing(iS);
     1244        layout()->setSpacing(qApp->style()->pixelMetric(QStyle::PM_LayoutVerticalSpacing) / 2);
    12461245#endif
    12471246
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsStorage.cpp

    r69821 r70523  
    34513451        mLtStorage->setSpacing(3);
    34523452#else
    3453         const int iS = qApp->style()->pixelMetric(QStyle::PM_LayoutVerticalSpacing) / 3;
    3454         mLtStorage->setSpacing(iS);
     3453        mLtStorage->setSpacing(qApp->style()->pixelMetric(QStyle::PM_LayoutVerticalSpacing) / 3);
    34553454#endif
    34563455
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsSystem.cpp

    r69821 r70523  
    756756            m_pLayoutBootOrder->setSpacing(3);
    757757#else
    758             const int iS = qApp->style()->pixelMetric(QStyle::PM_LayoutHorizontalSpacing) / 3;
    759             m_pLayoutBootOrder->setSpacing(iS);
     758            m_pLayoutBootOrder->setSpacing(qApp->style()->pixelMetric(QStyle::PM_LayoutHorizontalSpacing) / 3);
    760759#endif
    761760
  • trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIFilmContainer.cpp

    r69821 r70523  
    6969            /* Configure viewport layout: */
    7070            pWidgetLayout->setMargin(0);
    71             const int iS = qApp->style()->pixelMetric(QStyle::PM_LayoutHorizontalSpacing) / 2;
    72             pWidgetLayout->setSpacing(iS);
     71#ifdef VBOX_WS_MAC
     72            pWidgetLayout->setSpacing(5);
     73#else
     74            pWidgetLayout->setSpacing(qApp->style()->pixelMetric(QStyle::PM_LayoutHorizontalSpacing) / 2);
     75#endif
    7376            /* Create new widgets according passed vector: */
    7477            for (int iScreenIndex = 0; iScreenIndex < value.size(); ++iScreenIndex)
  • trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIHostComboEditor.cpp

    r69821 r70523  
    481481    {
    482482        /* Configure layout: */
    483         const int iS = qApp->style()->pixelMetric(QStyle::PM_LayoutVerticalSpacing) / 2;
    484         pLayout->setSpacing(iS);
     483#ifdef VBOX_WS_MAC
     484        pLayout->setSpacing(5);
     485#else
     486        pLayout->setSpacing(qApp->style()->pixelMetric(QStyle::PM_LayoutVerticalSpacing) / 2);
     487#endif
    485488        pLayout->setContentsMargins(0, 0, 0, 0);
    486489        /* Create UIHostComboEditorPrivate instance: */
  • trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIHotKeyEditor.cpp

    r69821 r70523  
    124124
    125125    /* Configure layout: */
    126     const int iS = qApp->style()->pixelMetric(QStyle::PM_LayoutVerticalSpacing) / 2;
    127     m_pMainLayout->setSpacing(iS);
     126#ifdef VBOX_WS_MAC
     127    m_pMainLayout->setSpacing(5);
     128#else
     129    m_pMainLayout->setSpacing(qApp->style()->pixelMetric(QStyle::PM_LayoutVerticalSpacing) / 2);
     130#endif
    128131    m_pMainLayout->setContentsMargins(0, 0, 0, 0);
    129132    m_pMainLayout->addWidget(m_pLineEdit);
  • trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIPortForwardingTable.cpp

    r69821 r70523  
    828828        pMainLayout->setSpacing(3);
    829829#else
    830         const int iS = qApp->style()->pixelMetric(QStyle::PM_LayoutHorizontalSpacing) / 3;
    831         pMainLayout->setSpacing(iS);
     830        pMainLayout->setSpacing(qApp->style()->pixelMetric(QStyle::PM_LayoutHorizontalSpacing) / 3);
    832831#endif
    833832        /* Create table: */
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