VirtualBox

Changeset 93992 in vbox


Ignore:
Timestamp:
Feb 28, 2022 5:56:58 PM (3 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:6899: Global preferences: Reworking Display page to increase page accessibility; Adding missed API bit into QIAdvancedSlider extension.

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/extensions/QIAdvancedSlider.cpp

    r93115 r93992  
    284284}
    285285
     286void QIAdvancedSlider::setToolTip(const QString &strToolTip)
     287{
     288    m_pSlider->setToolTip(strToolTip);
     289}
     290
    286291void QIAdvancedSlider::setOrientation(Qt::Orientation enmOrientation)
    287292{
  • trunk/src/VBox/Frontends/VirtualBox/src/extensions/QIAdvancedSlider.h

    r93115 r93992  
    104104    void setErrorHint(int iMin, int iMax);
    105105
     106    /** Defines slider @a strToolTip. */
     107    void setToolTip(const QString &strToolTip);
     108
    106109public slots:
    107110
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/editors/UIMaximumGuestScreenSizeEditor.cpp

    r93115 r93992  
    5353*********************************************************************************************************************************/
    5454
    55 UIMaximumGuestScreenSizeEditor::UIMaximumGuestScreenSizeEditor(QWidget *pParent /* = 0 */, bool fWithLabels /* = false */)
     55UIMaximumGuestScreenSizeEditor::UIMaximumGuestScreenSizeEditor(QWidget *pParent /* = 0 */)
    5656    : QIWithRetranslateUI<QWidget>(pParent)
    57     , m_fWithLabels(fWithLabels)
     57    , m_pLayout(0)
    5858    , m_pLabelPolicy(0)
    5959    , m_pComboPolicy(0)
     
    116116}
    117117
     118int UIMaximumGuestScreenSizeEditor::minimumLabelHorizontalHint() const
     119{
     120    int iMinimumHint = 0;
     121    iMinimumHint = qMax(iMinimumHint, m_pLabelPolicy->minimumSizeHint().width());
     122    iMinimumHint = qMax(iMinimumHint, m_pLabelMaxWidth->minimumSizeHint().width());
     123    iMinimumHint = qMax(iMinimumHint, m_pLabelMaxHeight->minimumSizeHint().width());
     124    return iMinimumHint;
     125}
     126
     127void UIMaximumGuestScreenSizeEditor::setMinimumLayoutIndent(int iIndent)
     128{
     129    if (m_pLayout)
     130        m_pLayout->setColumnMinimumWidth(0, iIndent);
     131}
     132
    118133void UIMaximumGuestScreenSizeEditor::retranslateUi()
    119134{
     
    123138        m_pLabelMaxWidth->setText(tr("&Width:"));
    124139    if (m_pSpinboxMaxWidth)
    125         m_pSpinboxMaxWidth->setWhatsThis(tr("Holds the maximum width which we would like the guest to use."));
     140        m_pSpinboxMaxWidth->setToolTip(tr("Holds the maximum width which we would like the guest to use."));
    126141    if (m_pLabelMaxHeight)
    127142        m_pLabelMaxHeight->setText(tr("&Height:"));
    128143    if (m_pSpinboxMaxHeight)
    129         m_pSpinboxMaxHeight->setWhatsThis(tr("Holds the maximum height which we would like the guest to use."));
    130 
    131     if (m_pComboPolicy)
    132     {
     144        m_pSpinboxMaxHeight->setToolTip(tr("Holds the maximum height which we would like the guest to use."));
     145
     146    if (m_pComboPolicy)
     147    {
     148        m_pComboPolicy->setToolTip(tr("Selects maximum guest screen size policy."));
    133149        for (int i = 0; i < m_pComboPolicy->count(); ++i)
    134150        {
    135151            const MaximumGuestScreenSizePolicy enmType = m_pComboPolicy->itemData(i).value<MaximumGuestScreenSizePolicy>();
    136152            m_pComboPolicy->setItemText(i, gpConverter->toString(enmType));
    137             switch (enmType)
    138             {
    139                 case MaximumGuestScreenSizePolicy_Automatic:
    140                     m_pComboPolicy->setItemData(i,
    141                                                 tr("Suggest a reasonable maximum screen size to the guest. The guest "
    142                                                    "will only see this suggestion when guest additions are installed."),
    143                                                 Qt::ToolTipRole);
    144                     break;
    145                 case MaximumGuestScreenSizePolicy_Any:
    146                     m_pComboPolicy->setItemData(i,
    147                                                 tr("Do not attempt to limit the size of the guest screen."),
    148                                                 Qt::ToolTipRole);
    149                     break;
    150                 case MaximumGuestScreenSizePolicy_Fixed:
    151                     m_pComboPolicy->setItemData(i,
    152                                                 tr("Suggest a maximum screen size to the guest. The guest will only see "
    153                                                    "this suggestion when guest additions are installed."),
    154                                                 Qt::ToolTipRole);
    155                     break;
    156             }
    157153        }
    158154    }
     
    198194{
    199195    /* Create main layout: */
    200     QGridLayout *pLayoutMain = new QGridLayout(this);
    201     if (pLayoutMain)
    202     {
    203         pLayoutMain->setContentsMargins(0, 0, 0, 0);
     196    m_pLayout = new QGridLayout(this);
     197    if (m_pLayout)
     198    {
     199        m_pLayout->setContentsMargins(0, 0, 0, 0);
     200        m_pLayout->setColumnStretch(1, 1);
    204201
    205202        const int iMinWidth = 640;
     
    207204        const int iMaxSize = 16 * _1K;
    208205
    209         int iColumn = 0;
    210         if (m_fWithLabels)
    211         {
    212             /* Prepare policy label: */
    213             m_pLabelPolicy = new QLabel(this);
    214             if (m_pLabelPolicy)
    215             {
    216                m_pLabelPolicy->setAlignment(Qt::AlignRight | Qt::AlignVCenter);
    217                pLayoutMain->addWidget(m_pLabelPolicy, 0, iColumn++);
    218             }
     206        /* Prepare policy label: */
     207        m_pLabelPolicy = new QLabel(this);
     208        if (m_pLabelPolicy)
     209        {
     210           m_pLabelPolicy->setAlignment(Qt::AlignRight | Qt::AlignVCenter);
     211           m_pLayout->addWidget(m_pLabelPolicy, 0, 0);
    219212        }
    220213        /* Prepare policy combo: */
     
    227220                    this, &UIMaximumGuestScreenSizeEditor::sltHandleCurrentPolicyIndexChanged);
    228221
    229             pLayoutMain->addWidget(m_pComboPolicy, 0, iColumn++);
    230         }
    231 
    232         iColumn = 0;
    233         if (m_fWithLabels)
    234         {
    235             /* Prepare max width label: */
    236             m_pLabelMaxWidth = new QLabel(this);
    237             if (m_pLabelMaxWidth)
    238             {
    239                 m_pLabelMaxWidth->setAlignment(Qt::AlignRight | Qt::AlignVCenter);
    240                 pLayoutMain->addWidget(m_pLabelMaxWidth, 1, iColumn++);
    241             }
     222            m_pLayout->addWidget(m_pComboPolicy, 0, 1);
     223        }
     224
     225        /* Prepare max width label: */
     226        m_pLabelMaxWidth = new QLabel(this);
     227        if (m_pLabelMaxWidth)
     228        {
     229            m_pLabelMaxWidth->setAlignment(Qt::AlignRight | Qt::AlignVCenter);
     230            m_pLayout->addWidget(m_pLabelMaxWidth, 1, 0);
    242231        }
    243232        /* Prepare max width spinbox: */
     
    252241                    this, &UIMaximumGuestScreenSizeEditor::sltHandleSizeChanged);
    253242
    254             pLayoutMain->addWidget(m_pSpinboxMaxWidth, 1, iColumn++);
    255         }
    256 
    257         iColumn = 0;
    258         if (m_fWithLabels)
    259         {
    260             /* Prepare max height label: */
    261             m_pLabelMaxHeight = new QLabel(this);
    262             if (m_pLabelMaxHeight)
    263             {
    264                 m_pLabelMaxHeight->setAlignment(Qt::AlignRight | Qt::AlignVCenter);
    265                 pLayoutMain->addWidget(m_pLabelMaxHeight, 2, iColumn++);
    266             }
     243            m_pLayout->addWidget(m_pSpinboxMaxWidth, 1, 1);
     244        }
     245
     246        /* Prepare max height label: */
     247        m_pLabelMaxHeight = new QLabel(this);
     248        if (m_pLabelMaxHeight)
     249        {
     250            m_pLabelMaxHeight->setAlignment(Qt::AlignRight | Qt::AlignVCenter);
     251            m_pLayout->addWidget(m_pLabelMaxHeight, 2, 0);
    267252        }
    268253        /* Prepare max width spinbox: */
     
    277262                    this, &UIMaximumGuestScreenSizeEditor::sltHandleSizeChanged);
    278263
    279             pLayoutMain->addWidget(m_pSpinboxMaxHeight, 2, iColumn++);
     264            m_pLayout->addWidget(m_pSpinboxMaxHeight, 2, 1);
    280265        }
    281266    }
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/editors/UIMaximumGuestScreenSizeEditor.h

    r93990 r93992  
    3131
    3232/* Forward declarations: */
     33class QGridLayout;
    3334class QLabel;
    3435class QSpinBox;
     
    7071public:
    7172
    72     /** Constructs maximum guest screen size editor passing @a pParent to the base-class.
    73       * @param  fWithLabels  Brings whether we should add labels ourselves. */
    74     UIMaximumGuestScreenSizeEditor(QWidget *pParent = 0, bool fWithLabels = false);
     73    /** Constructs maximum guest screen size editor passing @a pParent to the base-class. */
     74    UIMaximumGuestScreenSizeEditor(QWidget *pParent = 0);
    7575
    7676    /** Returns focus proxy 1. */
     
    8585    /** Returns editor value. */
    8686    UIMaximumGuestScreenSizeValue value() const;
     87
     88    /** Returns minimum layout hint. */
     89    int minimumLabelHorizontalHint() const;
     90    /** Defines minimum layout @a iIndent. */
     91    void setMinimumLayoutIndent(int iIndent);
    8792
    8893protected:
     
    105110    void populateCombo();
    106111
    107     /** Holds whether descriptive labels should be created. */
    108     bool  m_fWithLabels;
    109 
    110112    /** Holds the value to be selected. */
    111113    UIMaximumGuestScreenSizeValue  m_guiValue;
    112114
     115    /** Holds the main layout: */
     116    QGridLayout *m_pLayout;
    113117    /** Holds the policy label instance. */
    114     QLabel     *m_pLabelPolicy;
     118    QLabel      *m_pLabelPolicy;
    115119    /** Holds the policy combo instance. */
    116     QIComboBox *m_pComboPolicy;
     120    QIComboBox  *m_pComboPolicy;
    117121    /** Holds the max width label instance. */
    118     QLabel     *m_pLabelMaxWidth;
     122    QLabel      *m_pLabelMaxWidth;
    119123    /** Holds the max width spinbox instance. */
    120     QSpinBox   *m_pSpinboxMaxWidth;
     124    QSpinBox    *m_pSpinboxMaxWidth;
    121125    /** Holds the max height label instance. */
    122     QLabel     *m_pLabelMaxHeight;
     126    QLabel      *m_pLabelMaxHeight;
    123127    /** Holds the max height spinbox instance. */
    124     QSpinBox   *m_pSpinboxMaxHeight;
     128    QSpinBox    *m_pSpinboxMaxHeight;
    125129};
    126130
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/editors/UIScaleFactorEditor.cpp

    r93115 r93992  
    3333
    3434
    35 UIScaleFactorEditor::UIScaleFactorEditor(QWidget *pParent)
     35UIScaleFactorEditor::UIScaleFactorEditor(QWidget *pParent, bool fWithLabels /* = false */)
    3636    : QIWithRetranslateUI<QWidget>(pParent)
    37     , m_pMainLayout(0)
     37    , m_fWithLabels(fWithLabels)
     38    , m_pLayout(0)
     39    , m_pLabel(0)
    3840    , m_pMonitorComboBox(0)
    3941    , m_pScaleSlider(0)
     
    161163}
    162164
     165int UIScaleFactorEditor::minimumLabelHorizontalHint() const
     166{
     167    return m_pLabel ? m_pLabel->minimumSizeHint().width() : 0;
     168}
     169
     170void UIScaleFactorEditor::setMinimumLayoutIndent(int iIndent)
     171{
     172    if (m_pLayout)
     173        m_pLayout->setColumnMinimumWidth(0, iIndent);
     174}
     175
    163176void UIScaleFactorEditor::retranslateUi()
    164177{
    165     if (m_pMonitorComboBox && m_pMonitorComboBox->count() > 0)
    166     {
    167         m_pMonitorComboBox->setItemText(0, tr("All Monitors"));
    168         for (int i = 1; i < m_pMonitorComboBox->count(); ++i)
    169             m_pMonitorComboBox->setItemText(i, tr("Monitor %1").arg(i));
    170     }
    171     setToolTip(tr("Controls the guest screen scale factor."));
    172 
    173     m_pMinScaleLabel->setText(tr("%1%").arg(m_pScaleSlider->minimum()));
    174     m_pMaxScaleLabel->setText(tr("%1%").arg(m_pScaleSlider->maximum()));
     178    if (m_pLabel)
     179        m_pLabel->setText(tr("Scale &Factor:"));
     180
     181    if (m_pMonitorComboBox)
     182    {
     183        if (m_pMonitorComboBox->count() > 0)
     184        {
     185            m_pMonitorComboBox->setItemText(0, tr("All Monitors"));
     186            for (int i = 1; i < m_pMonitorComboBox->count(); ++i)
     187                m_pMonitorComboBox->setItemText(i, tr("Monitor %1").arg(i));
     188        }
     189        m_pMonitorComboBox->setToolTip(tr("Selects the index of monitor guest screen scale factor being defined for."));
     190    }
     191
     192    if (m_pScaleSlider)
     193        m_pScaleSlider->setToolTip(tr("Holds the guest screen scale factor."));
     194    if (m_pScaleSpinBox)
     195        m_pScaleSpinBox->setToolTip(tr("Holds the guest screen scale factor."));
     196
     197    if (m_pMinScaleLabel)
     198    {
     199        m_pMinScaleLabel->setText(tr("%1%").arg(m_pScaleSlider->minimum()));
     200        m_pMinScaleLabel->setToolTip(tr("Minimum possible scale factor."));
     201    }
     202    if (m_pMaxScaleLabel)
     203    {
     204        m_pMaxScaleLabel->setText(tr("%1%").arg(m_pScaleSlider->maximum()));
     205        m_pMaxScaleLabel->setToolTip(tr("Maximum possible scale factor."));
     206    }
    175207}
    176208
     
    196228void UIScaleFactorEditor::prepare()
    197229{
    198     m_pMainLayout = new QGridLayout(this);
    199     if (m_pMainLayout)
    200     {
    201         m_pMainLayout->setContentsMargins(0, 0, 0, 0);
    202 
    203         m_pMonitorComboBox = new QComboBox;
     230    m_pLayout = new QGridLayout(this);
     231    if (m_pLayout)
     232    {
     233        m_pLayout->setContentsMargins(0, 0, 0, 0);
     234        m_pLayout->setColumnStretch(1, 1);
     235        m_pLayout->setColumnStretch(2, 1);
     236
     237        /* Prepare label: */
     238        if (m_fWithLabels)
     239        {
     240            m_pLabel = new QLabel(this);
     241            if (m_pLabel)
     242            {
     243                m_pLabel->setAlignment(Qt::AlignRight | Qt::AlignVCenter);
     244                m_pLayout->addWidget(m_pLabel, 0, 0);
     245            }
     246        }
     247
     248        m_pMonitorComboBox = new QComboBox(this);
    204249        if (m_pMonitorComboBox)
    205250        {
     
    207252            connect(m_pMonitorComboBox ,static_cast<void(QComboBox::*)(int)>(&QComboBox::currentIndexChanged),
    208253                    this, &UIScaleFactorEditor::sltMonitorComboIndexChanged);
    209             m_pMainLayout->addWidget(m_pMonitorComboBox, 0, 0);
    210         }
    211 
    212         QGridLayout *pSliderLayout = new QGridLayout;
    213         if (pSliderLayout)
    214         {
    215             m_pScaleSlider = new QIAdvancedSlider;
    216             {
    217                 m_pScaleSlider->setPageStep(10);
    218                 m_pScaleSlider->setSingleStep(1);
    219                 m_pScaleSlider->setTickInterval(10);
    220                 m_pScaleSlider->setSnappingEnabled(true);
    221                 connect(m_pScaleSlider, static_cast<void(QIAdvancedSlider::*)(int)>(&QIAdvancedSlider::valueChanged),
    222                         this, &UIScaleFactorEditor::sltScaleSliderValueChanged);
    223                 pSliderLayout->addWidget(m_pScaleSlider, 0, 0, 1, 3);
    224             }
    225 
    226             m_pMinScaleLabel = new QLabel;
    227             if (m_pMinScaleLabel)
    228                 pSliderLayout->addWidget(m_pMinScaleLabel, 1, 0);
    229 
    230             QSpacerItem *pSpacer = new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum);
    231             if (pSpacer)
    232                 pSliderLayout->addItem(pSpacer, 1, 1);
    233 
    234             m_pMaxScaleLabel = new QLabel;
    235             if (m_pMaxScaleLabel)
    236                 pSliderLayout->addWidget(m_pMaxScaleLabel, 1, 2);
    237 
    238             m_pMainLayout->addLayout(pSliderLayout, 0, 1, 2, 1);
    239         }
    240 
    241         m_pScaleSpinBox = new QSpinBox;
     254
     255            m_pLayout->addWidget(m_pMonitorComboBox, 0, 1);
     256        }
     257
     258        m_pScaleSlider = new QIAdvancedSlider(this);
     259        {
     260            if (m_pLabel)
     261                m_pLabel->setBuddy(m_pScaleSlider);
     262            m_pScaleSlider->setPageStep(10);
     263            m_pScaleSlider->setSingleStep(1);
     264            m_pScaleSlider->setTickInterval(10);
     265            m_pScaleSlider->setSnappingEnabled(true);
     266            connect(m_pScaleSlider, static_cast<void(QIAdvancedSlider::*)(int)>(&QIAdvancedSlider::valueChanged),
     267                    this, &UIScaleFactorEditor::sltScaleSliderValueChanged);
     268
     269            m_pLayout->addWidget(m_pScaleSlider, 0, 2, 1, 2);
     270        }
     271
     272        m_pScaleSpinBox = new QSpinBox(this);
    242273        if (m_pScaleSpinBox)
    243274        {
     
    246277            connect(m_pScaleSpinBox ,static_cast<void(QSpinBox::*)(int)>(&QSpinBox::valueChanged),
    247278                    this, &UIScaleFactorEditor::sltScaleSpinBoxValueChanged);
    248             m_pMainLayout->addWidget(m_pScaleSpinBox, 0, 3);
    249         }
     279            m_pLayout->addWidget(m_pScaleSpinBox, 0, 4);
     280        }
     281
     282        m_pMinScaleLabel = new QLabel(this);
     283        if (m_pMinScaleLabel)
     284            m_pLayout->addWidget(m_pMinScaleLabel, 1, 2);
     285
     286        m_pMaxScaleLabel = new QLabel(this);
     287        if (m_pMaxScaleLabel)
     288            m_pLayout->addWidget(m_pMaxScaleLabel, 1, 3);
    250289    }
    251290
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/editors/UIScaleFactorEditor.h

    r93990 r93992  
    4343public:
    4444
    45     /** Creates scale factor editor passing @a pParent to the base-class. */
    46     UIScaleFactorEditor(QWidget *pParent);
     45    /** Creates scale factor editor passing @a pParent to the base-class.
     46      * @param  fWithLabels  Brings whether we should add labels ourselves. */
     47    UIScaleFactorEditor(QWidget *pParent, bool fWithLabels = false);
    4748
    4849    /** Defines @a iMonitorCount. */
     
    5960    /** Defines minimum width @a iHint for internal spin-box. */
    6061    void setSpinBoxWidthHint(int iHint);
     62
     63    /** Returns minimum layout hint. */
     64    int minimumLabelHorizontalHint() const;
     65    /** Defines minimum layout @a iIndent. */
     66    void setMinimumLayoutIndent(int iIndent);
    6167
    6268protected:
     
    95101    /** @name Member widgets.
    96102      * @{ */
    97         QGridLayout      *m_pMainLayout;
     103        bool              m_fWithLabels;
     104        QGridLayout      *m_pLayout;
     105        QLabel           *m_pLabel;
    98106        QComboBox        *m_pMonitorComboBox;
    99107        QIAdvancedSlider *m_pScaleSlider;
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsDisplay.cpp

    r93819 r93992  
    7676UIGlobalSettingsDisplay::UIGlobalSettingsDisplay()
    7777    : m_pCache(0)
    78     , m_pLabelMaximumGuestScreenSizePolicy(0)
    79     , m_pLabelMaximumGuestScreenWidth(0)
    80     , m_pLabelMaximumGuestScreenHeight(0)
    8178    , m_pEditorMaximumGuestScreenSize(0)
    82     , m_pLabelScaleFactor(0)
    8379    , m_pEditorScaleFactor(0)
    84     , m_pLabelMachineWindows(0)
     80    , m_pLabelExtendedFeatures(0)
    8581    , m_pCheckBoxActivateOnMouseHover(0)
    8682    , m_pCheckBoxDisableHostScreenSaver(0)
     
    157153void UIGlobalSettingsDisplay::retranslateUi()
    158154{
    159     m_pLabelMaximumGuestScreenSizePolicy->setText(tr("Maximum Guest Screen &Size:"));
    160     m_pLabelMaximumGuestScreenWidth->setText(tr("&Width:"));
    161     m_pLabelMaximumGuestScreenHeight->setText(tr("&Height:"));
    162     m_pLabelScaleFactor->setText(tr("Scale &Factor:"));
    163     m_pLabelMachineWindows->setText(tr("Extended Features:"));
     155    m_pLabelExtendedFeatures->setText(tr("Extended Features:"));
    164156    m_pCheckBoxActivateOnMouseHover->setToolTip(tr("When checked, machine windows will be raised "
    165157                                                   "when the mouse pointer moves over them."));
     
    170162        m_pCheckBoxDisableHostScreenSaver->setText(tr("&Disable Host Screen Saver"));
    171163    }
     164
     165    /* These editors have own labels, but we want them to be properly layouted according to each other: */
     166    int iMinimumLayoutHint = 0;
     167    iMinimumLayoutHint = qMax(iMinimumLayoutHint, m_pEditorMaximumGuestScreenSize->minimumLabelHorizontalHint());
     168    iMinimumLayoutHint = qMax(iMinimumLayoutHint, m_pEditorScaleFactor->minimumLabelHorizontalHint());
     169    iMinimumLayoutHint = qMax(iMinimumLayoutHint, m_pLabelExtendedFeatures->minimumSizeHint().width());
     170    m_pEditorMaximumGuestScreenSize->setMinimumLayoutIndent(iMinimumLayoutHint);
     171    m_pEditorScaleFactor->setMinimumLayoutIndent(iMinimumLayoutHint);
     172    m_pLayout->setColumnMinimumWidth(0, iMinimumLayoutHint);
    172173}
    173174
     
    188189{
    189190    /* Prepare main layout: */
    190     QGridLayout *pLayoutMain = new QGridLayout(this);
    191     if (pLayoutMain)
    192     {
    193         pLayoutMain->setColumnStretch(1, 1);
    194         pLayoutMain->setRowStretch(7, 1);
    195 
    196         /* Prepare maximum guest screen size label: */
    197         m_pLabelMaximumGuestScreenSizePolicy = new QLabel(this);
    198         if (m_pLabelMaximumGuestScreenSizePolicy)
    199         {
    200            m_pLabelMaximumGuestScreenSizePolicy->setAlignment(Qt::AlignRight | Qt::AlignVCenter);
    201            pLayoutMain->addWidget(m_pLabelMaximumGuestScreenSizePolicy, 0, 0);
    202         }
    203         /* Prepare maximum guest screen width label: */
    204         m_pLabelMaximumGuestScreenWidth = new QLabel(this);
    205         if (m_pLabelMaximumGuestScreenWidth)
    206         {
    207             m_pLabelMaximumGuestScreenWidth->setAlignment(Qt::AlignRight | Qt::AlignVCenter);
    208             pLayoutMain->addWidget(m_pLabelMaximumGuestScreenWidth, 1, 0);
    209         }
    210         /* Prepare maximum guest screen height label: */
    211         m_pLabelMaximumGuestScreenHeight = new QLabel(this);
    212         if (m_pLabelMaximumGuestScreenHeight)
    213         {
    214             m_pLabelMaximumGuestScreenHeight->setAlignment(Qt::AlignRight | Qt::AlignVCenter);
    215             pLayoutMain->addWidget(m_pLabelMaximumGuestScreenHeight, 2, 0);
    216         }
     191    m_pLayout = new QGridLayout(this);
     192    if (m_pLayout)
     193    {
     194        m_pLayout->setColumnStretch(1, 1);
     195        m_pLayout->setRowStretch(4, 1);
     196
    217197        /* Prepare maximum guest screen size editor: */
    218198        m_pEditorMaximumGuestScreenSize = new UIMaximumGuestScreenSizeEditor(this);
    219199        if (m_pEditorMaximumGuestScreenSize)
     200            m_pLayout->addWidget(m_pEditorMaximumGuestScreenSize, 0, 0, 1, 3);
     201
     202        /* Prepare scale-factor editor: */
     203        m_pEditorScaleFactor = new UIScaleFactorEditor(this, true /* with label */);
     204        if (m_pEditorScaleFactor)
     205            m_pLayout->addWidget(m_pEditorScaleFactor, 1, 0, 1, 3);
     206
     207        /* Prepare 'machine-windows' label: */
     208        m_pLabelExtendedFeatures = new QLabel(this);
     209        if (m_pLabelExtendedFeatures)
    220210        {
    221             if (m_pLabelMaximumGuestScreenSizePolicy)
    222                 m_pLabelMaximumGuestScreenSizePolicy->setBuddy(m_pEditorMaximumGuestScreenSize->focusProxy1());
    223             if (m_pLabelMaximumGuestScreenWidth)
    224                 m_pLabelMaximumGuestScreenWidth->setBuddy(m_pEditorMaximumGuestScreenSize->focusProxy2());
    225             if (m_pLabelMaximumGuestScreenHeight)
    226                 m_pLabelMaximumGuestScreenHeight->setBuddy(m_pEditorMaximumGuestScreenSize->focusProxy3());
    227             pLayoutMain->addWidget(m_pEditorMaximumGuestScreenSize, 0, 1, 3, 2);
    228         }
    229 
    230         /* Prepare scale-factor label: */
    231         m_pLabelScaleFactor = new QLabel(this);
    232         if (m_pLabelScaleFactor)
    233         {
    234             m_pLabelScaleFactor->setAlignment(Qt::AlignRight | Qt::AlignVCenter);
    235             pLayoutMain->addWidget(m_pLabelScaleFactor, 3, 0);
    236         }
    237         /* Prepare scale-factor editor: */
    238         m_pEditorScaleFactor = new UIScaleFactorEditor(this);
    239         if (m_pEditorScaleFactor)
    240         {
    241             if (m_pLabelScaleFactor)
    242                 m_pLabelScaleFactor->setBuddy(m_pEditorScaleFactor->focusProxy());
    243             pLayoutMain->addWidget(m_pEditorScaleFactor, 3, 1, 2, 2);
    244         }
    245 
    246         /* Prepare 'machine-windows' label: */
    247         m_pLabelMachineWindows = new QLabel(this);
    248         if (m_pLabelMachineWindows)
    249         {
    250             m_pLabelMachineWindows->setAlignment(Qt::AlignRight | Qt::AlignVCenter);
    251             pLayoutMain->addWidget(m_pLabelMachineWindows, 5, 0);
     211            m_pLabelExtendedFeatures->setAlignment(Qt::AlignRight | Qt::AlignVCenter);
     212            m_pLayout->addWidget(m_pLabelExtendedFeatures, 2, 0);
    252213        }
    253214        /* Prepare 'activate on mouse hover' check-box: */
    254215        m_pCheckBoxActivateOnMouseHover = new QCheckBox(this);
    255216        if (m_pCheckBoxActivateOnMouseHover)
    256             pLayoutMain->addWidget(m_pCheckBoxActivateOnMouseHover, 5, 1);
     217            m_pLayout->addWidget(m_pCheckBoxActivateOnMouseHover, 2, 1);
    257218
    258219        /* Prepare 'disable host screen saver' check-box: */
     
    262223        if (NativeWindowSubsystem::X11CheckDBusScreenSaverServices())
    263224            m_pCheckBoxDisableHostScreenSaver = new QCheckBox(this);
    264 #endif
     225#endif /* VBOX_WS_X11 */
    265226        if (m_pCheckBoxDisableHostScreenSaver)
    266             pLayoutMain->addWidget(m_pCheckBoxDisableHostScreenSaver, 6, 1);
    267 
     227            m_pLayout->addWidget(m_pCheckBoxDisableHostScreenSaver, 3, 1);
    268228    }
    269229}
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsDisplay.h

    r93990 r93992  
    2727/* Forward declarations: */
    2828class QCheckBox;
     29class QGridLayout;
    2930class QLabel;
    3031class UIMaximumGuestScreenSizeEditor;
     
    8182    /** @name Widgets
    8283     * @{ */
    83         /** Holds the maximum guest screen size label instance. */
    84         QLabel                         *m_pLabelMaximumGuestScreenSizePolicy;
    85         /** Holds the maximum guest screen width label instance. */
    86         QLabel                         *m_pLabelMaximumGuestScreenWidth;
    87         /** Holds the maximum guest screen height label instance. */
    88         QLabel                         *m_pLabelMaximumGuestScreenHeight;
     84        /** Holds the main layout instance. */
     85        QGridLayout *m_pLayout;
     86
    8987        /** Holds the maximum guest screen size editor instance. */
    9088        UIMaximumGuestScreenSizeEditor *m_pEditorMaximumGuestScreenSize;
    91         /** Holds the scale-factor label instance. */
    92         QLabel                         *m_pLabelScaleFactor;
     89
    9390        /** Holds the scale-factor editor instance. */
    94         UIScaleFactorEditor            *m_pEditorScaleFactor;
    95         /** Holds the 'machine-windows' label instance. */
    96         QLabel                         *m_pLabelMachineWindows;
     91        UIScaleFactorEditor *m_pEditorScaleFactor;
     92
     93        /** Holds the 'extended features' label instance. */
     94        QLabel    *m_pLabelExtendedFeatures;
    9795        /** Holds the 'activate on mouse hover' check-box instance. */
    98         QCheckBox                      *m_pCheckBoxActivateOnMouseHover;
     96        QCheckBox *m_pCheckBoxActivateOnMouseHover;
    9997        /** Holds the 'disable host screen saver' check-box instance. */
    100         QCheckBox                      *m_pCheckBoxDisableHostScreenSaver;
     98        QCheckBox *m_pCheckBoxDisableHostScreenSaver;
    10199    /** @} */
    102100};
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