diff options
Diffstat (limited to 'src/VBox/Frontends/VirtualBox4/include/VBoxConsoleWnd.h')
-rw-r--r-- | src/VBox/Frontends/VirtualBox4/include/VBoxConsoleWnd.h | 32 |
1 files changed, 24 insertions, 8 deletions
diff --git a/src/VBox/Frontends/VirtualBox4/include/VBoxConsoleWnd.h b/src/VBox/Frontends/VirtualBox4/include/VBoxConsoleWnd.h index f233a8da8..979aeb26a 100644 --- a/src/VBox/Frontends/VirtualBox4/include/VBoxConsoleWnd.h +++ b/src/VBox/Frontends/VirtualBox4/include/VBoxConsoleWnd.h @@ -34,6 +34,7 @@ #include <QMap> #include <QColor> #include <QDialog> +#include <QMenu> #ifdef VBOX_WITH_DEBUGGER_GUI # include <VBox/dbggui.h> @@ -48,7 +49,6 @@ class QAction; class QActionGroup; class QLabel; class QSpacerItem; -class QMenu; class VBoxConsoleView; class QIStateIndicator; @@ -58,6 +58,22 @@ class VBoxSwitchMenu; class VBoxChangeDockIconUpdateEvent; +/* We want to make the first action highlighted but not + * selected, but Qt makes the both or neither one of this, + * so, just move the focus to the next eligible object, + * which will be the first menu action. This little + * subclass made only for that purpose. */ +class QIMenu : public QMenu +{ + Q_OBJECT; + +public: + + QIMenu (QWidget *aParent) : QMenu (aParent) {} + + void selectFirstAction() { QMenu::focusNextChild(); } +}; + class VBoxConsoleWnd : public QIWithRetranslateUI2<QMainWindow> { Q_OBJECT; @@ -73,8 +89,8 @@ public: void refreshView(); - bool isWindowMaximized() const - { + bool isWindowMaximized() const + { #ifdef Q_WS_MAC /* On Mac OS X we didn't really jump to the fullscreen mode but * maximize the window. This situation has to be considered when @@ -82,10 +98,10 @@ public: return !(isTrueSeamless()) && QMainWindow::isMaximized(); #else /* Q_WS_MAC */ return QMainWindow::isMaximized(); -#endif /* Q_WS_MAC */ +#endif /* Q_WS_MAC */ } - bool isWindowFullScreen() const - { + bool isWindowFullScreen() const + { #ifdef Q_WS_MAC /* On Mac OS X we didn't really jump to the fullscreen mode but * maximize the window. This situation has to be considered when @@ -93,7 +109,7 @@ public: return isTrueFullscreen() || isTrueSeamless(); #else /* Q_WS_MAC */ return QMainWindow::isFullScreen(); -#endif /* Q_WS_MAC */ +#endif /* Q_WS_MAC */ } bool isTrueFullscreen() const { return mIsFullscreen; } @@ -235,7 +251,7 @@ private slots: private: /** Popup version of the main menu */ - QMenu *mMainMenu; + QIMenu *mMainMenu; QActionGroup *mRunningActions; QActionGroup *mRunningOrPausedActions; |