Changeset 101071 in vbox
- Timestamp:
- Sep 8, 2023 2:59:59 PM (15 months ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/settings/global
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsDisplay.cpp
r101053 r101071 54 54 && (m_guiMaximumGuestScreenSizeValue == other.m_guiMaximumGuestScreenSizeValue) 55 55 && (m_scaleFactors == other.m_scaleFactors) 56 && (m_iFontScalingFactor == other.m_iFontScalingFactor) 56 57 && (m_fActivateHoveredMachineWindow == other.m_fActivateHoveredMachineWindow) 57 58 && (m_fDisableHostScreenSaver == other.m_fDisableHostScreenSaver) 58 && (m_iFontScalingFactor == other.m_iFontScalingFactor)59 59 ; 60 60 } … … 69 69 /** Holds the guest screen scale-factor. */ 70 70 QList<double> m_scaleFactors; 71 /** Holds the font scaling factor. */ 72 int m_iFontScalingFactor; 71 73 /** Holds whether we should automatically activate machine window under the mouse cursor. */ 72 74 bool m_fActivateHoveredMachineWindow; 73 75 /** Holds whether we should disable host sceen saver on a vm is running. */ 74 76 bool m_fDisableHostScreenSaver; 75 /** Holds font scaling factor. */76 int m_iFontScalingFactor;77 77 }; 78 78 … … 86 86 , m_pEditorMaximumGuestScreenSize(0) 87 87 , m_pEditorScaleFactor(0) 88 , m_pFontScaleEditor(0) 88 89 , m_pEditorDisplayFeatures(0) 89 , m_pFontScaleEditor(0)90 90 { 91 91 prepare(); … … 119 119 gEDataManager->maxGuestResolutionForPolicyFixed()); 120 120 oldData.m_scaleFactors = gEDataManager->scaleFactors(UIExtraDataManager::GlobalID); 121 oldData.m_iFontScalingFactor = gEDataManager->fontScaleFactor(); 121 122 oldData.m_fActivateHoveredMachineWindow = gEDataManager->activateHoveredMachineWindow(); 122 123 #if defined(VBOX_WS_WIN) || defined(VBOX_WS_NIX) 123 124 oldData.m_fDisableHostScreenSaver = gEDataManager->disableHostScreenSaver(); 124 125 #endif 125 oldData.m_iFontScalingFactor = gEDataManager->fontScaleFactor();126 126 m_pCache->cacheInitialData(oldData); 127 127 … … 145 145 m_pEditorScaleFactor->setMonitorCount(UIDesktopWidgetWatchdog::screenCount()); 146 146 } 147 if (m_pFontScaleEditor) 148 m_pFontScaleEditor->setFontScaleFactor(oldData.m_iFontScalingFactor); 147 149 if (m_pEditorDisplayFeatures) 148 150 { … … 150 152 m_pEditorDisplayFeatures->setDisableHostScreenSaver(oldData.m_fDisableHostScreenSaver); 151 153 } 152 if (m_pFontScaleEditor)153 m_pFontScaleEditor->setFontScaleFactor(oldData.m_iFontScalingFactor);154 154 } 155 155 … … 168 168 if (m_pEditorScaleFactor) 169 169 newData.m_scaleFactors = m_pEditorScaleFactor->scaleFactors(); 170 if (m_pFontScaleEditor) 171 newData.m_iFontScalingFactor = m_pFontScaleEditor->fontScaleFactor(); 170 172 if (m_pEditorDisplayFeatures) 171 173 { … … 173 175 newData.m_fDisableHostScreenSaver = m_pEditorDisplayFeatures->disableHostScreenSaver(); 174 176 } 175 if (m_pFontScaleEditor)176 newData.m_iFontScalingFactor = m_pFontScaleEditor->fontScaleFactor();177 177 m_pCache->cacheCurrentData(newData); 178 178 } … … 196 196 iMinimumLayoutHint = qMax(iMinimumLayoutHint, m_pEditorMaximumGuestScreenSize->minimumLabelHorizontalHint()); 197 197 iMinimumLayoutHint = qMax(iMinimumLayoutHint, m_pEditorScaleFactor->minimumLabelHorizontalHint()); 198 iMinimumLayoutHint = qMax(iMinimumLayoutHint, m_pFontScaleEditor->minimumLabelHorizontalHint()); 198 199 iMinimumLayoutHint = qMax(iMinimumLayoutHint, m_pEditorDisplayFeatures->minimumLabelHorizontalHint()); 199 iMinimumLayoutHint = qMax(iMinimumLayoutHint, m_pFontScaleEditor->minimumLabelHorizontalHint());200 200 m_pEditorMaximumGuestScreenSize->setMinimumLayoutIndent(iMinimumLayoutHint); 201 201 m_pEditorScaleFactor->setMinimumLayoutIndent(iMinimumLayoutHint); 202 m_pFontScaleEditor->setMinimumLayoutIndent(iMinimumLayoutHint); 202 203 m_pEditorDisplayFeatures->setMinimumLayoutIndent(iMinimumLayoutHint); 203 m_pFontScaleEditor->setMinimumLayoutIndent(iMinimumLayoutHint);204 204 } 205 205 … … 239 239 } 240 240 241 /* Prepare 'font scale' editor: */ 242 m_pFontScaleEditor = new UIFontScaleEditor(this); 243 if (m_pFontScaleEditor) 244 { 245 m_editors << m_pFontScaleEditor; 246 pLayout->addWidget(m_pFontScaleEditor); 247 } 248 241 249 /* Prepare 'display features' editor: */ 242 250 m_pEditorDisplayFeatures = new UIDisplayFeaturesEditor(this); … … 247 255 } 248 256 249 /* Prepare 'font scale' editor: */250 m_pFontScaleEditor = new UIFontScaleEditor(this);251 if (m_pFontScaleEditor)252 {253 m_editors << m_pFontScaleEditor;254 pLayout->addWidget(m_pFontScaleEditor);255 }256 257 257 /* Add stretch to the end: */ 258 258 pLayout->addStretch(); … … 293 293 && newData.m_scaleFactors != oldData.m_scaleFactors) 294 294 /* fSuccess = */ gEDataManager->setScaleFactors(newData.m_scaleFactors, UIExtraDataManager::GlobalID); 295 /* Save font scale factor: */ 296 if ( fSuccess 297 && newData.m_iFontScalingFactor != oldData.m_iFontScalingFactor) 298 /* fSuccess = */ gEDataManager->setFontScaleFactor(newData.m_iFontScalingFactor); 295 299 /* Save whether hovered machine-window should be activated automatically: */ 296 300 if ( fSuccess … … 303 307 /* fSuccess = */ gEDataManager->setDisableHostScreenSaver(newData.m_fDisableHostScreenSaver); 304 308 #endif /* VBOX_WS_WIN || VBOX_WS_NIX */ 305 /* Save font scale factor: */306 if ( fSuccess307 && newData.m_iFontScalingFactor != oldData.m_iFontScalingFactor)308 /* fSuccess = */ gEDataManager->setFontScaleFactor(newData.m_iFontScalingFactor);309 309 } 310 310 /* Return result: */ -
trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsDisplay.h
r101053 r101071 98 98 /** Holds the 'scale-factor' editor instance. */ 99 99 UIScaleFactorEditor *m_pEditorScaleFactor; 100 /** Holds the 'font scale' editor instance. */ 101 UIFontScaleEditor *m_pFontScaleEditor; 100 102 /** Holds the 'display features' editor instance. */ 101 103 UIDisplayFeaturesEditor *m_pEditorDisplayFeatures; 102 /** Holds the 'font scale' editor instance. */103 UIFontScaleEditor *m_pFontScaleEditor;104 104 /** @} */ 105 105 };
Note:
See TracChangeset
for help on using the changeset viewer.