Changeset 28457 in vbox
- Timestamp:
- Apr 19, 2010 12:36:06 PM (15 years ago)
- svn:sync-xref-src-repo-rev:
- 60230
- Location:
- trunk/src/VBox/Frontends/VirtualBox
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/Makefile.kmk
r28406 r28457 420 420 VirtualBox_QT_MOCSRCS += \ 421 421 src/runtime/UIActionsPool.cpp \ 422 src/runtime/UIMachineMenuBar.cpp \ 422 423 src/runtime/UIIndicatorsPool.cpp \ 423 424 src/runtime/UIMachine.cpp \ -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineMenuBar.cpp
r27599 r28457 32 32 #include <QMenuBar> 33 33 34 /* Helper QMenu reimplementation which allows 35 * to highlight first menu item for popped up menu: */ 36 class UIMenu : public QMenu 37 { 38 Q_OBJECT; 39 40 public: 41 42 UIMenu() : QMenu(0) {} 43 44 private slots: 45 46 void sltSelectFirstAction() 47 { 48 #ifdef Q_WS_WIN 49 activateWindow(); 50 #endif 51 QMenu::focusNextChild(); 52 } 53 }; 54 34 55 UIMachineMenuBar::UIMachineMenuBar() 35 56 /* On the Mac we add some items only the first time, cause otherwise they … … 42 63 { 43 64 /* Create empty menu: */ 44 QMenu *pMenu = new QMenu;65 QMenu *pMenu = new UIMenu; 45 66 46 67 /* Fill menu with prepared items: */ … … 241 262 } 242 263 264 #include "UIMachineMenuBar.moc" 265 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineWindowFullscreen.cpp
r27662 r28457 24 24 /* Global includes */ 25 25 #include <QDesktopWidget> 26 #include <QTimer> 26 27 #ifdef Q_WS_MAC 27 28 # include <QMenuBar> … … 130 131 /* Popup main menu if present: */ 131 132 if (m_pMainMenu && !m_pMainMenu->isEmpty()) 133 { 132 134 m_pMainMenu->popup(machineWindow()->geometry().center()); 135 QTimer::singleShot(0, m_pMainMenu, SLOT(sltSelectFirstAction())); 136 } 133 137 } 134 138 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineViewNormal.cpp
r27538 r28457 175 175 pMenuBar->activeAction()->activate(QAction::Trigger); 176 176 177 #ifdef Q_WS_WIN 178 /* Windows host needs separate 'focus set' 179 * to let menubar operate while popped up: */ 180 pMenuBar->setFocus(); 181 #endif /* ifdef Q_WS_WIN */ 182 177 183 /* Accept this event: */ 178 184 pEvent->accept(); … … 197 203 QMainWindow *pMainDialog = machineWindowWrapper() && machineWindowWrapper()->machineWindow() ? 198 204 qobject_cast<QMainWindow*>(machineWindowWrapper()->machineWindow()) : 0; 205 #ifdef Q_WS_WIN 206 QMenuBar *pMenuBar = pMainDialog ? pMainDialog->menuBar() : 0; 207 #endif /* ifdef Q_WS_WIN */ 199 208 200 209 if (pWatched != 0 && pWatched == pMainDialog) … … 228 237 } 229 238 239 #ifdef Q_WS_WIN 240 else if (pWatched != 0 && pWatched == pMenuBar) 241 { 242 /* Due to windows host uses separate 'focus set' to let menubar to 243 * operate while popped up (see UIMachineViewNormal::event() for details), 244 * it also requires backward processing: */ 245 switch (pEvent->type()) 246 { 247 /* If menubar gets the focus while not popped up => give it back: */ 248 case QEvent::FocusIn: 249 { 250 if (!QApplication::activePopupWidget()) 251 setFocus(); 252 } 253 default: 254 break; 255 } 256 } 257 #endif /* ifdef Q_WS_WIN */ 258 230 259 return UIMachineView::eventFilter(pWatched, pEvent); 231 260 } -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIMachineWindowSeamless.cpp
r27662 r28457 24 24 /* Global includes */ 25 25 #include <QDesktopWidget> 26 #include <QTimer> 26 27 #ifdef Q_WS_MAC 27 28 # include <QMenuBar> … … 127 128 /* Popup main menu if present: */ 128 129 if (m_pMainMenu && !m_pMainMenu->isEmpty()) 130 { 129 131 m_pMainMenu->popup(machineWindow()->geometry().center()); 132 QTimer::singleShot(0, m_pMainMenu, SLOT(sltSelectFirstAction())); 133 } 130 134 } 131 135
Note:
See TracChangeset
for help on using the changeset viewer.