VirtualBox

Changeset 57021 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Jul 20, 2015 2:06:23 PM (9 years ago)
Author:
vboxsync
Message:

FE/Qt: 5978: Mini-toolbar: Move private part into source file.

Location:
trunk/src/VBox/Frontends/VirtualBox
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/Makefile.kmk

    r56817 r57021  
    513513        src/settings/machine/UIMachineSettingsUSB.cpp \
    514514        src/widgets/UIHotKeyEditor.cpp \
     515        src/widgets/UIMiniToolBar.cpp \
    515516        src/widgets/UIPortForwardingTable.cpp \
    516517        src/wizards/importappliance/UIWizardImportApp.cpp
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineWindowFullscreen.cpp

    r57019 r57021  
    243243
    244244    /* Create mini-toolbar: */
    245     m_pMiniToolBar = new UIRuntimeMiniToolBar(this,
    246                                               GeometryType_Full,
    247                                               gEDataManager->miniToolbarAlignment(vboxGlobal().managedVMUuid()),
    248                                               gEDataManager->autoHideMiniToolbar(vboxGlobal().managedVMUuid()));
     245    m_pMiniToolBar = new UIMiniToolBar(this,
     246                                       GeometryType_Full,
     247                                       gEDataManager->miniToolbarAlignment(vboxGlobal().managedVMUuid()),
     248                                       gEDataManager->autoHideMiniToolbar(vboxGlobal().managedVMUuid()));
    249249    AssertPtrReturnVoid(m_pMiniToolBar);
    250250    {
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineWindowFullscreen.h

    r57019 r57021  
    2424#if defined(Q_WS_WIN) || defined(Q_WS_X11)
    2525/* Forward declarations: */
    26 class UIRuntimeMiniToolBar;
     26class UIMiniToolBar;
    2727#endif /* Q_WS_WIN || Q_WS_X11 */
    2828
     
    103103#if defined(Q_WS_WIN) || defined(Q_WS_X11)
    104104    /** Holds the mini-toolbar instance. */
    105     UIRuntimeMiniToolBar *m_pMiniToolBar;
     105    UIMiniToolBar *m_pMiniToolBar;
    106106#endif /* Q_WS_WIN || Q_WS_X11 */
    107107
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIMachineWindowSeamless.cpp

    r57019 r57021  
    125125
    126126    /* Create mini-toolbar: */
    127     m_pMiniToolBar = new UIRuntimeMiniToolBar(this,
    128                                               GeometryType_Available,
    129                                               gEDataManager->miniToolbarAlignment(vboxGlobal().managedVMUuid()),
    130                                               gEDataManager->autoHideMiniToolbar(vboxGlobal().managedVMUuid()));
     127    m_pMiniToolBar = new UIMiniToolBar(this,
     128                                       GeometryType_Available,
     129                                       gEDataManager->miniToolbarAlignment(vboxGlobal().managedVMUuid()),
     130                                       gEDataManager->autoHideMiniToolbar(vboxGlobal().managedVMUuid()));
    131131    AssertPtrReturnVoid(m_pMiniToolBar);
    132132    {
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIMachineWindowSeamless.h

    r57019 r57021  
    2424#if defined(Q_WS_WIN) || defined(Q_WS_X11)
    2525/* Forward declarations: */
    26 class UIRuntimeMiniToolBar;
     26class UIMiniToolBar;
    2727#endif /* Q_WS_WIN || Q_WS_X11 */
    2828
     
    8585#if defined(Q_WS_WIN) || defined(Q_WS_X11)
    8686    /** Holds the mini-toolbar instance. */
    87     UIRuntimeMiniToolBar *m_pMiniToolBar;
     87    UIMiniToolBar *m_pMiniToolBar;
    8888#endif /* Q_WS_WIN || Q_WS_X11 */
    8989
  • trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIMiniToolBar.cpp

    r57019 r57021  
    4343#endif /* !VBOX_WITH_PRECOMPILED_HEADERS */
    4444
    45 
    46 UIRuntimeMiniToolBar::UIRuntimeMiniToolBar(QWidget *pParent,
    47                                            GeometryType geometryType,
    48                                            Qt::Alignment alignment,
    49                                            bool fAutoHide /* = true */)
     45/* Mini-toolbar widget prototype: */
     46class UIMiniToolBarPrivate : public UIToolBar
     47{
     48    Q_OBJECT;
     49
     50signals:
     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
     61public:
     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
     79protected:
     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
     87private:
     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
     115UIMiniToolBar::UIMiniToolBar(QWidget *pParent,
     116                             GeometryType geometryType,
     117                             Qt::Alignment alignment,
     118                             bool fAutoHide /* = true */)
    50119    : QWidget(pParent, Qt::Tool | Qt::FramelessWindowHint)
    51120    /* Variables: General stuff: */
     
    67136}
    68137
    69 UIRuntimeMiniToolBar::~UIRuntimeMiniToolBar()
     138UIMiniToolBar::~UIMiniToolBar()
    70139{
    71140    /* Cleanup: */
     
    73142}
    74143
    75 void UIRuntimeMiniToolBar::setAlignment(Qt::Alignment alignment)
     144void UIMiniToolBar::setAlignment(Qt::Alignment alignment)
    76145{
    77146    /* Make sure toolbar created: */
     
    92161}
    93162
    94 void UIRuntimeMiniToolBar::setAutoHide(bool fAutoHide, bool fPropagateToChild /* = true */)
     163void UIMiniToolBar::setAutoHide(bool fAutoHide, bool fPropagateToChild /* = true */)
    95164{
    96165    /* Make sure toolbar created: */
     
    112181}
    113182
    114 void UIRuntimeMiniToolBar::setText(const QString &strText)
     183void UIMiniToolBar::setText(const QString &strText)
    115184{
    116185    /* Make sure toolbar created: */
     
    121190}
    122191
    123 void UIRuntimeMiniToolBar::addMenus(const QList<QMenu*> &menus)
     192void UIMiniToolBar::addMenus(const QList<QMenu*> &menus)
    124193{
    125194    /* Make sure toolbar created: */
     
    130199}
    131200
    132 void UIRuntimeMiniToolBar::adjustGeometry(int iHostScreen /* = -1 */)
     201void UIMiniToolBar::adjustGeometry(int iHostScreen /* = -1 */)
    133202{
    134203#ifndef Q_WS_X11
     
    253322}
    254323
    255 void UIRuntimeMiniToolBar::sltHandleToolbarResize()
     324void UIMiniToolBar::sltHandleToolbarResize()
    256325{
    257326    /* Re-initialize: */
     
    259328}
    260329
    261 void UIRuntimeMiniToolBar::sltAutoHideToggled()
     330void UIMiniToolBar::sltAutoHideToggled()
    262331{
    263332    /* Propagate from child: */
     
    265334}
    266335
    267 void UIRuntimeMiniToolBar::sltHoverEnter()
     336void UIMiniToolBar::sltHoverEnter()
    268337{
    269338    /* Mark as 'hovered' if necessary: */
     
    275344}
    276345
    277 void UIRuntimeMiniToolBar::sltHoverLeave()
     346void UIMiniToolBar::sltHoverLeave()
    278347{
    279348    /* Mark as 'unhovered' if necessary: */
     
    285354}
    286355
    287 void UIRuntimeMiniToolBar::prepare()
     356void UIMiniToolBar::prepare()
    288357{
    289358#if defined (Q_WS_X11)
     
    331400
    332401    /* Prepare mini-toolbar: */
    333     m_pToolbar = new UIMiniToolBar;
     402    m_pToolbar = new UIMiniToolBarPrivate;
    334403    {
    335404        /* Make sure we have no focus: */
     
    383452}
    384453
    385 void UIRuntimeMiniToolBar::cleanup()
     454void UIMiniToolBar::cleanup()
    386455{
    387456    /* Stop hover-enter/leave timers: */
     
    400469}
    401470
    402 void UIRuntimeMiniToolBar::enterEvent(QEvent*)
     471void UIMiniToolBar::enterEvent(QEvent*)
    403472{
    404473    /* Stop the hover-leave timer if necessary: */
     
    411480}
    412481
    413 void UIRuntimeMiniToolBar::leaveEvent(QEvent*)
     482void UIMiniToolBar::leaveEvent(QEvent*)
    414483{
    415484    /* Stop the hover-enter timer if necessary: */
     
    423492
    424493#ifdef Q_WS_X11
    425 void UIRuntimeMiniToolBar::resizeEvent(QResizeEvent*)
     494void UIMiniToolBar::resizeEvent(QResizeEvent*)
    426495{
    427496    /* Adjust mini-toolbar on resize: */
     
    430499#endif /* Q_WS_X11 */
    431500
    432 bool UIRuntimeMiniToolBar::eventFilter(QObject *pWatched, QEvent *pEvent)
     501bool UIMiniToolBar::eventFilter(QObject *pWatched, QEvent *pEvent)
    433502{
    434503#if   defined(Q_WS_WIN)
     
    451520}
    452521
    453 void UIRuntimeMiniToolBar::simulateToolbarAutoHiding()
     522void UIMiniToolBar::simulateToolbarAutoHiding()
    454523{
    455524    /* This simulation helps user to notice
     
    465534}
    466535
    467 void UIRuntimeMiniToolBar::setToolbarPosition(QPoint point)
     536void UIMiniToolBar::setToolbarPosition(QPoint point)
    468537{
    469538    /* Update position: */
     
    472541}
    473542
    474 QPoint UIRuntimeMiniToolBar::toolbarPosition() const
     543QPoint UIMiniToolBar::toolbarPosition() const
    475544{
    476545    /* Return position: */
     
    480549
    481550
    482 UIMiniToolBar::UIMiniToolBar()
     551UIMiniToolBarPrivate::UIMiniToolBarPrivate()
    483552    /* Variables: General stuff: */
    484553    : m_fPolished(false)
     
    497566}
    498567
    499 void UIMiniToolBar::setAlignment(Qt::Alignment alignment)
     568void UIMiniToolBarPrivate::setAlignment(Qt::Alignment alignment)
    500569{
    501570    /* Make sure alignment really changed: */
     
    510579}
    511580
    512 bool UIMiniToolBar::autoHide() const
     581bool UIMiniToolBarPrivate::autoHide() const
    513582{
    514583    /* Return auto-hide: */
     
    516585}
    517586
    518 void UIMiniToolBar::setAutoHide(bool fAutoHide)
     587void UIMiniToolBarPrivate::setAutoHide(bool fAutoHide)
    519588{
    520589    /* Make sure auto-hide really changed: */
     
    526595}
    527596
    528 void UIMiniToolBar::setText(const QString &strText)
     597void UIMiniToolBarPrivate::setText(const QString &strText)
    529598{
    530599    /* Make sure text really changed: */
     
    539608}
    540609
    541 void UIMiniToolBar::addMenus(const QList<QMenu*> &menus)
     610void UIMiniToolBarPrivate::addMenus(const QList<QMenu*> &menus)
    542611{
    543612    /* For each of the passed menu items: */
     
    563632}
    564633
    565 void UIMiniToolBar::showEvent(QShowEvent *pEvent)
     634void UIMiniToolBarPrivate::showEvent(QShowEvent *pEvent)
    566635{
    567636    /* Make sure we should polish dialog: */
     
    576645}
    577646
    578 void UIMiniToolBar::polishEvent(QShowEvent*)
     647void UIMiniToolBarPrivate::polishEvent(QShowEvent*)
    579648{
    580649    /* Toolbar spacings: */
     
    590659}
    591660
    592 void UIMiniToolBar::resizeEvent(QResizeEvent*)
     661void UIMiniToolBarPrivate::resizeEvent(QResizeEvent*)
    593662{
    594663    /* Rebuild shape: */
     
    599668}
    600669
    601 void UIMiniToolBar::paintEvent(QPaintEvent*)
     670void UIMiniToolBarPrivate::paintEvent(QPaintEvent*)
    602671{
    603672    /* Prepare painter: */
     
    618687}
    619688
    620 void UIMiniToolBar::prepare()
     689void UIMiniToolBarPrivate::prepare()
    621690{
    622691    /* Determine icon metric: */
     
    694763}
    695764
    696 void UIMiniToolBar::rebuildShape()
     765void UIMiniToolBarPrivate::rebuildShape()
    697766{
    698767#ifdef Q_WS_X11
     
    736805}
    737806
     807#include "UIMiniToolBar.moc"
     808
  • trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIMiniToolBar.h

    r57019 r57021  
    3333class QMdiSubWindow;
    3434class UIAnimation;
     35class UIMiniToolBarPrivate;
    3536
    3637/** Geometry types. */
     
    4243
    4344/* Runtime mini-toolbar frameless-window prototype: */
    44 class UIRuntimeMiniToolBar : public QWidget
     45class UIMiniToolBar : public QWidget
    4546{
    4647    Q_OBJECT;
     
    6667
    6768    /* Constructor/destructor: */
    68     UIRuntimeMiniToolBar(QWidget *pParent,
    69                          GeometryType geometryType,
    70                          Qt::Alignment alignment,
    71                          bool fAutoHide = true);
    72     ~UIRuntimeMiniToolBar();
     69    UIMiniToolBar(QWidget *pParent,
     70                  GeometryType geometryType,
     71                  Qt::Alignment alignment,
     72                  bool fAutoHide = true);
     73    ~UIMiniToolBar();
    7374
    7475    /* API: Alignment stuff: */
     
    131132    /* Variables: Contents stuff: */
    132133    QMdiArea *m_pMdiArea;
    133     UIMiniToolBar *m_pToolbar;
     134    UIMiniToolBarPrivate *m_pToolbar;
    134135    QMdiSubWindow *m_pEmbeddedToolbar;
    135136
     
    143144};
    144145
    145 /* Mini-toolbar widget prototype: */
    146 class UIMiniToolBar : public UIToolBar
    147 {
    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 
    215146#endif // __UIMiniToolBar_h__
    216147
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette