1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 02:37:35 +00:00

Ladybird: Simplify the LocationEdit constructor

This commit is contained in:
Cameron Youell 2023-05-29 19:05:49 +10:00 committed by Sam Atkins
parent 0da5af0eff
commit c53d3e7aa4

View file

@ -18,13 +18,8 @@ LocationEdit::LocationEdit(QWidget* parent)
: QLineEdit(parent) : QLineEdit(parent)
{ {
setPlaceholderText("Enter web address"); setPlaceholderText("Enter web address");
connect(this, &QLineEdit::returnPressed, this, [&] { connect(this, &QLineEdit::editingFinished, this, &LocationEdit::clearFocus);
clearFocus(); connect(this, &QLineEdit::textChanged, this, &LocationEdit::highlight_location);
});
connect(this, &QLineEdit::textChanged, this, [&] {
highlight_location();
});
} }
void LocationEdit::focusInEvent(QFocusEvent* event) void LocationEdit::focusInEvent(QFocusEvent* event)