mirror of
https://invent.kde.org/network/falkon.git
synced 2024-12-20 10:46:35 +01:00
Pressing ESC in LocationBar now fill it with address from current tab
This commit is contained in:
parent
a8881c1d73
commit
23bebb3b9d
@ -215,10 +215,17 @@ void LocationBar::clearIcon()
|
||||
|
||||
void LocationBar::setPrivacy(bool state)
|
||||
{
|
||||
QString img;
|
||||
if (state)
|
||||
m_siteIcon->setStyleSheet("QToolButton{border-image: url(:/icons/locationbar/safeline.png); margin-left:2px;}");
|
||||
img = "safeline.png";
|
||||
else
|
||||
m_siteIcon->setStyleSheet("QToolButton{border-image: url(:/icons/locationbar/searchchoose.png); margin-left:2px;}");
|
||||
img = "searchchoose.png";
|
||||
|
||||
#if QT_VERSION == 0x040800
|
||||
m_siteIcon->setStyleSheet("QToolButton{border-image: url(:/icons/locationbar/"+img+"); margin-left:2px; padding-left: 4px; }");
|
||||
#else
|
||||
m_siteIcon->setStyleSheet("QToolButton{border-image: url(:/icons/locationbar/"+img+"); margin-left:2px;}");
|
||||
#endif
|
||||
}
|
||||
|
||||
void LocationBar::focusOutEvent(QFocusEvent* e)
|
||||
@ -242,7 +249,7 @@ void LocationBar::dropEvent(QDropEvent* event)
|
||||
}
|
||||
}
|
||||
else if (event->mimeData()->hasText()) {
|
||||
QUrl dropUrl = QUrl(event->mimeData()->text());
|
||||
QUrl dropUrl = QUrl(event->mimeData()->text().trimmed());
|
||||
if (WebView::isUrlValid(dropUrl)) {
|
||||
setText(dropUrl.toString());
|
||||
p_QupZilla->loadAddress(dropUrl);
|
||||
|
@ -34,6 +34,7 @@ WebTab::WebTab(QupZilla* mainClass, LocationBar* locationBar)
|
||||
m_layout->setSpacing(0);
|
||||
|
||||
m_view = new WebView(p_QupZilla, this);
|
||||
m_view->setLocationBar(locationBar);
|
||||
m_layout->addWidget(m_view);
|
||||
|
||||
setLayout(m_layout);
|
||||
|
@ -569,6 +569,18 @@ void WebView::contextMenuEvent(QContextMenuEvent* event)
|
||||
QWebView::contextMenuEvent(event);
|
||||
}
|
||||
|
||||
void WebView::stop()
|
||||
{
|
||||
if (page()) {
|
||||
emit ipChanged(m_currentIp);
|
||||
page()->triggerAction(QWebPage::Stop);
|
||||
loadFinished(true);
|
||||
|
||||
if (m_locationBar->text().isEmpty())
|
||||
m_locationBar->setText(url().toEncoded());
|
||||
}
|
||||
}
|
||||
|
||||
void WebView::addNotification(QWidget* notif)
|
||||
{
|
||||
emit showNotification(notif);
|
||||
|
@ -69,7 +69,7 @@ public:
|
||||
int tabIndex() const;
|
||||
|
||||
public slots:
|
||||
void stop(){ if (page()) {emit ipChanged(m_currentIp); page()->triggerAction(QWebPage::Stop); loadFinished(true);} }
|
||||
void stop();
|
||||
void back(){ if (page()) {emit ipChanged(m_currentIp); page()->triggerAction(QWebPage::Back);} }
|
||||
void forward(){ if (page()) {emit ipChanged(m_currentIp); page()->triggerAction(QWebPage::Forward);} }
|
||||
void slotReload(){ if (page()) {emit ipChanged(m_currentIp); page()->triggerAction(QWebPage::Reload);} }
|
||||
|
Loading…
Reference in New Issue
Block a user