Changeset 60607 in vbox for trunk/src/VBox/Frontends/VirtualBox
- Timestamp:
- Apr 20, 2016 4:43:23 PM (9 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineViewNormal.cpp
r60362 r60607 81 81 } 82 82 83 /* For scroll-bars of the machine-view: */ 84 if ( pWatched == verticalScrollBar() 85 || pWatched == horizontalScrollBar()) 86 { 87 switch (pEvent->type()) 88 { 89 /* On show/hide event: */ 90 case QEvent::Show: 91 case QEvent::Hide: 92 { 93 /* Set maximum-size to size-hint: */ 94 setMaximumSize(sizeHint()); 95 break; 96 } 97 default: 98 break; 99 } 100 } 101 83 102 return UIMachineView::eventFilter(pWatched, pEvent); 84 103 } … … 91 110 /* Setup size-policy: */ 92 111 setSizePolicy(QSizePolicy(QSizePolicy::Maximum, QSizePolicy::Maximum)); 93 /* Maximum size to sizehint: */112 /* Set maximum-size to size-hint: */ 94 113 setMaximumSize(sizeHint()); 95 114 } … … 99 118 /* Base class filters: */ 100 119 UIMachineView::prepareFilters(); 120 121 /* Install scroll-bars event-filters: */ 122 verticalScrollBar()->installEventFilter(this); 123 horizontalScrollBar()->installEventFilter(this); 101 124 102 125 #ifdef VBOX_WS_WIN … … 208 231 sltPerformGuestResize(machineWindow()->centralWidget()->size()); 209 232 } 233 } 234 235 QSize UIMachineViewNormal::sizeHint() const 236 { 237 /* Call to base-class: */ 238 QSize size = UIMachineView::sizeHint(); 239 240 /* If guest-screen auto-resize is not enabled 241 * or the guest-additions doesn't support graphics 242 * we should take scroll-bars size-hints into account: */ 243 if (!m_bIsGuestAutoresizeEnabled || !uisession()->isGuestSupportsGraphics()) 244 { 245 if (verticalScrollBar()->isVisible()) 246 size += QSize(verticalScrollBar()->sizeHint().width(), 0); 247 if (horizontalScrollBar()->isVisible()) 248 size += QSize(0, horizontalScrollBar()->sizeHint().height()); 249 } 250 251 /* Return resulting size-hint finally: */ 252 return size; 210 253 } 211 254 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineViewNormal.h
r59380 r60607 68 68 69 69 /* Private helpers: */ 70 QSize sizeHint() const; 70 71 QRect workingArea() const; 71 72 QSize calculateMaxGuestSize() const;
Note:
See TracChangeset
for help on using the changeset viewer.