Custom displaying of navigation toolbar in message preview mode.

This commit is contained in:
Martin Rotter 2014-11-13 18:26:07 +01:00
parent addad0af31
commit c5535fad4d
4 changed files with 10 additions and 14 deletions

View File

@ -8,6 +8,7 @@ Fixed:
Added: Added:
<ul> <ul>
<li>Embedded web browser now displays navigation toolbar even in message preview mode/newspaper mode when user loads external links.</li>
</ul> </ul>
<hr/> <hr/>

View File

@ -303,10 +303,8 @@ int TabWidget::addBrowser(bool move_after_current,
} }
// Make connections. // Make connections.
connect(browser, SIGNAL(titleChanged(int,QString)), connect(browser, SIGNAL(titleChanged(int,QString)), this, SLOT(changeTitle(int,QString)));
this, SLOT(changeTitle(int,QString))); connect(browser, SIGNAL(iconChanged(int,QIcon)), this, SLOT(changeIcon(int,QIcon)));
connect(browser, SIGNAL(iconChanged(int,QIcon)),
this, SLOT(changeIcon(int,QIcon)));
// Setup the tab index. // Setup the tab index.
browser->setIndex(final_index); browser->setIndex(final_index);

View File

@ -48,11 +48,7 @@ WebBrowser::WebBrowser(QWidget *parent)
m_actionBack(m_webView->pageAction(QWebPage::Back)), m_actionBack(m_webView->pageAction(QWebPage::Back)),
m_actionForward(m_webView->pageAction(QWebPage::Forward)), m_actionForward(m_webView->pageAction(QWebPage::Forward)),
m_actionReload(m_webView->pageAction(QWebPage::Reload)), m_actionReload(m_webView->pageAction(QWebPage::Reload)),
m_actionStop(m_webView->pageAction(QWebPage::Stop)), m_actionStop(m_webView->pageAction(QWebPage::Stop)) {
m_activeNewspaperMode(false) {
m_index = -1;
// Add this new instance to the global list of web browsers. // Add this new instance to the global list of web browsers.
// NOTE: This is used primarily for dynamic icon theme switching. // NOTE: This is used primarily for dynamic icon theme switching.
m_runningWebBrowsers.append(this); m_runningWebBrowsers.append(this);
@ -204,7 +200,10 @@ void WebBrowser::onTitleChanged(const QString &new_title) {
} }
void WebBrowser::updateUrl(const QUrl &url) { void WebBrowser::updateUrl(const QUrl &url) {
m_txtLocation->setText(url.toString()); QString url_string = url.toString();
m_txtLocation->setText(url_string);
setNavigationBarVisible(url_string != "rssguard:empty" && url_string != INTERNAL_URL_NEWSPAPER);
} }
void WebBrowser::navigateToUrl(const QUrl &url) { void WebBrowser::navigateToUrl(const QUrl &url) {

View File

@ -97,7 +97,7 @@ class WebBrowser : public TabContent {
// Clears contents. // Clears contents.
inline void clear() { inline void clear() {
if (m_webView->url() != QUrl()) { if (m_webView->url() != QUrl()) {
m_webView->setHtml("<html><body></body></html>", QUrl()); m_webView->setHtml("<html><body></body></html>", QUrl("rssguard:empty"));
} }
} }
@ -158,8 +158,6 @@ class WebBrowser : public TabContent {
QAction *m_actionReload; QAction *m_actionReload;
QAction *m_actionStop; QAction *m_actionStop;
bool m_activeNewspaperMode;
static QList<WebBrowser*> m_runningWebBrowsers; static QList<WebBrowser*> m_runningWebBrowsers;
}; };