Support enter key in some text boxes as button click that matches.
This commit is contained in:
@@ -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:"));
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user