From 8e1ac75749d4913ec9407844f2fab0eba0a0bb5b Mon Sep 17 00:00:00 2001 From: Aqua-sama Date: Sat, 31 Mar 2018 17:31:59 +0200 Subject: Add keyboard shortcuts for address bar menus --- src/mainwindow/mainwindow.cpp | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) (limited to 'src/mainwindow/mainwindow.cpp') diff --git a/src/mainwindow/mainwindow.cpp b/src/mainwindow/mainwindow.cpp index e280fee..6dc7635 100644 --- a/src/mainwindow/mainwindow.cpp +++ b/src/mainwindow/mainwindow.cpp @@ -17,14 +17,13 @@ #include #include "addressbar/urllineedit.h" #include -//#include MainWindow::MainWindow(std::shared_ptr config, QWidget *parent) : QMainWindow(parent) , ui(new Ui::MainWindow) , tabBar(new MainWindowTabBar(config, this)) , menuBar(new MainWindowMenuBar(config, this)) - , m_addressBar(new UrlLineEdit(this)) + , m_addressBar(new UrlLineEdit(config->section("addressbar"), this)) , m_progressBar(new LoadingBar(this)) { Q_ASSERT(config); @@ -84,17 +83,6 @@ MainWindow::MainWindow(std::shared_ptr config, QWidget *parent) ui->statusBar->addWidget(m_searchBox); m_searchBox->setVisible(false); - // shortcuts - QAction *focusAddressAction = new QAction(this); - focusAddressAction->setShortcut(QKeySequence(QString::fromStdString(m_config->value("browser.shortcuts.focusAddress").value()))); - //focusAddressAction->setShortcut(QKeySequence::fromString(browser->settings()->value("window.shortcuts.focusAddress").toString())); - //connect(focusAddressAction, SIGNAL(triggered(bool)), this, SLOT(focusAddress())); - connect(focusAddressAction, &QAction::triggered, this, [this]() { - m_addressBar->setFocus(); - m_addressBar->selectAll(); - }); - addAction(focusAddressAction); - resize(m_config->value("browser.window.width").value(), m_config->value("browser.window.height").value()); if(m_config->value("browser.window.maximized").value()) { showMaximized(); -- cgit v1.2.1