Changeset 62225 in vbox
- Timestamp:
- Jul 13, 2016 4:41:24 PM (9 years ago)
- svn:sync-xref-src-repo-rev:
- 108736
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineWindowNormal.cpp
r62206 r62225 513 513 } 514 514 515 /**516 * Adjusts machine-window size to correspond current guest screen size.517 * @param fAdjustPosition determines whether is it necessary to adjust position too.518 */519 515 void UIMachineWindowNormal::normalizeGeometry(bool fAdjustPosition) 520 516 { … … 525 521 526 522 /* Calculate client window offsets: */ 527 QRect fr ameGeo = frameGeometry();523 QRect frGeo = frameGeometry(); 528 524 const QRect geo = geometry(); 529 int dl = geo.left() - frameGeo.left();530 int dt = geo.top() - frameGeo.top();531 int dr = frameGeo.right() - geo.right();532 int db = frameGeo.bottom() - geo.bottom();525 const int dl = geo.left() - frGeo.left(); 526 const int dt = geo.top() - frGeo.top(); 527 const int dr = frGeo.right() - geo.right(); 528 const int db = frGeo.bottom() - geo.bottom(); 533 529 534 530 /* Get the best size w/o scroll-bars: */ 535 QSize s = sizeHint();531 QSize sh = sizeHint(); 536 532 537 533 /* If guest-screen auto-resize is not enabled … … 541 537 { 542 538 if (machineView()->verticalScrollBar()->isVisible()) 543 s -= QSize(machineView()->verticalScrollBar()->sizeHint().width(), 0);539 sh -= QSize(machineView()->verticalScrollBar()->sizeHint().width(), 0); 544 540 if (machineView()->horizontalScrollBar()->isVisible()) 545 s -= QSize(0, machineView()->horizontalScrollBar()->sizeHint().height());541 sh -= QSize(0, machineView()->horizontalScrollBar()->sizeHint().height()); 546 542 } 547 543 548 544 /* Resize the frame to fit the contents: */ 549 s -= size();550 fr ameGeo.setRight(frameGeo.right() + s.width());551 fr ameGeo.setBottom(frameGeo.bottom() + s.height());545 sh -= size(); 546 frGeo.setRight(frGeo.right() + sh.width()); 547 frGeo.setBottom(frGeo.bottom() + sh.height()); 552 548 553 549 /* Adjust position if necessary: */ 554 550 if (fAdjustPosition) 555 fr ameGeo = VBoxGlobal::normalizeGeometry(frameGeo, vboxGlobal().availableGeometry(pos()));551 frGeo = VBoxGlobal::normalizeGeometry(frGeo, vboxGlobal().availableGeometry(pos())); 556 552 557 553 /* Finally, set the frame geometry: */ 558 setGeometry(fr ameGeo.left() + dl, frameGeo.top() + dt,559 fr ameGeo.width() - dl - dr, frameGeo.height() - dt - db);554 setGeometry(frGeo.left() + dl, frGeo.top() + dt, 555 frGeo.width() - dl - dr, frGeo.height() - dt - db); 560 556 #else /* VBOX_GUI_WITH_CUSTOMIZATIONS1 */ 561 557 /* Customer request: There should no be -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineWindowNormal.h
r62206 r62225 113 113 void showInNecessaryMode(); 114 114 115 /** Normalizes geometry according to guest-size. */ 115 /** Performs window geometry normalization according to guest-size and host's available geometry. 116 * @param fAdjustPosition Determines whether is it necessary to adjust position as well. */ 116 117 void normalizeGeometry(bool fAdjustPosition); 117 118
Note:
See TracChangeset
for help on using the changeset viewer.