void LocationBar::urlEnter() { const QUrl url = createUrl(); const QString urlString = convertUrlToText(url); m_completer.closePopup(); m_webView->setFocus(); if (urlString != text()) { setText(convertUrlToText(url)); } emit loadUrl(url); }
void LocationBar::showUrl(const QUrl &url) { if (hasFocus() || url.isEmpty()) { return; } const QString stringUrl = convertUrlToText(url); if (text() == stringUrl) { home(false); return; } // Set converted url as text setText(convertUrlToText(url)); // Move cursor to the start home(false); m_bookmarkIcon->checkBookmark(url); }
void LocationBar::focusInEvent(QFocusEvent* event) { if (m_webView) { const QString stringUrl = convertUrlToText(m_webView->url()); // Text has been edited, let's show go button if (stringUrl != text()) { setGoIconVisible(true); } } clearTextFormat(); LineEdit::focusInEvent(event); }
void LocationBar::requestLoadUrl() { const LoadRequest req = createLoadRequest(); const QString urlString = convertUrlToText(req.url()); m_completer->closePopup(); m_webView->setFocus(); if (urlString != text()) { setText(urlString); } m_webView->userLoadAction(req); }
void LocationBar::showUrl(const QUrl &url) { if (hasFocus() || url.isEmpty()) { return; } const QString &stringUrl = convertUrlToText(url); if (stringUrl == text()) { return; } setText(stringUrl); hideGoButton(); m_bookmarkIcon->checkBookmark(url); }
void LocationBar::loadRequest(const LoadRequest &request) { if (!m_webView->webTab()->isRestored()) { return; } const QString urlString = convertUrlToText(request.url()); m_completer->closePopup(); m_webView->setFocus(); if (urlString != text()) { setText(urlString); } m_webView->userLoadAction(request); }
void LocationBar::focusInEvent(QFocusEvent* event) { if (m_webView) { const QString stringUrl = convertUrlToText(m_webView->url()); // Text has been edited, let's show go button if (stringUrl != text()) { setGoIconVisible(true); } } clearTextFormat(); LineEdit::focusInEvent(event); if (Settings().value("Browser-View-Settings/instantBookmarksToolbar").toBool()) { m_window->bookmarksToolbar()->show(); } }