diff options
author | Peter Elliott <pelliott@ualberta.ca> | 2020-09-20 12:43:44 -0700 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-09-21 20:15:10 +0200 |
commit | 7907df76175717d5288457fc18c36b01f96815cc (patch) | |
tree | fa565201bb404ed3a670e69625893397c5690331 /Applications | |
parent | fa96e57c156193566dafe00116933dd8a8d80c7f (diff) | |
download | serenity-7907df76175717d5288457fc18c36b01f96815cc.zip |
Applications: Use placeholders in TextBoxes where applicable
Diffstat (limited to 'Applications')
-rw-r--r-- | Applications/Browser/Tab.cpp | 1 | ||||
-rw-r--r-- | Applications/Help/main.cpp | 15 | ||||
-rw-r--r-- | Applications/IRCClient/IRCWindow.cpp | 1 |
3 files changed, 3 insertions, 14 deletions
diff --git a/Applications/Browser/Tab.cpp b/Applications/Browser/Tab.cpp index 9c7dca6314..c9c63b2005 100644 --- a/Applications/Browser/Tab.cpp +++ b/Applications/Browser/Tab.cpp @@ -103,6 +103,7 @@ Tab::Tab(Type type) m_location_box = toolbar.add<GUI::TextBox>(); m_location_box->set_size_policy(GUI::SizePolicy::Fill, GUI::SizePolicy::Fixed); m_location_box->set_preferred_size(0, 22); + m_location_box->set_placeholder("Address"); m_location_box->on_return_pressed = [this] { auto url = url_from_user_input(m_location_box->text()); diff --git a/Applications/Help/main.cpp b/Applications/Help/main.cpp index 97aad02f30..d48ce1bf55 100644 --- a/Applications/Help/main.cpp +++ b/Applications/Help/main.cpp @@ -122,11 +122,7 @@ int main(int argc, char* argv[]) auto& search_list_view = search_view.add<GUI::ListView>(); search_box.set_preferred_size(0, 20); search_box.set_size_policy(GUI::SizePolicy::Fill, GUI::SizePolicy::Fixed); - search_box.set_text("Search..."); - search_box.on_focusin = [&] { - if (search_box.text() == "Search...") - search_box.set_text(""); - }; + search_box.set_placeholder("Search..."); search_box.on_change = [&] { if (auto model = search_list_view.model()) { auto& search_model = *static_cast<GUI::FilteringProxyModel*>(model); @@ -134,15 +130,6 @@ int main(int argc, char* argv[]) search_model.update(); } }; - search_box.on_focusout = [&] { - if (search_box.text().is_empty()) { - if (auto model = search_list_view.model()) { - auto& search_model = *static_cast<GUI::FilteringProxyModel*>(model); - search_model.set_filter_term(""); - } - search_box.set_text("Search..."); - } - }; search_list_view.set_model(GUI::FilteringProxyModel::construct(model)); search_list_view.model()->update(); diff --git a/Applications/IRCClient/IRCWindow.cpp b/Applications/IRCClient/IRCWindow.cpp index df5fdc09f3..777e0ad223 100644 --- a/Applications/IRCClient/IRCWindow.cpp +++ b/Applications/IRCClient/IRCWindow.cpp @@ -202,6 +202,7 @@ IRCWindow::IRCWindow(IRCClient& client, void* owner, Type type, const String& na m_text_box->clear(); }; m_text_box->set_history_enabled(true); + m_text_box->set_placeholder("Message"); m_client->register_subwindow(*this); } |