VirtualBox

source: vbox/trunk/src/VBox/Frontends/VirtualBox/include/VBoxMiniToolBar.h@ 20146

Last change on this file since 20146 was 20146, checked in by vboxsync, 16 years ago

FE/Qt4: 3948: Mini-ToolBar for Full-screen & Seamless modes: tool-bar bottom-alignment added (additionally to base 'top-aligned' variant), currently alignment could be selected only in code when creating tool-bar. Bottom alignment made the default one.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 2.9 KB
Line 
1/** @file
2 *
3 * VBox frontends: Qt GUI ("VirtualBox"):
4 * VBoxMiniToolBar class declaration & implementation. This is the toolbar shown on fullscreen mode.
5 */
6
7/*
8 * Copyright (C) 2009 Sun Microsystems, Inc.
9 *
10 * This file is part of VirtualBox Open Source Edition (OSE), as
11 * available from http://www.215389.xyz. This file is free software;
12 * you can redistribute it and/or modify it under the terms of the GNU
13 * General Public License (GPL) as published by the Free Software
14 * Foundation, in version 2 as it comes in the "COPYING" file of the
15 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
16 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
17 *
18 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
19 * Clara, CA 95054 USA or visit http://www.sun.com if you need
20 * additional information or have any questions.
21 */
22
23#ifndef __VBoxMiniToolBar_h__
24#define __VBoxMiniToolBar_h__
25
26/* VBox includes */
27#include <VBoxToolBar.h>
28
29/* Qt includes */
30#include <QBasicTimer>
31
32class QLabel;
33class QMenu;
34
35/**
36 * The VBoxMiniToolBar class is a toolbar shown inside full screen mode or seamless mode.
37 * It supports auto hiding and animated sliding up/down.
38 */
39class VBoxMiniToolBar : public VBoxToolBar
40{
41 Q_OBJECT;
42
43public:
44
45 enum Alignment
46 {
47 AlignTop,
48 AlignBottom
49 };
50
51 VBoxMiniToolBar (Alignment aAlignment);
52
53 VBoxMiniToolBar& operator<< (QList <QMenu*> aMenus);
54
55 void updateDisplay (bool aShow, bool aSetHideFlag);
56 void setDisplayText (const QString &aText);
57
58signals:
59
60 void exitAction();
61 void closeAction();
62
63protected:
64
65 void resizeEvent (QResizeEvent *aEvent);
66 void mouseMoveEvent (QMouseEvent *aEvent);
67 void timerEvent (QTimerEvent *aEvent);
68 void showEvent (QShowEvent *aEvent);
69
70private slots:
71
72 void togglePushpin (bool aOn);
73
74private:
75
76 QAction *mAutoHideAct;
77 QLabel *mDisplayLabel;
78
79 QBasicTimer mScrollTimer;
80 QBasicTimer mAutoScrollTimer;
81
82 int mAutoHideCounter;
83 bool mAutoHide;
84 bool mSlideToScreen;
85 bool mHideAfterSlide;
86 bool mPolished;
87
88 int mPositionX;
89 int mPositionY;
90
91 /* Lists of used spacers */
92 QList <QWidget*> mMargins;
93 QList <QWidget*> mSpacings;
94 QList <QWidget*> mLabelMargins;
95
96 /* Menu insert position */
97 QAction *mInsertPosition;
98
99 /* Tool-bar alignment */
100 Alignment mAlignment;
101
102 /* Wether to animate showing/hiding the toolbar */
103 bool mAnimated;
104
105 /* Interval (in milli seconds) for scrolling the toolbar, default is 20 msec */
106 int mScrollDelay;
107
108 /* The wait time while the cursor is not over the window after this amount of time (in msec),
109 * the toolbar will auto hide if autohide is on. The default is 100msec. */
110 int mAutoScrollDelay;
111
112 /* Number of total steps before hiding. If it is 10 then wait 10 (steps) * 100ms (mAutoScrollDelay) = 1000ms delay.
113 * The default is 10. */
114 int mAutoHideTotalCounter;
115};
116
117#endif // __VBoxMiniToolBar_h__
118
Note: See TracBrowser for help on using the repository browser.

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