VirtualBox

Changeset 72191 in vbox for trunk/src


Ignore:
Timestamp:
May 10, 2018 5:24:37 PM (7 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
122625
Message:

FE/Qt: bugref: 6769 In UIVMNamePathSelector: 1) use hi-res sensitive layout spacing and 2) show native paths in line edit

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

Legend:

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

    r72182 r72191  
    2424# include <QHBoxLayout>
    2525# include <QRegExpValidator>
     26# include <QStyle>
    2627
    2728/* GUI includes: */
     
    6566    if (!m_pMainLayout)
    6667        return;
    67     m_pMainLayout->setContentsMargins(0, 0, 0, 0);
    68     m_pMainLayout->setContentsMargins(0, 0, 0, 0);
    69     m_pMainLayout->setSpacing(0);
     68            /* Configure layout: */
     69#ifdef VBOX_WS_MAC
     70            m_pMainLayout->setContentsMargins(0, 0, 0, 0);
     71            m_pMainLayout->setSpacing(0);
     72#else
     73            m_pMainLayout->setContentsMargins(qApp->style()->pixelMetric(QStyle::PM_LayoutLeftMargin) / 2, 0,
     74                                                 qApp->style()->pixelMetric(QStyle::PM_LayoutRightMargin) / 2, 0);
     75            m_pMainLayout->setSpacing(qApp->style()->pixelMetric(QStyle::PM_LayoutHorizontalSpacing) / 2);
     76#endif
    7077    setLayout(m_pMainLayout);
    7178
     
    7481    {
    7582        m_pMainLayout->addWidget(m_pFileDialogButton);
    76         m_pFileDialogButton->setIcon(UIIconPool::iconSet(QString(":/sf_add_16px.png")));
     83        m_pFileDialogButton->setIcon(UIIconPool::iconSet(QString(":/select_file_16px.png")));
    7784        connect(m_pFileDialogButton, &QIToolButton::clicked, this, &UIVMNamePathSelector::sltOpenPathSelector);
    7885    }
     
    113120    if (!m_pPath || m_pPath->text() == path)
    114121        return;
    115     m_pPath->setText(path);
    116     m_pPath->setFixedWidthByText(path);
    117     emit sigPathChanged(path);
     122    QString nativePath(QDir::toNativeSeparators(path));
     123    m_pPath->setText(nativePath);
     124    m_pPath->setFixedWidthByText(nativePath);
     125    emit sigPathChanged(nativePath);
    118126}
    119127
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageBasic1.cpp

    r72186 r72191  
    351351void UIWizardNewVMPageBasic1::sltPathChanged(const QString &strNewPath)
    352352{
    353     RT_NOREF(strNewPath);
     353    Q_UNUSED(strNewPath);
    354354    composeMachineFilePath();
    355355}
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageExpert.cpp

    r72187 r72191  
    188188void UIWizardNewVMPageExpert::sltPathChanged(const QString &strNewPath)
    189189{
    190     RT_NOREF(strNewPath); /** @todo use this or get rid of it? See also UIWizardNewVMPageBasic1::sltPathChanged(). */
     190    Q_UNUSED(strNewPath);
    191191    composeMachineFilePath();
    192192}
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