Changeset 76159 in vbox
- Timestamp:
- Dec 11, 2018 11:03:40 AM (6 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/widgets
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIScaleFactorEditor.cpp
r75372 r76159 30 30 /* GUI includes: */ 31 31 # include "QIAdvancedSlider.h" 32 # include "UIDesktopWidgetWatchdog.h" 32 33 # include "UIScaleFactorEditor.h" 34 35 /* External includes: */ 36 # include <math.h> 33 37 34 38 #endif /* !VBOX_WITH_PRECOMPILED_HEADERS */ … … 255 259 } 256 260 257 261 configureScaleFactorMinMaxValues(); 258 262 setLayout(m_pMainLayout); 259 263 retranslateUi(); … … 305 309 } 306 310 } 311 312 void UIScaleFactorEditor::configureScaleFactorMinMaxValues() 313 { 314 int iHostScreenCount = gpDesktop->screenCount(); 315 if (iHostScreenCount == 0) 316 return; 317 double dMaxDevicePixelRatio = gpDesktop->devicePixelRatio(0); 318 for (int i = 1; i < iHostScreenCount; ++i) 319 if (dMaxDevicePixelRatio < gpDesktop->devicePixelRatio(i)) 320 dMaxDevicePixelRatio = gpDesktop->devicePixelRatio(i); 321 322 const int iMinimum = 100; 323 const int iMaximum = ceil(iMinimum + 100 * dMaxDevicePixelRatio); 324 325 const int iStep = 25; 326 327 m_pScaleSlider->setMinimum(iMinimum); 328 m_pScaleSlider->setMaximum(iMaximum); 329 m_pScaleSlider->setPageStep(iStep); 330 m_pScaleSlider->setSingleStep(1); 331 m_pScaleSlider->setTickInterval(iStep); 332 m_pScaleSpinBox->setMinimum(iMinimum); 333 m_pScaleSpinBox->setMaximum(iMaximum); 334 } -
trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIScaleFactorEditor.h
r75372 r76159 87 87 /** Sets the spinbox and slider to scale factor of currently selected monitor. */ 88 88 void updateValuesAfterMonitorChange(); 89 89 /** Sets the min/max values of related widgets wrt. device pixel ratio(s) */ 90 void configureScaleFactorMinMaxValues(); 90 91 /** @name Member widgets. 91 92 * @{ */
Note:
See TracChangeset
for help on using the changeset viewer.