VirtualBox

Ignore:
Timestamp:
Nov 9, 2018 5:52:53 PM (6 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
126507
Message:

FE/Qt: Fixes for r126505: It's just unbelievable..

Location:
trunk/src/VBox/Frontends/VirtualBox/src/widgets
Files:
2 edited

Legend:

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

    r75370 r75372  
    55
    66/*
    7  * Copyright (C) 2009-2017 Oracle Corporation
     7 * Copyright (C) 2009-2018 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
  • trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIScaleFactorEditor.h

    r75370 r75372  
    55
    66/*
    7  * Copyright (C) 2009-2017 Oracle Corporation
     7 * Copyright (C) 2009-2018 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    1919#define ___UIScaleFactorEditor_h___
    2020
    21 /** GUI includes. */
     21/* GUI includes: */
    2222#include "QIWithRetranslateUI.h"
    2323#include "UILibraryDefs.h"
    2424
    25 
    26 /** Forward declarations. */
     25/* Forward declarations: */
    2726class QComboBox;
    2827class QGridLayout;
     
    3332
    3433/** QWidget reimplementation providing GUI with monitor scale factor editing functionality.
    35   *  It includes a combo box to select a monitor, a slider, and a spinbox to display/modify values.
    36   *  The first item in the combo box is used to change the scale factor of all monitors. */
     34  * It includes a combo box to select a monitor, a slider, and a spinbox to display/modify values.
     35  * The first item in the combo box is used to change the scale factor of all monitors. */
    3736class SHARED_LIBRARY_STUFF UIScaleFactorEditor : public QIWithRetranslateUI<QWidget>
    3837{
     
    4140public:
    4241
     42    /** Creates scale factor editor passing @a pParent to the base-class. */
    4343    UIScaleFactorEditor(QWidget *pParent);
    44     /** Configures the internal variables (m_pMonitorComboBox items , m_scaleFactors' size, etc)
    45       * wrt. @p iMonitorCount. */
    46     void           setMonitorCount(int iMonitorCount);
    47     void           setScaleFactors(const QList<double> &scaleFactors);
     44
     45    /** Defines @a iMonitorCount. */
     46    void setMonitorCount(int iMonitorCount);
     47    /** Defines a list of guest-screen @a scaleFactors. */
     48    void setScaleFactors(const QList<double> &scaleFactors);
     49
    4850    /** Returns either a single global scale factor or a list of scale factor for each monitor. */
    49     QList<double>  scaleFactors() const;
    50     void           setDefaultScaleFactor(double dDefaultScaleFactor);
     51    QList<double> scaleFactors() const;
     52
     53    /** Defines @a dDefaultScaleFactor. */
     54    void setDefaultScaleFactor(double dDefaultScaleFactor);
     55
    5156    /** Defines minimum width @a iHint for internal spin-box. */
    52     void           setSpinBoxWidthHint(int iHint);
     57    void setSpinBoxWidthHint(int iHint);
    5358
    5459protected:
    5560
     61    /** Handles translation event. */
    5662    virtual void retranslateUi() /* override */;
    5763
     
    6066    /** @name Internal slots handling respective widget's value update.
    6167      * @{ */
    62         void sltScaleSpinBoxValueChanged(int value);
    63         void sltScaleSliderValueChanged(int value);
    64         void sltMonitorComboIndexChanged(int index);
     68        void sltScaleSpinBoxValueChanged(int iValue);
     69        void sltScaleSliderValueChanged(int iValue);
     70        void sltMonitorComboIndexChanged(int iIndex);
    6571    /** @} */
    6672
    6773private:
    6874
    69     void               prepare();
    70     void               setIsGlobalScaleFactor(bool bFlag);
    71     void               setScaleFactor(int iMonitorIndex, int iScaleFactor);
    72     /** Blocks slider's signals before settting the slider value. */
    73     void               setSliderValue(int iValue);
    74     /** Blocks spinbox's signals before settting the value. */
    75     void               setSpinBoxValue(int iValue);
    76     /** Set the spinbox and slider to scale factor of currently selected monitor. */
    77     void               updateValuesAfterMonitorChange();
     75    /** Prepares all. */
     76    void prepare();
     77
     78    /** Defines whether scale factor is @a fGlobal one. */
     79    void setIsGlobalScaleFactor(bool fGlobal);
     80    /** Defines @a iScaleFactor for certain @a iMonitorIndex. */
     81    void setScaleFactor(int iMonitorIndex, int iScaleFactor);
     82    /** Defines slider's @a iValue. */
     83    void setSliderValue(int iValue);
     84    /** Defines spinbox's @a iValue. */
     85    void setSpinBoxValue(int iValue);
     86
     87    /** Sets the spinbox and slider to scale factor of currently selected monitor. */
     88    void updateValuesAfterMonitorChange();
    7889
    7990    /** @name Member widgets.
    8091      * @{ */
    81         QSpinBox          *m_pScaleSpinBox;
    82         QGridLayout       *m_pMainLayout;
    83         QComboBox         *m_pMonitorComboBox;
    84         QIAdvancedSlider  *m_pScaleSlider;
    85         QLabel            *m_pMaxScaleLabel;
    86         QLabel            *m_pMinScaleLabel;
     92        QSpinBox         *m_pScaleSpinBox;
     93        QGridLayout      *m_pMainLayout;
     94        QComboBox        *m_pMonitorComboBox;
     95        QIAdvancedSlider *m_pScaleSlider;
     96        QLabel           *m_pMaxScaleLabel;
     97        QLabel           *m_pMinScaleLabel;
    8798    /** @} */
    8899
    89     /** Stores the per-monitor scale factors. The 0th item is for all monitors (global). */
    90     QList<double>      m_scaleFactors;
    91     double             m_dDefaultScaleFactor;
     100    /** Holds the per-monitor scale factors. The 0th item is for all monitors (global). */
     101    QList<double>  m_scaleFactors;
     102    /** Holds the default scale factor. */
     103    double         m_dDefaultScaleFactor;
    92104};
    93105
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