diff --git a/src/app/browser/main/tab/data/navbar.cpp b/src/app/browser/main/tab/data/navbar.cpp index 38804589..2283e9f8 100644 --- a/src/app/browser/main/tab/data/navbar.cpp +++ b/src/app/browser/main/tab/data/navbar.cpp @@ -5,6 +5,8 @@ #include "navbar/request.hpp" #include "navbar/update.hpp" +#include "../../../../../lib/url.hpp" + using namespace app::browser::main::tab::data; Navbar::Navbar() @@ -88,9 +90,24 @@ Navbar::~Navbar() = default; // Actions void Navbar::refresh() { - // Deactivate on request value is empty + // Detect request has value + bool has_request = request->get_text_length(); + + // Toggle base button sensibility + auto url = new ::lib::Url( + request->get_text() + ); + + base->set_sensitive( + has_request && !url->host.empty() + && !url->path.empty() + ); + + delete url; + + // Toggle update button sensibility update->set_sensitive( - (bool) request->get_text_length() + has_request ); }