diff options
author | Aqua-sama <aqua@iserlohn-fortress.net> | 2018-12-13 12:49:28 +0100 |
---|---|---|
committer | Aqua-sama <aqua@iserlohn-fortress.net> | 2018-12-13 13:41:50 +0100 |
commit | 4eedf60d76a047f63b0991eee0b623e9be854c76 (patch) | |
tree | c8b335c8909a309c2bc2765e823bec5da74aa5aa /src/mainwindow/widgets | |
parent | Fix crash creating ConfigurationEditorPlugin widget (diff) | |
download | smolbote-4eedf60d76a047f63b0991eee0b623e9be854c76.tar.xz |
MainWindow: rework menu bar
Split off menu bar into its own class out of MainWindow
Menu bar now has a 'Find in menus' function
Diffstat (limited to 'src/mainwindow/widgets')
-rw-r--r-- | src/mainwindow/widgets/menusearch.cpp | 17 | ||||
-rw-r--r-- | src/mainwindow/widgets/menusearch.h | 20 | ||||
-rw-r--r-- | src/mainwindow/widgets/navigationbar.cpp | 4 |
3 files changed, 39 insertions, 2 deletions
diff --git a/src/mainwindow/widgets/menusearch.cpp b/src/mainwindow/widgets/menusearch.cpp new file mode 100644 index 0000000..2905d6d --- /dev/null +++ b/src/mainwindow/widgets/menusearch.cpp @@ -0,0 +1,17 @@ +/* + * This file is part of smolbote. It's copyrighted by the contributors recorded + * in the version control history of the file, available from its original + * location: https://neueland.iserlohn-fortress.net/gitea/aqua/smolbote + * + * SPDX-License-Identifier: GPL-3.0 + */ + +#include "menusearch.h" + +MenuSearch::MenuSearch(QWidget *parent) + : QLineEdit(parent) +{ + setMinimumWidth(300); + setPlaceholderText(tr("Find...")); + setClearButtonEnabled(true); +} diff --git a/src/mainwindow/widgets/menusearch.h b/src/mainwindow/widgets/menusearch.h new file mode 100644 index 0000000..e20604c --- /dev/null +++ b/src/mainwindow/widgets/menusearch.h @@ -0,0 +1,20 @@ +/* + * This file is part of smolbote. It's copyrighted by the contributors recorded + * in the version control history of the file, available from its original + * location: https://neueland.iserlohn-fortress.net/gitea/aqua/smolbote + * + * SPDX-License-Identifier: GPL-3.0 + */ + +#ifndef SMOLBOTE_MENUSEARCH_H +#define SMOLBOTE_MENUSEARCH_H + +#include <QLineEdit> + +class MenuSearch : public QLineEdit +{ +public: + MenuSearch(QWidget *parent = nullptr); +}; + +#endif // SMOLBOTE_MENUSEARCH_H diff --git a/src/mainwindow/widgets/navigationbar.cpp b/src/mainwindow/widgets/navigationbar.cpp index 61d17fa..c56d342 100644 --- a/src/mainwindow/widgets/navigationbar.cpp +++ b/src/mainwindow/widgets/navigationbar.cpp @@ -7,8 +7,9 @@ */ #include "navigationbar.h" -#include "urllineedit.h" #include "configuration.h" +#include "urllineedit.h" +#include "util.h" #include "webengine/webview.h" #include <QHBoxLayout> #include <QMenu> @@ -17,7 +18,6 @@ #include <QToolBar> #include <QToolButton> #include <QWebEngineHistory> -#include "util.h" NavigationBar::NavigationBar(const Configuration *config, QWidget *parent) : QToolBar(parent) |