VirtualBox

Changeset 108574 in vbox for trunk/src


Ignore:
Timestamp:
Mar 17, 2025 2:04:09 PM (8 weeks ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
167979
Message:

FE/Qt: bugref:10867. Configuring editor label.

File:
1 edited

Legend:

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

    r108570 r108574  
    293293    m_pLabelMinSize->setText(UITranslator::formatSize(m_uSizeMin));
    294294    m_pLabelMaxSize->setText(UITranslator::formatSize(m_uSizeMax));
     295    if (m_pEditorLabel)
     296        m_pEditorLabel->setText(tr("D&isk Size"));
    295297
    296298    /* Translate fields: */
     
    342344    m_regExNonDigitOrSeparator = QRegularExpression(QString("[^\\d%1]").arg(UITranslator::decimalSep()));
    343345
    344     /* Create layout: */
    345     m_pLayout = new QGridLayout(this);
    346     AssertPtrReturnVoid(m_pLayout);
    347 
    348     /* Configure layout: */
    349     m_pLayout->setContentsMargins(0, 0, 0, 0);
    350     m_pLayout->setColumnStretch(0, 1);
    351     m_pLayout->setColumnStretch(1, 1);
    352     m_pLayout->setColumnStretch(2, 0);
    353 
    354346    /* Create editor label: */
    355347    if (fEnableEditorLabel)
    356348    {
    357349        m_pEditorLabel = new QLabel(this);
     350        m_pEditorLabel->setAlignment(Qt::AlignRight | Qt::AlignVCenter);
    358351        AssertReturnVoid(m_pEditorLabel);
    359352    }
     
    368361            this, &UIMediumSizeEditor::sltSizeSliderChanged);
    369362
    370     /* Add into layout: */
    371     m_pLayout->addWidget(m_pSlider, 0, 0, 1, 2, Qt::AlignTop);
    372 
    373 
    374363    /* Create minimum size label: */
    375364    m_pLabelMinSize = new QLabel;
     
    378367    m_pLabelMinSize->setAlignment(Qt::AlignLeft | Qt::AlignVCenter);
    379368
    380     /* Add into layout: */
    381     m_pLayout->addWidget(m_pLabelMinSize, 1, 0);
    382 
    383369    /* Create maximum size label: */
    384370    m_pLabelMaxSize = new QLabel;
     
    386372    /* Configure label: */
    387373    m_pLabelMaxSize->setAlignment(Qt::AlignRight | Qt::AlignVCenter);
    388     /* Add into layout: */
    389     m_pLayout->addWidget(m_pLabelMaxSize, 1, 1);
     374
    390375
    391376    /* Create size editor: */
    392377    m_pEditor = new QILineEdit;
    393378    AssertPtrReturnVoid(m_pEditor);
     379    if (m_pEditorLabel)
     380        m_pEditorLabel->setBuddy(m_pEditorLabel);
    394381
    395382    /* Configure editor: */
     
    402389            this, &UIMediumSizeEditor::sltSizeEditorTextChanged);
    403390
    404     /* Add into layout: */
    405     m_pLayout->addWidget(m_pEditor, 0, 2, Qt::AlignTop);
     391    /* Create layout: */
     392    m_pLayout = new QGridLayout(this);
     393    AssertPtrReturnVoid(m_pLayout);
     394
     395    /* Configure layout: */
     396    m_pLayout->setContentsMargins(0, 0, 0, 0);
     397    if (m_pEditorLabel)
     398    {
     399        m_pLayout->setColumnStretch(1, 1);
     400        m_pLayout->setColumnStretch(2, 1);
     401        m_pLayout->setColumnStretch(3, 0);
     402
     403        m_pLayout->addWidget(m_pEditorLabel,  0, 0, 1, 1);
     404        m_pLayout->addWidget(m_pSlider,       0, 1, 1, 2, Qt::AlignTop);
     405        m_pLayout->addWidget(m_pLabelMinSize, 1, 1);
     406        m_pLayout->addWidget(m_pLabelMaxSize, 1, 2);
     407        m_pLayout->addWidget(m_pEditor,       0, 3, Qt::AlignTop);
     408    }
     409    else
     410    {
     411        m_pLayout->setColumnStretch(0, 1);
     412        m_pLayout->setColumnStretch(1, 1);
     413        m_pLayout->setColumnStretch(2, 0);
     414
     415        m_pLayout->addWidget(m_pSlider, 0, 0, 1, 2, Qt::AlignTop);
     416        m_pLayout->addWidget(m_pLabelMinSize, 1, 0);
     417        m_pLayout->addWidget(m_pLabelMaxSize, 1, 1);
     418        m_pLayout->addWidget(m_pEditor, 0, 2, Qt::AlignTop);
     419    }
    406420
    407421    /* Apply language settings: */
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