From f11f3de4e4df789d09dccce31d446092c112b350 Mon Sep 17 00:00:00 2001 From: Kevin Whitaker Date: Thu, 23 Feb 2017 18:41:29 -0500 Subject: [PATCH] Support enter key in some text boxes as button click that matches. --- src/ui/LoginInterface.cpp | 1 + src/ui/RequestInterface.cpp | 1 + 2 files changed, 2 insertions(+) diff --git a/src/ui/LoginInterface.cpp b/src/ui/LoginInterface.cpp index 201666e..222a9a2 100644 --- a/src/ui/LoginInterface.cpp +++ b/src/ui/LoginInterface.cpp @@ -41,6 +41,7 @@ LoginInterface::LoginInterface(WebInterface* app) usernameField = new Wt::WLineEdit(); passwordField = new Wt::WLineEdit(); passwordField->setEchoMode(Wt::WLineEdit::EchoMode::Password); + passwordField->enterPressed().connect(this, &LoginInterface::loginCheck); usernameArea->addWidget(new Wt::WText("Username:")); usernameArea->addWidget(usernameField); passwordArea->addWidget(new Wt::WText("Password:")); diff --git a/src/ui/RequestInterface.cpp b/src/ui/RequestInterface.cpp index e8104af..e45b2da 100644 --- a/src/ui/RequestInterface.cpp +++ b/src/ui/RequestInterface.cpp @@ -43,6 +43,7 @@ RequestInterface::RequestInterface(WebInterface* app) searchBtn->setTextFormat(Wt::XHTMLText); searchBtn->decorationStyle().font().setFamily(Wt::WFont::Default,"FontAwesome"); searchBtn->setText(""); + searchBox->enterPressed().connect(this, &RequestInterface::searchClicked); searchLayout->addWidget(searchBox); searchLayout->addWidget(searchBtn); searchBtn->clicked().connect(this, &RequestInterface::searchClicked); -- GitLab