diff options
| -rw-r--r-- | sb.cpp | 25 |
1 files changed, 1 insertions, 24 deletions
@@ -19,7 +19,7 @@ #include <QShortcut> #include <QVBoxLayout> - +#include "webengine.hpp" bool is_valid_url(const std::string & url); void open_url(const std::string & url); @@ -44,29 +44,6 @@ QWebEngineView * web; QMainWindow * view; Display * dpy; -class WebEnginePage: public QWebEnginePage { -Q_OBJECT -public: - WebEnginePage(QWebEngineProfile *profile) : QWebEnginePage(profile) {}; - virtual ~WebEnginePage() = default; - -protected: - QWebEnginePage *createWindow(WebWindowType){ - WebEnginePage *page = new WebEnginePage(this->profile()); - connect(page, &QWebEnginePage::urlChanged, this, &WebEnginePage::onUrlChanged); - return page; - } - -private: - void onUrlChanged(const QUrl & url){ - if(WebEnginePage *page = qobject_cast<WebEnginePage *>(sender())){ - setUrl(url); - page->deleteLater(); - } - } -}; - -#include "webengine.hpp" std::string read_from_dmenu() { std::string output; |