Changeset 74872 in vbox
- Timestamp:
- Oct 16, 2018 5:26:25 PM (6 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataManager.cpp
r74871 r74872 3986 3986 } 3987 3987 3988 double UIExtraDataManager::scaleFactor(const QString &strID, const int uScreenIndex) 3989 { 3990 /* Get corresponding extra-data: */ 3991 const QStringList data = extraDataStringList(GUI_ScaleFactor, strID); 3988 double UIExtraDataManager::scaleFactor(const int uScreenIndex, const QString &strID /* = GlobalID */) 3989 { 3990 /* Get corresponding extra-data for this machine: */ 3991 QStringList data = extraDataStringList(GUI_ScaleFactor, strID); 3992 3993 /* If that fails check the global scale factor: */ 3994 if (data.size() == 0) 3995 data = extraDataStringList(GUI_ScaleFactor, GlobalID); 3992 3996 3993 3997 /* 1.0 is default scale factor: */ … … 4007 4011 } 4008 4012 4009 QList<double> UIExtraDataManager::scaleFactors(const QString &strID) 4010 { 4013 QList<double> UIExtraDataManager::scaleFactors(const QString &strID /* = GlobalID */) 4014 { 4015 /* Look for the scale factor for this machine first: */ 4016 QStringList data = extraDataStringList(GUI_ScaleFactor, strID); 4017 4018 /* then looks for the global scale factors: */ 4019 if (data.size() == 0) 4020 data = extraDataStringList(GUI_ScaleFactor, GlobalID); 4021 4011 4022 QList<double> scaleFactorList; 4012 const QStringList data = extraDataStringList(GUI_ScaleFactor, strID); 4023 /* 1.0 is default scale factor: */ 4024 if (data.size() == 0) 4025 { 4026 scaleFactorList.append(1.0); 4027 return scaleFactorList; 4028 } 4029 4013 4030 bool fOk = false; 4014 4031 double scaleFactor; … … 4023 4040 } 4024 4041 4025 void UIExtraDataManager::setScaleFactor(double dScaleFactor, const QString &strID, const int uScreenIndex)4042 void UIExtraDataManager::setScaleFactor(double dScaleFactor, const int uScreenIndex, const QString &strID /* = GlobalID */) 4026 4043 { 4027 4044 QStringList data = extraDataStringList(GUI_ScaleFactor, strID); … … 4040 4057 } 4041 4058 4042 void UIExtraDataManager::setScaleFactors(const QList<double> &scaleFactors, const QString &strID )4059 void UIExtraDataManager::setScaleFactors(const QList<double> &scaleFactors, const QString &strID /* = GlobalID */) 4043 4060 { 4044 4061 QStringList data; -
trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataManager.h
r74871 r74872 605 605 606 606 /** Returns the scale-factor. */ 607 double scaleFactor(const QString &strID, const int uScreenIndex);608 QList<double> scaleFactors(const QString &strID );607 double scaleFactor(const int uScreenIndex, const QString &strID = GlobalID); 608 QList<double> scaleFactors(const QString &strID = GlobalID); 609 609 /** Defines the @a dScaleFactor. */ 610 void setScaleFactor(double dScaleFactor, const QString &strID, const int uScreenIndex);611 void setScaleFactors(const QList<double> &scaleFactors, const QString &strID );610 void setScaleFactor(double dScaleFactor, const int uScreenIndex, const QString &strID = GlobalID); 611 void setScaleFactors(const QList<double> &scaleFactors, const QString &strID = GlobalID); 612 612 613 613 /** Returns the scaling optimization type. */ -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIActionPoolRuntime.cpp
r74722 r74872 3157 3157 /* Change scale-factor directly: */ 3158 3158 const double dScaleFactor = pAction->property("Requested Scale Factor").toDouble(); 3159 gEDataManager->setScaleFactor(dScaleFactor, vboxGlobal().managedVMUuid(), 0);3159 gEDataManager->setScaleFactor(dScaleFactor, 0, vboxGlobal().managedVMUuid()); 3160 3160 } 3161 3161 … … 3783 3783 3784 3784 /* Get current scale-factor: */ 3785 const double dCurrentScaleFactor = gEDataManager->scaleFactor( vboxGlobal().managedVMUuid(), 0);3785 const double dCurrentScaleFactor = gEDataManager->scaleFactor(0, vboxGlobal().managedVMUuid()); 3786 3786 3787 3787 /* Get device-pixel-ratio: */ -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.cpp
r74722 r74872 248 248 { 249 249 /* Acquire selected scale-factor: */ 250 double dScaleFactor = gEDataManager->scaleFactor( vboxGlobal().managedVMUuid(), m_uScreenId);250 double dScaleFactor = gEDataManager->scaleFactor(m_uScreenId, vboxGlobal().managedVMUuid()); 251 251 252 252 /* Take the device-pixel-ratio into account: */ … … 508 508 509 509 /* Acquire selected scale-factor: */ 510 double dScaleFactor = gEDataManager->scaleFactor( vboxGlobal().managedVMUuid(), m_uScreenId);510 double dScaleFactor = gEDataManager->scaleFactor(m_uScreenId, vboxGlobal().managedVMUuid()); 511 511 512 512 /* Take the device-pixel-ratio into account: */ … … 702 702 703 703 /* Acquire selected scale-factor: */ 704 double dScaleFactor = gEDataManager->scaleFactor( vboxGlobal().managedVMUuid(), m_uScreenId);704 double dScaleFactor = gEDataManager->scaleFactor(m_uScreenId, vboxGlobal().managedVMUuid()); 705 705 706 706 /* Take the device-pixel-ratio into account: */ -
trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsDisplay.cpp
r71027 r74872 21 21 22 22 /* GUI includes: */ 23 # include "UIDesktopWidgetWatchdog.h" 23 24 # include "UIExtraDataManager.h" 24 25 # include "UIGlobalSettingsDisplay.h" … … 45 46 && (m_maxGuestResolution == other.m_maxGuestResolution) 46 47 && (m_fActivateHoveredMachineWindow == other.m_fActivateHoveredMachineWindow) 48 && (m_scaleFactors == other.m_scaleFactors) 47 49 ; 48 50 } … … 59 61 /** Holds whether we should automatically activate machine window under the mouse cursor. */ 60 62 bool m_fActivateHoveredMachineWindow; 63 /** Holds the guest screen scale-factor. */ 64 QList<double> m_scaleFactors; 61 65 }; 62 66 … … 91 95 oldDisplayData.m_maxGuestResolution = gEDataManager->maxGuestResolutionForPolicyFixed(); 92 96 oldDisplayData.m_fActivateHoveredMachineWindow = gEDataManager->activateHoveredMachineWindow(); 97 oldDisplayData.m_scaleFactors = gEDataManager->scaleFactors(); 93 98 94 99 /* Cache old display data: */ … … 112 117 } 113 118 m_pCheckBoxActivateOnMouseHover->setChecked(oldDisplayData.m_fActivateHoveredMachineWindow); 119 m_pScaleFactorEditor->setScaleFactors(oldDisplayData.m_scaleFactors); 120 m_pScaleFactorEditor->setMonitorCount(gpDesktop->screenCount()); 114 121 } 115 122 … … 124 131 newDisplayData.m_maxGuestResolution = QSize(m_pResolutionWidthSpin->value(), m_pResolutionHeightSpin->value()); 125 132 newDisplayData.m_fActivateHoveredMachineWindow = m_pCheckBoxActivateOnMouseHover->isChecked(); 133 newDisplayData.m_scaleFactors = m_pScaleFactorEditor->scaleFactors(); 126 134 127 135 /* Cache new display data: */ … … 258 266 if (fSuccess && newDisplayData.m_fActivateHoveredMachineWindow != oldDisplayData.m_fActivateHoveredMachineWindow) 259 267 gEDataManager->setActivateHoveredMachineWindow(newDisplayData.m_fActivateHoveredMachineWindow); 268 /* Save guest-screen scale-factor: */ 269 if (fSuccess && newDisplayData.m_scaleFactors != oldDisplayData.m_scaleFactors) 270 gEDataManager->setScaleFactors(newDisplayData.m_scaleFactors); 260 271 } 261 272 /* Return result: */ 262 273 return fSuccess; 263 274 } 264 -
trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsDisplay.ui
r71027 r74872 120 120 </widget> 121 121 </item> 122 <item row="4" column="0" colspan="2"> 122 <item row="4" column="0"> 123 <widget class="QLabel" name="m_pLabelGuestScreenScaleFactorEditor"> 124 <property name="text"> 125 <string>Scale Factor:</string> 126 </property> 127 <property name="alignment"> 128 <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> 129 </property> 130 </widget> 131 </item> 132 <item row="4" column="1" rowspan="2" colspan="2"> 133 <layout class="QGridLayout" name="m_pLayoutGuestScreenScaleFactorEditor"> 134 <property name="spacing"> 135 <number>0</number> 136 </property> 137 <item row="0" column="0" rowspan="2" colspan="3"> 138 <widget class="UIScaleFactorEditor" name="m_pScaleFactorEditor"> 139 <property name="sizePolicy"> 140 <sizepolicy hsizetype="Expanding" > 141 <horstretch>0</horstretch> 142 <verstretch>0</verstretch> 143 </sizepolicy> 144 </property> 145 <property name="whatsThis"> 146 <string>Controls the guest screen scale factor.</string> 147 </property> 148 </widget> 149 </item> 150 </layout> 151 </item> 152 <item row="6" column="0" colspan="2"> 123 153 <spacer> 124 154 <property name="orientation"> … … 135 165 </layout> 136 166 </widget> 167 <customwidgets> 168 <customwidget> 169 <class>UIScaleFactorEditor</class> 170 <extends>QWidget</extends> 171 <header>UIScaleFactorEditor.h</header> 172 </customwidget> 173 </customwidgets> 137 174 <resources/> 138 175 <connections/> -
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsDisplay.ui
r74722 r74872 156 156 </widget> 157 157 </item> 158 <item row="4" column="1" rowspan=" 1" colspan="2">158 <item row="4" column="1" rowspan="2" colspan="2"> 159 159 <layout class="QGridLayout" name="m_pLayoutGuestScreenScaleFactorEditor"> 160 160 <property name="spacing">
Note:
See TracChangeset
for help on using the changeset viewer.