From 98ce9b3256c3f6c9a098e7b9ab7b6bd095bd62bc Mon Sep 17 00:00:00 2001 From: Tvangeste Date: Tue, 28 Jun 2011 17:55:41 +0200 Subject: [PATCH] Cleanup of the focus order. Some non-essential components should never get keyboard focus. So, now the focus order is as follows: TranslateLine -> TabWidget -> ArticleView -> DictsList, nothing else. --- mainwindow.cc | 5 +++++ mainwindow.ui | 1 + 2 files changed, 6 insertions(+) diff --git a/mainwindow.cc b/mainwindow.cc index eb80f3aa..e7886082 100644 --- a/mainwindow.cc +++ b/mainwindow.cc @@ -63,9 +63,12 @@ MainWindow::MainWindow( Config::Class & cfg_ ): wordListDefaultFont = ui.wordList->font(); translateLineDefaultFont = ui.translateLine->font(); + ui.wordList->setFocusPolicy(Qt::ClickFocus); + // Make the search pane's titlebar groupLabel.setText( tr( "Look up in:" ) ); + groupList.setFocusPolicy(Qt::ClickFocus); searchPaneTitleBarLayout.setContentsMargins( 8, 5, 8, 4 ); searchPaneTitleBarLayout.addWidget( &groupLabel ); @@ -319,6 +322,7 @@ MainWindow::MainWindow( Config::Class & cfg_ ): this, SLOT( forwardClicked() ) ); addTab.setAutoRaise( true ); + addTab.setFocusPolicy(Qt::ClickFocus); addTab.setIcon( QIcon( ":/icons/addtab.png" ) ); ui.tabWidget->setHideSingleTab(cfg.preferences.hideSingleTab); @@ -832,6 +836,7 @@ void MainWindow::createTabList() tabListButton->setMenu(tabListMenu); tabListButton->setPopupMode(QToolButton::InstantPopup); ui.tabWidget->setCornerWidget(tabListButton); + tabListButton->setFocusPolicy(Qt::ClickFocus); } void MainWindow::fillWindowsMenu() diff --git a/mainwindow.ui b/mainwindow.ui index f5104587..78e8b94b 100644 --- a/mainwindow.ui +++ b/mainwindow.ui @@ -443,6 +443,7 @@ translateLine tabWidget + dictsList