Changeset 75372 in vbox for trunk/src/VBox/Frontends/VirtualBox
- Timestamp:
- Nov 9, 2018 5:52:53 PM (6 years ago)
- svn:sync-xref-src-repo-rev:
- 126507
- 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 5 5 6 6 /* 7 * Copyright (C) 2009-201 7Oracle Corporation7 * Copyright (C) 2009-2018 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as -
trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIScaleFactorEditor.h
r75370 r75372 5 5 6 6 /* 7 * Copyright (C) 2009-201 7Oracle Corporation7 * Copyright (C) 2009-2018 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 19 19 #define ___UIScaleFactorEditor_h___ 20 20 21 /* * GUI includes.*/21 /* GUI includes: */ 22 22 #include "QIWithRetranslateUI.h" 23 23 #include "UILibraryDefs.h" 24 24 25 26 /** Forward declarations. */ 25 /* Forward declarations: */ 27 26 class QComboBox; 28 27 class QGridLayout; … … 33 32 34 33 /** QWidget reimplementation providing GUI with monitor scale factor editing functionality. 35 * 36 * 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. */ 37 36 class SHARED_LIBRARY_STUFF UIScaleFactorEditor : public QIWithRetranslateUI<QWidget> 38 37 { … … 41 40 public: 42 41 42 /** Creates scale factor editor passing @a pParent to the base-class. */ 43 43 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 48 50 /** 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 51 56 /** Defines minimum width @a iHint for internal spin-box. */ 52 void 57 void setSpinBoxWidthHint(int iHint); 53 58 54 59 protected: 55 60 61 /** Handles translation event. */ 56 62 virtual void retranslateUi() /* override */; 57 63 … … 60 66 /** @name Internal slots handling respective widget's value update. 61 67 * @{ */ 62 void sltScaleSpinBoxValueChanged(int value);63 void sltScaleSliderValueChanged(int value);64 void sltMonitorComboIndexChanged(int i ndex);68 void sltScaleSpinBoxValueChanged(int iValue); 69 void sltScaleSliderValueChanged(int iValue); 70 void sltMonitorComboIndexChanged(int iIndex); 65 71 /** @} */ 66 72 67 73 private: 68 74 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(); 78 89 79 90 /** @name Member widgets. 80 91 * @{ */ 81 QSpinBox 82 QGridLayout 83 QComboBox 84 QIAdvancedSlider 85 QLabel 86 QLabel 92 QSpinBox *m_pScaleSpinBox; 93 QGridLayout *m_pMainLayout; 94 QComboBox *m_pMonitorComboBox; 95 QIAdvancedSlider *m_pScaleSlider; 96 QLabel *m_pMaxScaleLabel; 97 QLabel *m_pMinScaleLabel; 87 98 /** @} */ 88 99 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; 92 104 }; 93 105
Note:
See TracChangeset
for help on using the changeset viewer.