Changeset 43957 in vbox for trunk/src/VBox/Frontends/VirtualBox
- Timestamp:
- Nov 26, 2012 10:00:56 AM (12 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooser.cpp
r43885 r43957 135 135 { 136 136 /* Setup chooser-model connections: */ 137 connect(m_pChooserModel, SIGNAL(sigRootItemResized(const QSizeF&, int)), 138 m_pChooserView, SLOT(sltHandleRootItemResized(const QSizeF&, int))); 137 connect(m_pChooserModel, SIGNAL(sigRootItemResized(const QSizeF&)), 138 m_pChooserView, SLOT(sltHandleRootItemResized(const QSizeF&))); 139 connect(m_pChooserModel, SIGNAL(sigRootItemMinimumWidthHintChanged(int)), 140 m_pChooserView, SLOT(sltHandleRootItemMinimumWidthHintChanged(int))); 139 141 connect(m_pChooserModel, SIGNAL(sigFocusChanged(UIGChooserItem*)), 140 142 m_pChooserView, SLOT(sltFocusChanged(UIGChooserItem*))); -
trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserItem.cpp
r43955 r43957 39 39 , m_fTemporary(fTemporary) 40 40 , m_pParent(pParent) 41 , m_iPreviousMinimumWidthHint(0) 41 42 , m_dragTokenPlace(DragToken_Off) 42 43 , m_fHovered(false) … … 163 164 if (parentItem()) 164 165 parentItem()->updateGeometry(); 166 167 /* Special handling for root-items: */ 168 if (isRoot()) 169 { 170 /* Root-item should notify chooser-view if minimum-width-hint was changed: */ 171 int iMinimumWidthHint = minimumWidthHint(); 172 if (m_iPreviousMinimumWidthHint != iMinimumWidthHint) 173 { 174 /* Save new minimum-width-hint, notify listener: */ 175 m_iPreviousMinimumWidthHint = iMinimumWidthHint; 176 emit sigMinimumWidthHintChanged(m_iPreviousMinimumWidthHint); 177 } 178 } 165 179 } 166 180 -
trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserItem.h
r43885 r43957 67 67 68 68 signals: 69 70 /* Notifier: Layout stuff: */ 71 void sigMinimumWidthHintChanged(int iMinimumWidthHint); 69 72 70 73 /* Notifiers: Hover stuff: */ … … 189 192 UIGChooserItem *m_pParent; 190 193 QRectF m_previousGeometry; 194 int m_iPreviousMinimumWidthHint; 191 195 DragToken m_dragTokenPlace; 192 196 -
trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserItemGroup.cpp
r43955 r43957 53 53 /* Translate finally: */ 54 54 retranslateUi(); 55 56 /* Prepare connections: */ 57 connect(this, SIGNAL(sigMinimumWidthHintChanged(int)), 58 model(), SIGNAL(sigRootItemMinimumWidthHintChanged(int))); 55 59 56 60 /* Init: */ -
trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserModel.cpp
r43937 r43957 177 177 root()->show(); 178 178 /* Notify listener about root-item relayouted: */ 179 emit sigRootItemResized(root()->geometry().size() , root()->minimumWidthHint());179 emit sigRootItemResized(root()->geometry().size()); 180 180 } 181 181 -
trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserModel.h
r43937 r43957 74 74 75 75 /* Notifiers: Root-item stuff: */ 76 void sigRootItemResized(const QSizeF &size, int iMinimumWidth); 76 void sigRootItemResized(const QSizeF &size); 77 void sigRootItemMinimumWidthHintChanged(int iRootItemMinimumWidthHint); 77 78 void sigSlidingStarted(); 78 79 -
trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserView.cpp
r43885 r43957 39 39 } 40 40 41 void UIGChooserView::sltHandleRootItemResized(const QSizeF &size , int iMinimumWidth)41 void UIGChooserView::sltHandleRootItemResized(const QSizeF &size) 42 42 { 43 43 /* Update scene-rect: */ 44 44 updateSceneRect(size); 45 } 45 46 46 /* Set minimum width: */ 47 setMinimumWidth(2 * frameWidth() + iMinimumWidth + 48 verticalScrollBar()->sizeHint().width()); 47 void UIGChooserView::sltHandleRootItemMinimumWidthHintChanged(int iRootItemMinimumWidthHint) 48 { 49 /* Set minimum view width according to root-item minimum-width-hint: */ 50 setMinimumWidth(2 * frameWidth() + iRootItemMinimumWidthHint + verticalScrollBar()->sizeHint().width()); 49 51 } 50 52 -
trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserView.h
r43936 r43957 43 43 private slots: 44 44 45 /* Handler: Root-item stuff: */ 46 void sltHandleRootItemResized(const QSizeF &size, int iMinimumWidth); 45 /* Handlers: Root-item stuff: */ 46 void sltHandleRootItemResized(const QSizeF &size); 47 void sltHandleRootItemMinimumWidthHintChanged(int iRootItemMinimumWidthHint); 47 48 48 49 /* Handler: Focus-item stuff: */
Note:
See TracChangeset
for help on using the changeset viewer.