void LocationBar::textEditted() { if (!text().isEmpty()) { m_completer->complete(text()); } else { m_completer->closePopup(); } setGoIconVisible(true); }
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::textEdited(const QString &text) { m_oldTextLength = m_currentTextLength; m_currentTextLength = text.length(); if (!text.isEmpty()) { m_completer->complete(text); } else { m_completer->closePopup(); } setGoIconVisible(true); }
void LocationBar::textEdited(const QString &text) { m_oldTextLength = m_currentTextLength; m_currentTextLength = text.length(); if (!text.isEmpty()) { m_completer->complete(text); m_siteIcon->setIcon(QIcon::fromTheme(QSL("edit-find"), QIcon(QSL(":icons/menu/search-icon.svg")))); } else { m_completer->closePopup(); } setGoIconVisible(true); }
void LocationBar::focusOutEvent(QFocusEvent* event) { // Context menu or completer popup were opened // Let's block focusOutEvent to trick QLineEdit and paint cursor properly if (event->reason() == Qt::PopupFocusReason) { return; } LineEdit::focusOutEvent(event); setGoIconVisible(false); if (text().trimmed().isEmpty()) { clear(); } refreshTextFormat(); }
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(); } }
void LocationBar::focusOutEvent(QFocusEvent* event) { // Context menu or completer popup were opened // Let's block focusOutEvent to trick QLineEdit and paint cursor properly if (event->reason() == Qt::PopupFocusReason) { return; } LineEdit::focusOutEvent(event); setGoIconVisible(false); if (text().trimmed().isEmpty()) { clear(); } refreshTextFormat(); if (Settings().value("Browser-View-Settings/instantBookmarksToolbar").toBool()) { m_window->bookmarksToolbar()->hide(); } }