VirtualBox

Changeset 100135 in vbox


Ignore:
Timestamp:
Jun 8, 2023 7:48:21 PM (18 months ago)
Author:
vboxsync
Message:

FE/Qt: bugref:9080. Changing the layout a bit.

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/medium/viso/UIVisoCreator.cpp

    r100134 r100135  
    9797    , m_fShowToolBar(fShowToolBar)
    9898    , m_pSettingsWidget(0)
     99    , m_pBrowserContainerWidget(0)
    99100{
    100101    m_visoOptions.m_strVisoName = !strMachineName.isEmpty() ? strMachineName : "ad-hoc";
     
    158159void UIVisoCreatorWidget::sltPanelActionToggled(bool fChecked)
    159160{
     161    Q_UNUSED(fChecked);
    160162    if (m_pSettingsWidget)
    161163        m_pSettingsWidget->setVisible(!m_pSettingsWidget->isVisible());
    162     return;
     164#if 0
    163165    QAction *pSenderAction = qobject_cast<QAction*>(sender());
    164166    if (!pSenderAction)
     
    178180    else
    179181        hidePanel(pPanel);
     182#endif
    180183}
    181184
     
    261264void UIVisoCreatorWidget::prepareWidgets()
    262265{
    263     m_pMainLayout = new QGridLayout(this);
     266    m_pMainLayout = new QVBoxLayout(this);
    264267    if (!m_pMainLayout)
    265268        return;
     
    279282    if (m_pActionPool && m_pActionPool->action(UIActionIndex_M_VISOCreator))
    280283        m_pMainMenu = m_pActionPool->action(UIActionIndex_M_VISOCreator)->menu();
    281     int iLayoutRow = 0;
     284    // int iLayoutRow = 0;
    282285    if (m_fShowToolBar)
    283286    {
     
    289292            m_pToolBar->setIconSize(QSize(iIconMetric, iIconMetric));
    290293            m_pToolBar->setToolButtonStyle(Qt::ToolButtonTextUnderIcon);
    291             m_pMainLayout->addWidget(m_pToolBar, iLayoutRow++, 0, 1, 5);
     294            m_pMainLayout->addWidget(m_pToolBar);
    292295        }
    293296    }
    294297
     298    m_pBrowserContainerWidget = new QWidget;
     299    if (!m_pBrowserContainerWidget)
     300        return;
     301    m_pMainLayout->addWidget(m_pBrowserContainerWidget);
     302    QGridLayout *pContainerLayout = new QGridLayout(m_pBrowserContainerWidget);
     303    pContainerLayout->setContentsMargins(0, 0, 0, 0);
    295304    m_pHostBrowser = new UIVisoHostBrowser;
    296305    if (m_pHostBrowser)
    297306    {
    298         m_pMainLayout->addWidget(m_pHostBrowser, iLayoutRow, 0, 1, 4);
     307        pContainerLayout->addWidget(m_pHostBrowser, 0, 0, 1, 4);
    299308        //m_pMainLayout->setColumnStretch(m_pMainLayout->indexOf(m_pHostBrowser), 2);
    300309    }
     
    303312    if (m_pVerticalToolBar)
    304313    {
    305         m_pMainLayout->addWidget(m_pVerticalToolBar, iLayoutRow, 4, 1, 1);
     314        pContainerLayout->addWidget(m_pVerticalToolBar, 0, 4, 1, 1);
    306315        //m_pMainLayout->setColumnStretch(m_pMainLayout->indexOf(m_pVerticalToolBar), 1);
    307316    }
     
    310319    if (m_pVISOContentBrowser)
    311320    {
    312         m_pMainLayout->addWidget(m_pVISOContentBrowser, iLayoutRow, 5, 1, 4);
     321        pContainerLayout->addWidget(m_pVISOContentBrowser, 0, 5, 1, 4);
    313322        m_pVISOContentBrowser->setVisoName(m_visoOptions.m_strVisoName);
    314323        //m_pMainLayout->setColumnStretch(m_pMainLayout->indexOf(m_pVISOContentBrowser), 2);
    315324    }
    316     ++iLayoutRow;
    317     m_pConfigurationPanel = new UIVisoConfigurationPanel(this);
    318     if (m_pConfigurationPanel)
    319     {
    320         m_pMainLayout->addWidget(m_pConfigurationPanel, iLayoutRow++, 0, 1, 9);
    321         m_pConfigurationPanel->hide();
    322         m_pConfigurationPanel->setVisoName(m_visoOptions.m_strVisoName);
    323         m_pConfigurationPanel->setVisoCustomOptions(m_visoOptions.m_customOptions);
    324     }
    325 
    326     m_pCreatorOptionsPanel = new UIVisoConfigurationPanel;
    327     if (m_pCreatorOptionsPanel)
    328     {
    329         m_pCreatorOptionsPanel->setShowHiddenbjects(m_browserOptions.m_fShowHiddenObjects);
    330         m_pMainLayout->addWidget(m_pCreatorOptionsPanel, iLayoutRow++, 0, 1, 9);
    331         m_pCreatorOptionsPanel->hide();
    332     }
    333 
    334     m_pSettingsWidget = new UIVisoSettingWidget(this);
    335     if (m_pSettingsWidget)
    336     {
    337         QVBoxLayout *pMainLayout = new QVBoxLayout(m_pSettingsWidget);
    338         QPushButton *pB = new QPushButton;
    339         pB->setText("ssssasas");
    340         pMainLayout->addWidget(pB);
    341         m_pSettingsWidget->setVisible(false);
    342     }
     325    // ++iLayoutRow;
     326    // m_pConfigurationPanel = new UIVisoConfigurationPanel(this);
     327    // if (m_pConfigurationPanel)
     328    // {
     329    //     m_pMainLayout->addWidget(m_pConfigurationPanel, iLayoutRow++, 0, 1, 9);
     330    //     m_pConfigurationPanel->hide();
     331    //     m_pConfigurationPanel->setVisoName(m_visoOptions.m_strVisoName);
     332    //     m_pConfigurationPanel->setVisoCustomOptions(m_visoOptions.m_customOptions);
     333    // }
     334
     335    // m_pCreatorOptionsPanel = new UIVisoConfigurationPanel;
     336    // if (m_pCreatorOptionsPanel)
     337    // {
     338    //     m_pCreatorOptionsPanel->setShowHiddenbjects(m_browserOptions.m_fShowHiddenObjects);
     339    //     m_pMainLayout->addWidget(m_pCreatorOptionsPanel, iLayoutRow++, 0, 1, 9);
     340    //     m_pCreatorOptionsPanel->hide();
     341    // }
     342
     343    // m_pSettingsWidget = new UIVisoSettingWidget(this);
     344    // if (m_pSettingsWidget)
     345    // {
     346    //     QVBoxLayout *pMainLayout = new QVBoxLayout(m_pSettingsWidget);
     347    //     QPushButton *pB = new QPushButton;
     348    //     pB->setText("ssssasas");
     349    //     pMainLayout->addWidget(pB);
     350    //     m_pSettingsWidget->setVisible(false);
     351    // }
    343352}
    344353
     
    665674
    666675    m_pVisoCreatorWidget = new UIVisoCreatorWidget(m_pActionPool, this, true /* show toolbar */, strMachineName);
    667     if (m_pVisoCreatorWidget)
     676    if (m_pVisoCreatorWidget && m_pVisoCreatorWidget->menu())
    668677    {
    669678        menuBar()->addMenu(m_pVisoCreatorWidget->menu());
  • trunk/src/VBox/Frontends/VirtualBox/src/medium/viso/UIVisoCreator.h

    r100134 r100135  
    4444/* Forward declarations: */
    4545class QGridLayout;
     46class QVBoxLayout;
    4647class QLabel;
    4748class QMenu;
     
    160161    /** @} */
    161162
    162     QGridLayout          *m_pMainLayout;
     163    QVBoxLayout          *m_pMainLayout;
    163164    UIVisoHostBrowser    *m_pHostBrowser;
    164165    UIVisoContentBrowser *m_pVISOContentBrowser;
     
    176177    bool                   m_fShowToolBar;
    177178    UIVisoSettingWidget   *m_pSettingsWidget;
     179    QWidget               *m_pBrowserContainerWidget;
    178180};
    179181
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