Changeset 57021 in vbox for trunk/src/VBox
- Timestamp:
- Jul 20, 2015 2:06:23 PM (9 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/Makefile.kmk
r56817 r57021 513 513 src/settings/machine/UIMachineSettingsUSB.cpp \ 514 514 src/widgets/UIHotKeyEditor.cpp \ 515 src/widgets/UIMiniToolBar.cpp \ 515 516 src/widgets/UIPortForwardingTable.cpp \ 516 517 src/wizards/importappliance/UIWizardImportApp.cpp -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineWindowFullscreen.cpp
r57019 r57021 243 243 244 244 /* Create mini-toolbar: */ 245 m_pMiniToolBar = new UI RuntimeMiniToolBar(this,246 247 248 245 m_pMiniToolBar = new UIMiniToolBar(this, 246 GeometryType_Full, 247 gEDataManager->miniToolbarAlignment(vboxGlobal().managedVMUuid()), 248 gEDataManager->autoHideMiniToolbar(vboxGlobal().managedVMUuid())); 249 249 AssertPtrReturnVoid(m_pMiniToolBar); 250 250 { -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineWindowFullscreen.h
r57019 r57021 24 24 #if defined(Q_WS_WIN) || defined(Q_WS_X11) 25 25 /* Forward declarations: */ 26 class UI RuntimeMiniToolBar;26 class UIMiniToolBar; 27 27 #endif /* Q_WS_WIN || Q_WS_X11 */ 28 28 … … 103 103 #if defined(Q_WS_WIN) || defined(Q_WS_X11) 104 104 /** Holds the mini-toolbar instance. */ 105 UI RuntimeMiniToolBar *m_pMiniToolBar;105 UIMiniToolBar *m_pMiniToolBar; 106 106 #endif /* Q_WS_WIN || Q_WS_X11 */ 107 107 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIMachineWindowSeamless.cpp
r57019 r57021 125 125 126 126 /* Create mini-toolbar: */ 127 m_pMiniToolBar = new UI RuntimeMiniToolBar(this,128 129 130 127 m_pMiniToolBar = new UIMiniToolBar(this, 128 GeometryType_Available, 129 gEDataManager->miniToolbarAlignment(vboxGlobal().managedVMUuid()), 130 gEDataManager->autoHideMiniToolbar(vboxGlobal().managedVMUuid())); 131 131 AssertPtrReturnVoid(m_pMiniToolBar); 132 132 { -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIMachineWindowSeamless.h
r57019 r57021 24 24 #if defined(Q_WS_WIN) || defined(Q_WS_X11) 25 25 /* Forward declarations: */ 26 class UI RuntimeMiniToolBar;26 class UIMiniToolBar; 27 27 #endif /* Q_WS_WIN || Q_WS_X11 */ 28 28 … … 85 85 #if defined(Q_WS_WIN) || defined(Q_WS_X11) 86 86 /** Holds the mini-toolbar instance. */ 87 UI RuntimeMiniToolBar *m_pMiniToolBar;87 UIMiniToolBar *m_pMiniToolBar; 88 88 #endif /* Q_WS_WIN || Q_WS_X11 */ 89 89 -
trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIMiniToolBar.cpp
r57019 r57021 43 43 #endif /* !VBOX_WITH_PRECOMPILED_HEADERS */ 44 44 45 46 UIRuntimeMiniToolBar::UIRuntimeMiniToolBar(QWidget *pParent, 47 GeometryType geometryType, 48 Qt::Alignment alignment, 49 bool fAutoHide /* = true */) 45 /* Mini-toolbar widget prototype: */ 46 class UIMiniToolBarPrivate : public UIToolBar 47 { 48 Q_OBJECT; 49 50 signals: 51 52 /* Notifier: Resize stuff: */ 53 void sigResized(); 54 55 /* Notifiers: Action stuff: */ 56 void sigAutoHideToggled(); 57 void sigMinimizeAction(); 58 void sigExitAction(); 59 void sigCloseAction(); 60 61 public: 62 63 /* Constructor: */ 64 UIMiniToolBarPrivate(); 65 66 /* API: Alignment stuff: */ 67 void setAlignment(Qt::Alignment alignment); 68 69 /* API: Auto-hide stuff: */ 70 bool autoHide() const; 71 void setAutoHide(bool fAutoHide); 72 73 /* API: Text stuff: */ 74 void setText(const QString &strText); 75 76 /* API: Menu aggregator: */ 77 void addMenus(const QList<QMenu*> &menus); 78 79 protected: 80 81 /* Handlers: Event-processing stuff: */ 82 virtual void showEvent(QShowEvent *pEvent); 83 virtual void polishEvent(QShowEvent *pEvent); 84 virtual void resizeEvent(QResizeEvent *pEvent); 85 virtual void paintEvent(QPaintEvent *pEvent); 86 87 private: 88 89 /* Helper: Prepare stuff: */ 90 void prepare(); 91 92 /* Helper: Shape stuff: */ 93 void rebuildShape(); 94 95 /* Variables: General stuff: */ 96 bool m_fPolished; 97 Qt::Alignment m_alignment; 98 QPainterPath m_shape; 99 100 /* Variables: Contents stuff: */ 101 QAction *m_pAutoHideAction; 102 QLabel *m_pLabel; 103 QAction *m_pMinimizeAction; 104 QAction *m_pRestoreAction; 105 QAction *m_pCloseAction; 106 107 /* Variables: Menu stuff: */ 108 QAction *m_pMenuInsertPosition; 109 110 /* Variables: Spacers stuff: */ 111 QList<QWidget*> m_spacings; 112 QList<QWidget*> m_margins; 113 }; 114 115 UIMiniToolBar::UIMiniToolBar(QWidget *pParent, 116 GeometryType geometryType, 117 Qt::Alignment alignment, 118 bool fAutoHide /* = true */) 50 119 : QWidget(pParent, Qt::Tool | Qt::FramelessWindowHint) 51 120 /* Variables: General stuff: */ … … 67 136 } 68 137 69 UI RuntimeMiniToolBar::~UIRuntimeMiniToolBar()138 UIMiniToolBar::~UIMiniToolBar() 70 139 { 71 140 /* Cleanup: */ … … 73 142 } 74 143 75 void UI RuntimeMiniToolBar::setAlignment(Qt::Alignment alignment)144 void UIMiniToolBar::setAlignment(Qt::Alignment alignment) 76 145 { 77 146 /* Make sure toolbar created: */ … … 92 161 } 93 162 94 void UI RuntimeMiniToolBar::setAutoHide(bool fAutoHide, bool fPropagateToChild /* = true */)163 void UIMiniToolBar::setAutoHide(bool fAutoHide, bool fPropagateToChild /* = true */) 95 164 { 96 165 /* Make sure toolbar created: */ … … 112 181 } 113 182 114 void UI RuntimeMiniToolBar::setText(const QString &strText)183 void UIMiniToolBar::setText(const QString &strText) 115 184 { 116 185 /* Make sure toolbar created: */ … … 121 190 } 122 191 123 void UI RuntimeMiniToolBar::addMenus(const QList<QMenu*> &menus)192 void UIMiniToolBar::addMenus(const QList<QMenu*> &menus) 124 193 { 125 194 /* Make sure toolbar created: */ … … 130 199 } 131 200 132 void UI RuntimeMiniToolBar::adjustGeometry(int iHostScreen /* = -1 */)201 void UIMiniToolBar::adjustGeometry(int iHostScreen /* = -1 */) 133 202 { 134 203 #ifndef Q_WS_X11 … … 253 322 } 254 323 255 void UI RuntimeMiniToolBar::sltHandleToolbarResize()324 void UIMiniToolBar::sltHandleToolbarResize() 256 325 { 257 326 /* Re-initialize: */ … … 259 328 } 260 329 261 void UI RuntimeMiniToolBar::sltAutoHideToggled()330 void UIMiniToolBar::sltAutoHideToggled() 262 331 { 263 332 /* Propagate from child: */ … … 265 334 } 266 335 267 void UI RuntimeMiniToolBar::sltHoverEnter()336 void UIMiniToolBar::sltHoverEnter() 268 337 { 269 338 /* Mark as 'hovered' if necessary: */ … … 275 344 } 276 345 277 void UI RuntimeMiniToolBar::sltHoverLeave()346 void UIMiniToolBar::sltHoverLeave() 278 347 { 279 348 /* Mark as 'unhovered' if necessary: */ … … 285 354 } 286 355 287 void UI RuntimeMiniToolBar::prepare()356 void UIMiniToolBar::prepare() 288 357 { 289 358 #if defined (Q_WS_X11) … … 331 400 332 401 /* Prepare mini-toolbar: */ 333 m_pToolbar = new UIMiniToolBar ;402 m_pToolbar = new UIMiniToolBarPrivate; 334 403 { 335 404 /* Make sure we have no focus: */ … … 383 452 } 384 453 385 void UI RuntimeMiniToolBar::cleanup()454 void UIMiniToolBar::cleanup() 386 455 { 387 456 /* Stop hover-enter/leave timers: */ … … 400 469 } 401 470 402 void UI RuntimeMiniToolBar::enterEvent(QEvent*)471 void UIMiniToolBar::enterEvent(QEvent*) 403 472 { 404 473 /* Stop the hover-leave timer if necessary: */ … … 411 480 } 412 481 413 void UI RuntimeMiniToolBar::leaveEvent(QEvent*)482 void UIMiniToolBar::leaveEvent(QEvent*) 414 483 { 415 484 /* Stop the hover-enter timer if necessary: */ … … 423 492 424 493 #ifdef Q_WS_X11 425 void UI RuntimeMiniToolBar::resizeEvent(QResizeEvent*)494 void UIMiniToolBar::resizeEvent(QResizeEvent*) 426 495 { 427 496 /* Adjust mini-toolbar on resize: */ … … 430 499 #endif /* Q_WS_X11 */ 431 500 432 bool UI RuntimeMiniToolBar::eventFilter(QObject *pWatched, QEvent *pEvent)501 bool UIMiniToolBar::eventFilter(QObject *pWatched, QEvent *pEvent) 433 502 { 434 503 #if defined(Q_WS_WIN) … … 451 520 } 452 521 453 void UI RuntimeMiniToolBar::simulateToolbarAutoHiding()522 void UIMiniToolBar::simulateToolbarAutoHiding() 454 523 { 455 524 /* This simulation helps user to notice … … 465 534 } 466 535 467 void UI RuntimeMiniToolBar::setToolbarPosition(QPoint point)536 void UIMiniToolBar::setToolbarPosition(QPoint point) 468 537 { 469 538 /* Update position: */ … … 472 541 } 473 542 474 QPoint UI RuntimeMiniToolBar::toolbarPosition() const543 QPoint UIMiniToolBar::toolbarPosition() const 475 544 { 476 545 /* Return position: */ … … 480 549 481 550 482 UIMiniToolBar ::UIMiniToolBar()551 UIMiniToolBarPrivate::UIMiniToolBarPrivate() 483 552 /* Variables: General stuff: */ 484 553 : m_fPolished(false) … … 497 566 } 498 567 499 void UIMiniToolBar ::setAlignment(Qt::Alignment alignment)568 void UIMiniToolBarPrivate::setAlignment(Qt::Alignment alignment) 500 569 { 501 570 /* Make sure alignment really changed: */ … … 510 579 } 511 580 512 bool UIMiniToolBar ::autoHide() const581 bool UIMiniToolBarPrivate::autoHide() const 513 582 { 514 583 /* Return auto-hide: */ … … 516 585 } 517 586 518 void UIMiniToolBar ::setAutoHide(bool fAutoHide)587 void UIMiniToolBarPrivate::setAutoHide(bool fAutoHide) 519 588 { 520 589 /* Make sure auto-hide really changed: */ … … 526 595 } 527 596 528 void UIMiniToolBar ::setText(const QString &strText)597 void UIMiniToolBarPrivate::setText(const QString &strText) 529 598 { 530 599 /* Make sure text really changed: */ … … 539 608 } 540 609 541 void UIMiniToolBar ::addMenus(const QList<QMenu*> &menus)610 void UIMiniToolBarPrivate::addMenus(const QList<QMenu*> &menus) 542 611 { 543 612 /* For each of the passed menu items: */ … … 563 632 } 564 633 565 void UIMiniToolBar ::showEvent(QShowEvent *pEvent)634 void UIMiniToolBarPrivate::showEvent(QShowEvent *pEvent) 566 635 { 567 636 /* Make sure we should polish dialog: */ … … 576 645 } 577 646 578 void UIMiniToolBar ::polishEvent(QShowEvent*)647 void UIMiniToolBarPrivate::polishEvent(QShowEvent*) 579 648 { 580 649 /* Toolbar spacings: */ … … 590 659 } 591 660 592 void UIMiniToolBar ::resizeEvent(QResizeEvent*)661 void UIMiniToolBarPrivate::resizeEvent(QResizeEvent*) 593 662 { 594 663 /* Rebuild shape: */ … … 599 668 } 600 669 601 void UIMiniToolBar ::paintEvent(QPaintEvent*)670 void UIMiniToolBarPrivate::paintEvent(QPaintEvent*) 602 671 { 603 672 /* Prepare painter: */ … … 618 687 } 619 688 620 void UIMiniToolBar ::prepare()689 void UIMiniToolBarPrivate::prepare() 621 690 { 622 691 /* Determine icon metric: */ … … 694 763 } 695 764 696 void UIMiniToolBar ::rebuildShape()765 void UIMiniToolBarPrivate::rebuildShape() 697 766 { 698 767 #ifdef Q_WS_X11 … … 736 805 } 737 806 807 #include "UIMiniToolBar.moc" 808 -
trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIMiniToolBar.h
r57019 r57021 33 33 class QMdiSubWindow; 34 34 class UIAnimation; 35 class UIMiniToolBarPrivate; 35 36 36 37 /** Geometry types. */ … … 42 43 43 44 /* Runtime mini-toolbar frameless-window prototype: */ 44 class UI RuntimeMiniToolBar : public QWidget45 class UIMiniToolBar : public QWidget 45 46 { 46 47 Q_OBJECT; … … 66 67 67 68 /* Constructor/destructor: */ 68 UI RuntimeMiniToolBar(QWidget *pParent,69 70 71 72 ~UI RuntimeMiniToolBar();69 UIMiniToolBar(QWidget *pParent, 70 GeometryType geometryType, 71 Qt::Alignment alignment, 72 bool fAutoHide = true); 73 ~UIMiniToolBar(); 73 74 74 75 /* API: Alignment stuff: */ … … 131 132 /* Variables: Contents stuff: */ 132 133 QMdiArea *m_pMdiArea; 133 UIMiniToolBar *m_pToolbar;134 UIMiniToolBarPrivate *m_pToolbar; 134 135 QMdiSubWindow *m_pEmbeddedToolbar; 135 136 … … 143 144 }; 144 145 145 /* Mini-toolbar widget prototype: */146 class UIMiniToolBar : public UIToolBar147 {148 Q_OBJECT;149 150 signals:151 152 /* Notifier: Resize stuff: */153 void sigResized();154 155 /* Notifiers: Action stuff: */156 void sigAutoHideToggled();157 void sigMinimizeAction();158 void sigExitAction();159 void sigCloseAction();160 161 public:162 163 /* Constructor: */164 UIMiniToolBar();165 166 /* API: Alignment stuff: */167 void setAlignment(Qt::Alignment alignment);168 169 /* API: Auto-hide stuff: */170 bool autoHide() const;171 void setAutoHide(bool fAutoHide);172 173 /* API: Text stuff: */174 void setText(const QString &strText);175 176 /* API: Menu aggregator: */177 void addMenus(const QList<QMenu*> &menus);178 179 protected:180 181 /* Handlers: Event-processing stuff: */182 virtual void showEvent(QShowEvent *pEvent);183 virtual void polishEvent(QShowEvent *pEvent);184 virtual void resizeEvent(QResizeEvent *pEvent);185 virtual void paintEvent(QPaintEvent *pEvent);186 187 private:188 189 /* Helper: Prepare stuff: */190 void prepare();191 192 /* Helper: Shape stuff: */193 void rebuildShape();194 195 /* Variables: General stuff: */196 bool m_fPolished;197 Qt::Alignment m_alignment;198 QPainterPath m_shape;199 200 /* Variables: Contents stuff: */201 QAction *m_pAutoHideAction;202 QLabel *m_pLabel;203 QAction *m_pMinimizeAction;204 QAction *m_pRestoreAction;205 QAction *m_pCloseAction;206 207 /* Variables: Menu stuff: */208 QAction *m_pMenuInsertPosition;209 210 /* Variables: Spacers stuff: */211 QList<QWidget*> m_spacings;212 QList<QWidget*> m_margins;213 };214 215 146 #endif // __UIMiniToolBar_h__ 216 147
Note:
See TracChangeset
for help on using the changeset viewer.