aboutsummaryrefslogtreecommitdiff
path: root/src/searchbar.cpp
diff options
context:
space:
mode:
authorFelix (xq) Queißner <git@mq32.de>2020-06-17 01:29:30 +0200
committerFelix (xq) Queißner <git@mq32.de>2020-06-17 01:29:30 +0200
commit5b14fc424462a5d3a5a509bd177c04e9cba2ce17 (patch)
treead5e9b685be26d22d570ba4788a9b01a65ceb531 /src/searchbar.cpp
parent03253a724b6fdb3f511510d10c3e62615e305cf2 (diff)
downloadkristall-5b14fc424462a5d3a5a509bd177c04e9cba2ce17.tar.gz
Makes gemini protocol handler a bit more robust.Makes style preview a file in about: instead of hardcoding it. Starts to implement the options menu for redirection configuration.
Diffstat (limited to 'src/searchbar.cpp')
-rw-r--r--src/searchbar.cpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/searchbar.cpp b/src/searchbar.cpp
new file mode 100644
index 0000000..4d8ea3a
--- /dev/null
+++ b/src/searchbar.cpp
@@ -0,0 +1,26 @@
+#include "searchbar.hpp"
+
+#include <QKeyEvent>
+
+SearchBar::SearchBar(QWidget *parent) : QLineEdit(parent)
+{
+
+}
+
+void SearchBar::keyPressEvent(QKeyEvent *event)
+{
+ if(event->key() == Qt::Key_Escape) {
+ emit this->escapePressed();
+ } else {
+ QLineEdit::keyPressEvent(event);
+ }
+}
+
+void SearchBar::keyReleaseEvent(QKeyEvent *event)
+{
+ if(event->key() == Qt::Key_Escape) {
+ // Eat the event
+ } else {
+ QLineEdit::keyReleaseEvent(event);
+ }
+}