VirtualBox

Changeset 100876 in vbox for trunk


Ignore:
Timestamp:
Aug 15, 2023 5:25:45 AM (20 months ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
158793
Message:

FE/Qt: bugref:10496, bugref:9080. Some layout changes.

File:
1 edited

Legend:

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

    r100816 r100876  
    9494    QCheckBox    *m_pShowHiddenObjectsCheckBox;
    9595    QILabel      *m_pShowHiddenObjectsLabel;
     96    QGridLayout  *m_pVisoOptionsGridLayout;
    9697};
    9798
     
    110111    , m_pShowHiddenObjectsCheckBox(0)
    111112    , m_pShowHiddenObjectsLabel(0)
     113    , m_pVisoOptionsGridLayout(0)
    112114{
    113115    prepareObjects();
     
    125127    QWidget *pVisoOptionsContainerWidget = new QWidget;
    126128    AssertReturnVoid(pVisoOptionsContainerWidget);
    127     QGridLayout *pVisoOptionsGridLayout = new QGridLayout(pVisoOptionsContainerWidget);
    128     AssertReturnVoid(pVisoOptionsGridLayout);
     129    m_pVisoOptionsGridLayout = new QGridLayout(pVisoOptionsContainerWidget);
     130    AssertReturnVoid(m_pVisoOptionsGridLayout);
    129131    //pVisoOptionsGridLayout->setSpacing(0);
    130132    //pVisoOptionsGridLayout->setContentsMargins(0, 0, 0, 0);
     
    136138    m_pVisoNameLineEdit = new QILineEdit;
    137139    int iRow = 0;
    138     if (m_pVisoNameLabel && m_pVisoNameLineEdit)
    139     {
    140         m_pVisoNameLabel->setBuddy(m_pVisoNameLineEdit);
    141         pVisoOptionsGridLayout->addWidget(m_pVisoNameLabel,    iRow, 0, 1, 1, Qt::AlignTop);
    142         pVisoOptionsGridLayout->addWidget(m_pVisoNameLineEdit, iRow, 1, 1, 1, Qt::AlignTop);
    143     }
     140    AssertReturnVoid(m_pVisoNameLabel);
     141    AssertReturnVoid(m_pVisoNameLineEdit);
     142    m_pVisoNameLabel->setBuddy(m_pVisoNameLineEdit);
     143    m_pVisoNameLabel->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum);
     144    //m_pVisoNameLineEdit->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Minimum);
     145    m_pVisoOptionsGridLayout->addWidget(m_pVisoNameLabel, iRow, 0, 1, 1, Qt::AlignTop);
     146    m_pVisoOptionsGridLayout->addWidget(m_pVisoNameLineEdit, iRow, 1, 1, 1, Qt::AlignTop);
     147    m_pVisoOptionsGridLayout->addItem(new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum), iRow, 2, 1, 3);
    144148
    145149    /* Custom Viso options stuff: */
     
    150154    AssertReturnVoid(m_pCustomOptionsLineEdit);
    151155    m_pCustomOptionsLabel->setBuddy(m_pCustomOptionsLineEdit);
    152     pVisoOptionsGridLayout->addWidget(m_pCustomOptionsLabel,    iRow, 0, 1, 1, Qt::AlignTop);
    153     pVisoOptionsGridLayout->addWidget(m_pCustomOptionsLineEdit, iRow, 1, 1, 1, Qt::AlignTop);
     156    //m_pCustomOptionsLineEdit->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Minimum);
     157    m_pCustomOptionsLabel->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum);
     158    m_pVisoOptionsGridLayout->addWidget(m_pCustomOptionsLabel, iRow, 0, 1, 1, Qt::AlignTop);
     159    m_pVisoOptionsGridLayout->addWidget(m_pCustomOptionsLineEdit, iRow, 1, 1, 1, Qt::AlignTop);
     160    m_pVisoOptionsGridLayout->addItem(new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum), iRow, 2, 1, 3);
    154161
    155162    ++iRow;
    156     pVisoOptionsGridLayout->addItem(new QSpacerItem(0, 0, QSizePolicy::Minimum, QSizePolicy::Expanding), iRow, 0, 1, 2);
    157 
     163    m_pVisoOptionsGridLayout->addItem(new QSpacerItem(0, 0, QSizePolicy::Minimum, QSizePolicy::Expanding), iRow, 0, 1, 2);
    158164    QWidget *pDialogSettingsContainerWidget = new QWidget;
    159165    AssertReturnVoid(pDialogSettingsContainerWidget);
     
    164170
    165171    iRow = 0;
     172    QHBoxLayout *pShowHiddenObjectsLayout = new QHBoxLayout;
    166173    m_pShowHiddenObjectsCheckBox = new QCheckBox;
    167174    m_pShowHiddenObjectsLabel = new QILabel(QApplication::translate("UIVisoCreatorWidget", "Show Hidden Objects:"));
    168175    m_pShowHiddenObjectsLabel->setBuddy(m_pShowHiddenObjectsCheckBox);
    169     pDialogSettingsContainerLayout->addWidget(m_pShowHiddenObjectsLabel,    iRow, 0, 1, 1, Qt::AlignTop);
    170     pDialogSettingsContainerLayout ->addWidget(m_pShowHiddenObjectsCheckBox, iRow, 1, 1, 1, Qt::AlignTop);
     176    pShowHiddenObjectsLayout->addWidget(m_pShowHiddenObjectsLabel);
     177    pShowHiddenObjectsLayout->addWidget(m_pShowHiddenObjectsCheckBox);
     178    pShowHiddenObjectsLayout->addStretch(1);
     179    pDialogSettingsContainerLayout->addLayout(pShowHiddenObjectsLayout, iRow, 0, 1, 2, Qt::AlignTop);
    171180
    172181    ++iRow;
     
    177186void UIVisoSettingWidget::retranslateUi()
    178187{
     188    int iLabelWidth = 0;
    179189    if (m_pVisoNameLabel)
     190    {
    180191        m_pVisoNameLabel->setText(QApplication::translate("UIVisoCreatorWidget", "VISO Name:"));
     192        iLabelWidth = m_pVisoNameLabel->width();
     193    }
    181194    if (m_pCustomOptionsLabel)
     195    {
    182196        m_pCustomOptionsLabel->setText(QApplication::translate("UIVisoCreatorWidget", "Custom VISO options:"));
     197        iLabelWidth = qMax(iLabelWidth, m_pCustomOptionsLabel->width());
     198    }
    183199
    184200    if (m_pVisoNameLineEdit)
     
    191207        m_pShowHiddenObjectsCheckBox->setToolTip(QApplication::translate("UIVisoCreatorWidget", "When checked, "
    192208                                                                         "multiple hidden objects are shown in the file browser"));
     209
     210    //m_pVisoOptionsGridLayout->setColumnMinimumWidth(0, iLabelWidth);
    193211}
    194212
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette