1
mirror of https://invent.kde.org/network/falkon.git synced 2024-12-20 10:46:35 +01:00

[Fix] Fixed wrong tab focus order. Closes #135

- it is now LocationBar -> WebSearchBar -> WebView -> ...
This commit is contained in:
nowrep 2012-01-08 12:38:02 +01:00
parent f0c04e88e9
commit 2d6585c786
4 changed files with 16 additions and 3 deletions

View File

@ -266,17 +266,17 @@ void QupZilla::setupMenu()
// Standard actions - needed on Mac to be placed correctly in "application" menu
m_actionAbout = new QAction(QIcon(":/icons/qupzilla.png"), tr("&About QupZilla"), this);
m_actionAbout->setMenuRole(QAction::AboutRole);
connect (m_actionAbout, SIGNAL(triggered()), this, SLOT(aboutQupZilla()));
connect(m_actionAbout, SIGNAL(triggered()), this, SLOT(aboutQupZilla()));
m_actionPreferences = new QAction(QIcon(":/icons/faenza/settings.png"), tr("Pr&eferences"), this);
m_actionPreferences->setMenuRole(QAction::PreferencesRole);
m_actionPreferences->setShortcut(QKeySequence("Ctrl+P"));
connect (m_actionPreferences, SIGNAL(triggered()), this, SLOT(showPreferences()));
connect(m_actionPreferences, SIGNAL(triggered()), this, SLOT(showPreferences()));
m_actionQuit = new QAction(QIcon::fromTheme("application-exit"), tr("Quit"), this);
m_actionQuit->setMenuRole(QAction::QuitRole);
m_actionQuit->setShortcut(QKeySequence("Ctrl+Q"));
connect (m_actionQuit, SIGNAL(triggered()), this, SLOT(quitApp()));
connect(m_actionQuit, SIGNAL(triggered()), this, SLOT(quitApp()));
menuBar()->setObjectName("mainwindow-menubar");
menuBar()->setCursor(Qt::ArrowCursor);

View File

@ -55,6 +55,7 @@ NavigationBar::NavigationBar(QupZilla* mainClass, QWidget* parent)
m_buttonBack->setToolButtonStyle(Qt::ToolButtonIconOnly);
m_buttonBack->setAutoRaise(true);
m_buttonBack->setEnabled(false);
m_buttonBack->setFocusPolicy(Qt::NoFocus);
m_buttonNext = new ToolButton(this);
m_buttonNext->setObjectName("navigation-button-next");
@ -62,6 +63,7 @@ NavigationBar::NavigationBar(QupZilla* mainClass, QWidget* parent)
m_buttonNext->setToolButtonStyle(Qt::ToolButtonIconOnly);
m_buttonNext->setAutoRaise(true);
m_buttonNext->setEnabled(false);
m_buttonNext->setFocusPolicy(Qt::NoFocus);
QHBoxLayout* backNextLayout = new QHBoxLayout();
backNextLayout->setContentsMargins(0, 0, 0, 0);
@ -76,12 +78,14 @@ NavigationBar::NavigationBar(QupZilla* mainClass, QWidget* parent)
m_buttonHome->setToolTip(tr("Home"));
m_buttonHome->setToolButtonStyle(Qt::ToolButtonIconOnly);
m_buttonHome->setAutoRaise(true);
m_buttonHome->setFocusPolicy(Qt::NoFocus);
m_buttonAddTab = new ToolButton(this);
m_buttonAddTab->setObjectName("navigation-button-addtab");
m_buttonAddTab->setToolTip(tr("New Tab"));
m_buttonAddTab->setToolButtonStyle(Qt::ToolButtonIconOnly);
m_buttonAddTab->setAutoRaise(true);
m_buttonAddTab->setFocusPolicy(Qt::NoFocus);
m_menuBack = new Menu(this);
m_buttonBack->setMenu(m_menuBack);

View File

@ -29,12 +29,14 @@ ReloadStopButton::ReloadStopButton(QWidget* parent)
m_buttonStop->setToolButtonStyle(Qt::ToolButtonIconOnly);
m_buttonStop->setVisible(false);
m_buttonStop->setAutoRaise(true);
m_buttonStop->setFocusPolicy(Qt::NoFocus);
m_buttonReload = new ToolButton(this);
m_buttonReload->setObjectName("navigation-button-reload");
m_buttonReload->setToolTip(tr("Reload"));
m_buttonReload->setToolButtonStyle(Qt::ToolButtonIconOnly);
m_buttonReload->setAutoRaise(true);
m_buttonReload->setFocusPolicy(Qt::NoFocus);
lay->addWidget(m_buttonStop);
lay->addWidget(m_buttonReload);

View File

@ -28,6 +28,8 @@
#include "progressbar.h"
#include "navigationbar.h"
#include "toolbutton.h"
#include "locationbar.h"
#include "websearchbar.h"
class NewTabButton : public QToolButton
{
@ -130,11 +132,13 @@ TabWidget::TabWidget(QupZilla* mainClass, QWidget* parent)
m_buttonListTabs->setPopupMode(QToolButton::InstantPopup);
m_buttonListTabs->setToolTip(tr("Show list of opened tabs"));
m_buttonListTabs->setAutoRaise(true);
m_buttonListTabs->setFocusPolicy(Qt::NoFocus);
m_buttonAddTab = new ToolButton(this);
m_buttonAddTab->setObjectName("tabwidget-button-addtab");
m_buttonAddTab->setAutoRaise(true);
m_buttonAddTab->setToolTip(tr("New Tab"));
m_buttonAddTab->setFocusPolicy(Qt::NoFocus);
connect(m_buttonAddTab, SIGNAL(clicked()), p_QupZilla, SLOT(addTab()));
connect(m_menuTabs, SIGNAL(aboutToShow()), this, SLOT(aboutToShowTabsMenu()));
@ -405,6 +409,9 @@ void TabWidget::currentTabChanged(int index)
}
webView->setFocus();
// Setting correct tab order (LocationBar -> WebSearchBar -> WebView)
setTabOrder(p_QupZilla->locationBar(), p_QupZilla->navigationBar()->searchLine());
setTabOrder(p_QupZilla->navigationBar()->searchLine(), webView);
m_tabBar->updateCloseButton(index);
}