From 5b14fc424462a5d3a5a509bd177c04e9cba2ce17 Mon Sep 17 00:00:00 2001 From: "Felix (xq) Queißner" Date: Wed, 17 Jun 2020 01:29:30 +0200 Subject: 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. --- src/searchbar.cpp | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 src/searchbar.cpp (limited to 'src/searchbar.cpp') 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 + +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); + } +} -- cgit v1.2.3