- Timestamp:
- Jan 6, 2025 3:57:35 PM (13 days ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataManager.cpp
r107148 r107420 4180 4180 } 4181 4181 4182 double UIExtraDataManager::scaleFactor(const QUuid &uID, const int uScreenIndex)4182 double UIExtraDataManager::scaleFactor(const QUuid &uID, int iScreenIndex) 4183 4183 { 4184 4184 /* Get corresponding extra-data for this machine: */ … … 4189 4189 return 1.0; 4190 4190 4191 int i ndex = uScreenIndex;4192 /* use the 0th. scale factor in case we dont have a scale factor for @p uScreenIndex: */4193 if (data.size() <= uScreenIndex)4194 i ndex = 0;4191 int iIndex = iScreenIndex; 4192 /* use the 0th. scale factor in case we dont have a scale factor for @p iScreenIndex: */ 4193 if (data.size() <= iScreenIndex) 4194 iIndex = 0; 4195 4195 4196 4196 bool fOk = false; 4197 double scaleFactor = data[index].toDouble(&fOk);4197 const double dScaleFactor = data.at(iIndex).toDouble(&fOk); 4198 4198 if (!fOk) 4199 4199 return 1.0; 4200 return scaleFactor;4200 return dScaleFactor; 4201 4201 } 4202 4202 … … 4226 4226 } 4227 4227 4228 void UIExtraDataManager::setScaleFactor(double dScaleFactor, const QUuid &uID, const int uScreenIndex)4228 void UIExtraDataManager::setScaleFactor(double dScaleFactor, const QUuid &uID, int iScreenIndex) 4229 4229 { 4230 4230 QStringList data = extraDataStringList(GUI_ScaleFactor, uID); 4231 4231 4232 4232 /* Just make sure that we have corresponding data item: */ 4233 if (data.size() <= uScreenIndex) 4234 { 4235 int listSize = data.size(); 4236 for (int i = listSize; i <= uScreenIndex; ++i) 4233 if (data.size() <= iScreenIndex) 4234 { 4235 for (int i = data.size(); i <= iScreenIndex; ++i) 4237 4236 data.append(QString::number(1.0)); 4238 4237 } 4239 4238 4240 data[ uScreenIndex] = QString::number(dScaleFactor);4239 data[iScreenIndex] = QString::number(dScaleFactor); 4241 4240 setExtraDataStringList(GUI_ScaleFactor, data, uID); 4242 4241 } -
trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataManager.h
r107148 r107420 713 713 714 714 /** Returns the scale-factor. */ 715 double scaleFactor(const QUuid &uID, const int uScreenIndex);715 double scaleFactor(const QUuid &uID, int iScreenIndex); 716 716 QList<double> scaleFactors(const QUuid &uID); 717 717 /** Saves the @a dScaleFactor for the monitor with @a uScreenIndex. If the existing scale factor 718 718 * list (from extra data) does not have scale factors for the screens with ids in [0, uScreenIndex) 719 719 * the this function appends a default scale factor for said screens.*/ 720 void setScaleFactor(double dScaleFactor, const QUuid &uID, const int uScreenIndex);720 void setScaleFactor(double dScaleFactor, const QUuid &uID, int iScreenIndex); 721 721 /** Replaces the scale factor list of the machine with @a uID with @a scaleFactors. */ 722 722 void setScaleFactors(const QList<double> &scaleFactors, const QUuid &uID); -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.cpp
r107411 r107420 298 298 299 299 /* Acquire selected scale-factor: */ 300 double dScaleFactor = gEDataManager->scaleFactor(uiCommon().managedVMUuid(), m_uScreenId);300 double dScaleFactor = gEDataManager->scaleFactor(uiCommon().managedVMUuid(), (int)m_uScreenId); 301 301 302 302 /* Take the device-pixel-ratio into account: */ … … 1061 1061 1062 1062 /* Acquire selected scale-factor: */ 1063 double dScaleFactor = gEDataManager->scaleFactor(uiCommon().managedVMUuid(), m_uScreenId);1063 double dScaleFactor = gEDataManager->scaleFactor(uiCommon().managedVMUuid(), (int)m_uScreenId); 1064 1064 1065 1065 /* Take the device-pixel-ratio into account: */
Note:
See TracChangeset
for help on using the changeset viewer.