Changeset 97322 in vbox
- Timestamp:
- Oct 27, 2022 1:02:36 PM (2 years ago)
- svn:sync-xref-src-repo-rev:
- 154313
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/settings/editors
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/settings/editors/UIFontScaleEditor.cpp
r97318 r97322 68 68 , m_pMinScaleLabel(0) 69 69 , m_pMaxScaleLabel(0) 70 , m_iSliderRangeDivisor(10) 70 71 { 71 72 /* Prepare: */ … … 113 114 void UIFontScaleEditor::sltScaleSpinBoxValueChanged(int value) 114 115 { 115 setSliderValue( 0.1 * value);116 setSliderValue(value / m_iSliderRangeDivisor); 116 117 } 117 118 118 119 void UIFontScaleEditor::sltScaleSliderValueChanged(int value) 119 120 { 120 setSpinBoxValue( 10* value);121 setFontScaleFactor( 10* value);121 setSpinBoxValue(m_iSliderRangeDivisor * value); 122 setFontScaleFactor(m_iSliderRangeDivisor * value); 122 123 } 123 124 124 125 void UIFontScaleEditor::setFontScaleFactor(int iFontScaleFactor) 125 126 { 126 setSliderValue( 0.1 * iFontScaleFactor);127 setSliderValue(iFontScaleFactor / m_iSliderRangeDivisor); 127 128 setSpinBoxValue(iFontScaleFactor); 128 129 } … … 130 131 int UIFontScaleEditor::fontScaleFactor() const 131 132 { 132 return m_pScaleS lider->value();133 return m_pScaleSpinBox->value(); 133 134 } 134 135 … … 157 158 if (m_pLabel) 158 159 m_pLabel->setBuddy(m_pScaleSlider); 159 m_pScaleSlider->setPageStep(10);160 m_pScaleSlider->setSingleStep(1);161 m_pScaleSlider->setTickInterval(10);162 160 m_pScaleSlider->setSnappingEnabled(true); 163 161 connect(m_pScaleSlider, static_cast<void(QIAdvancedSlider::*)(int)>(&QIAdvancedSlider::valueChanged), … … 197 195 const int iMaximum = UIExtraDataDefs::iFontScaleMax; 198 196 199 /* Set slider to 1/10 of the rangeto make sure mouse drag stops only on ticks: */200 m_pScaleSlider->setMinimum( 0.1 * iMinimum);201 m_pScaleSlider->setMaximum( 0.1 * iMaximum);197 /* Set slider min, max, and intervals so to make sure mouse drag stops only on ticks: */ 198 m_pScaleSlider->setMinimum(iMinimum / m_iSliderRangeDivisor); 199 m_pScaleSlider->setMaximum(iMaximum / m_iSliderRangeDivisor); 202 200 203 201 m_pScaleSlider->setPageStep(2); -
trunk/src/VBox/Frontends/VirtualBox/src/settings/editors/UIFontScaleEditor.h
r97318 r97322 103 103 QLabel *m_pMaxScaleLabel; 104 104 /** @} */ 105 /** Hold the factor by which we divided spinbox's @a range to set slider's range to make slider mouse move stop on ticks. */ 106 const int m_iSliderRangeDivisor; 105 107 }; 106 108
Note:
See TracChangeset
for help on using the changeset viewer.