VirtualBox

Changeset 16319 in vbox


Ignore:
Timestamp:
Jan 28, 2009 4:24:35 PM (16 years ago)
Author:
vboxsync
Message:

FE/Qt4: 3530: Host+Home shows machine menu in Seamless/Fullscreen modes. A little w/a to avoid showing sub-menu but highlight only the first menu item.

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/include/VBoxConsoleWnd.h

    r16304 r16319  
    3535#include <QColor>
    3636#include <QDialog>
     37#include <QMenu>
    3738
    3839#ifdef VBOX_WITH_DEBUGGER_GUI
     
    4950class QLabel;
    5051class QSpacerItem;
    51 class QMenu;
    5252
    5353class VBoxConsoleView;
     
    5858
    5959class VBoxChangeDockIconUpdateEvent;
     60
     61/* We want to make the first action highlighted but not
     62 * selected, but Qt makes the both or neither one of this,
     63 * so, just move the focus to the next eligible object,
     64 * which will be the first menu action. This little
     65 * subclass made only for that purpose. */
     66class QIMenu : public QMenu
     67{
     68    Q_OBJECT;
     69
     70public:
     71
     72    QIMenu (QWidget *aParent) : QMenu (aParent) {}
     73
     74    void selectFirstAction() { QMenu::focusNextChild(); }
     75};
    6076
    6177class VBoxConsoleWnd : public QIWithRetranslateUI2<QMainWindow>
     
    236252
    237253    /** Popup version of the main menu */
    238     QMenu *mMainMenu;
     254    QIMenu *mMainMenu;
    239255
    240256    QActionGroup *mRunningActions;
  • trunk/src/VBox/Frontends/VirtualBox/src/VBoxConsoleWnd.cpp

    r16304 r16319  
    398398    ///// Menubar ///////////////////////////////////////////////////////////
    399399
    400     mMainMenu = new QMenu (this);
     400    mMainMenu = new QIMenu (this);
    401401
    402402    /* Machine submenu */
     
    11881188    }
    11891189
    1190     mMainMenu->setActiveAction (mMainMenu->actions().first());
    11911190    mMainMenu->popup (pos);
    1192     mMainMenu->activateWindow();
     1191    mMainMenu->selectFirstAction();
    11931192}
    11941193
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