VirtualBox

Changeset 87240 in vbox


Ignore:
Timestamp:
Jan 13, 2021 2:41:41 PM (4 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:9515. Get rid of the boring scroll bar

Location:
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageBasic1.cpp

    r87081 r87240  
    278278}
    279279
    280 void UIWizardNewVMPage1::addLine(QBoxLayout *pLayout)
     280QFrame *UIWizardNewVMPage1::horizontalLine()
    281281{
    282282    QFrame *line = new QFrame;
    283283    line->setFrameShape(QFrame::HLine);
    284284    line->setFrameShadow(QFrame::Sunken);
    285     pLayout->addWidget(line);
    286 }
    287 
    288 void UIWizardNewVMPage1::createNameOSTypeWidgets(QVBoxLayout *pLayout, bool fCreateLabels /* = true */)
    289 {
    290     AssertReturnVoid(pLayout);
    291 
     285    return line;
     286}
     287
     288int UIWizardNewVMPage1::createNameOSTypeWidgets(QGridLayout *pLayout, bool fCreateLabels /* = true */)
     289{
     290    AssertReturn(pLayout, 0);
     291    int iRow = 0;
    292292    if (fCreateLabels)
    293293    {
    294294        m_pNameOSTypeLabel = new QIRichTextLabel;
    295295        if (m_pNameOSTypeLabel)
    296             pLayout->addWidget(m_pNameOSTypeLabel);
     296            pLayout->addWidget(m_pNameOSTypeLabel, iRow++, 0, 1, 4);
    297297    }
    298298
    299299    m_pNameAndFolderEditor = new UINameAndSystemEditor(0, true, true, false);
    300300    if (m_pNameAndFolderEditor)
    301         pLayout->addWidget(m_pNameAndFolderEditor);
    302 
    303     addLine(pLayout);
     301        pLayout->addWidget(m_pNameAndFolderEditor, iRow++, 0, 1, 4);
     302
     303    pLayout->addWidget(horizontalLine(), iRow++, 0, 1, 4);
    304304
    305305    if (fCreateLabels)
     
    307307        m_pUnattendedLabel = new QIRichTextLabel;
    308308        if (m_pUnattendedLabel)
    309             pLayout->addWidget(m_pUnattendedLabel);
    310     }
    311 
    312     QGridLayout *pUnattendedInstall = new QGridLayout;
     309            pLayout->addWidget(m_pUnattendedLabel, iRow++, 0, 1, 4);
     310    }
     311
    313312    m_pEnableUnattendedInstallCheckBox = new QCheckBox;
    314     pUnattendedInstall->addWidget(m_pEnableUnattendedInstallCheckBox, 0, 0, 1, 4, Qt::AlignLeft);
     313    pLayout->addWidget(m_pEnableUnattendedInstallCheckBox, iRow++, 0, 1, 2, Qt::AlignLeft);
    315314
    316315    m_pISOSelectorLabel = new QLabel;
     
    320319        m_pISOSelectorLabel->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Fixed);
    321320        m_pISOSelectorLabel->setEnabled(false);
    322         pUnattendedInstall->addWidget(m_pISOSelectorLabel, 1, 0, 1, 1, Qt::AlignRight);
     321        pLayout->addWidget(m_pISOSelectorLabel, iRow, 0, 1, 1, Qt::AlignRight);
    323322    }
    324323    m_pISOFilePathSelector = new UIFilePathSelector;
     
    330329        m_pISOFilePathSelector->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
    331330        m_pISOFilePathSelector->setEnabled(false);
    332         pUnattendedInstall->addWidget(m_pISOFilePathSelector, 1, 1, 1, 4);
     331        pLayout->addWidget(m_pISOFilePathSelector, iRow++, 1, 1, 3);
    333332    }
    334333
     
    337336    {
    338337        m_pStartHeadlessCheckBox->setEnabled(false);
    339         pUnattendedInstall->addWidget(m_pStartHeadlessCheckBox, 2, 1, 1, 1);
    340     }
    341     pLayout->addLayout(pUnattendedInstall);
    342     addLine(pLayout);
     338        pLayout->addWidget(m_pStartHeadlessCheckBox, iRow++, 1, 1, 1);
     339    }
     340
     341    pLayout->addWidget(horizontalLine(), iRow++, 0, 1, 4);
     342
    343343    m_pSystemTypeEditor = new UINameAndSystemEditor(0, false, false, true);
    344344    if (m_pSystemTypeEditor)
    345         pLayout->addWidget(m_pSystemTypeEditor);
    346 
     345        pLayout->addWidget(m_pSystemTypeEditor, iRow++, 0, 1, 4);
     346    return iRow;
    347347}
    348348
     
    517517void UIWizardNewVMPageBasic1::prepare()
    518518{
    519     QVBoxLayout *pPageLayout = new QVBoxLayout(this);
    520     createNameOSTypeWidgets(pPageLayout, false);
    521     pPageLayout->addStretch();
     519    QGridLayout *pPageLayout = new QGridLayout(this);
     520    int iRow = createNameOSTypeWidgets(pPageLayout, false);
     521    pPageLayout->addItem(new QSpacerItem(20, 40, QSizePolicy::Expanding, QSizePolicy::Expanding),
     522                         iRow, 0, 1, 4);
    522523    createConnections();
    523524    /* Register fields: */
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageBasic1.h

    r87081 r87240  
    2828class QBoxLayout;
    2929class QCheckBox;
     30class QFrame;
    3031class QLabel;
    3132class QRadioButton;
    32 class QVBoxLayout;
     33class QGridLayout;
    3334class QIRichTextLabel;
    3435class UIFilePathSelector;
     
    7677    void composeMachineFilePath();
    7778    /** Creates the page widgets and adds them into the @p pGridLayout. */
    78     void createNameOSTypeWidgets(QVBoxLayout *pLayout, bool fCreateLabels = true);
     79    int createNameOSTypeWidgets(QGridLayout *pLayout, bool fCreateLabels = true);
    7980    void setTypeByISODetectedOSType(const QString &strDetectedOSType);
    8081    /** Colors the widgets red if they cause isComplete to fail. */
     
    103104
    104105    bool checkISOFile() const;
    105     void addLine(QBoxLayout *pLayout);
     106    QFrame *horizontalLine();
    106107
    107108    /** Full path (including the file name) of the machine's configuration file. */
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageExpert.cpp

    r87073 r87240  
    5252        m_pToolBox = new QToolBox;
    5353        m_pNameAndSystemContainer = new QWidget(this);
    54         QVBoxLayout *pNameContainerLayout = new QVBoxLayout(m_pNameAndSystemContainer);
     54        QGridLayout *pNameContainerLayout = new QGridLayout(m_pNameAndSystemContainer);
    5555        createNameOSTypeWidgets(pNameContainerLayout, false);
    5656        m_pGAInstallContainer = createGAInstallWidgets();
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