fix #810
This commit is contained in:
parent
1efefade23
commit
5d605f7365
@ -81,8 +81,8 @@ void TabWidget::showDownloadManager() {
|
||||
}
|
||||
|
||||
void TabWidget::checkTabBarVisibility() {
|
||||
const bool should_be_visible = count() > 1 ||
|
||||
!qApp->settings()->value(GROUP(GUI), SETTING(GUI::HideTabBarIfOnlyOneTab)).toBool();
|
||||
const bool should_be_visible =
|
||||
count() > 1 || !qApp->settings()->value(GROUP(GUI), SETTING(GUI::HideTabBarIfOnlyOneTab)).toBool();
|
||||
|
||||
if (should_be_visible) {
|
||||
setCornerWidget(m_btnMainMenu, Qt::Corner::TopLeftCorner);
|
||||
@ -123,8 +123,14 @@ void TabWidget::createConnections() {
|
||||
connect(tabBar(), &TabBar::tabCloseRequested, this, &TabWidget::closeTab);
|
||||
connect(tabBar(), &TabBar::tabMoved, this, &TabWidget::fixContentsAfterMove);
|
||||
|
||||
connect(feedMessageViewer()->messagesView(), &MessagesView::openMessagesInNewspaperView, this, &TabWidget::addNewspaperView);
|
||||
connect(feedMessageViewer()->feedsView(), &FeedsView::openMessagesInNewspaperView, this, &TabWidget::addNewspaperView);
|
||||
connect(feedMessageViewer()->messagesView(),
|
||||
&MessagesView::openMessagesInNewspaperView,
|
||||
this,
|
||||
&TabWidget::addNewspaperView);
|
||||
connect(feedMessageViewer()->feedsView(),
|
||||
&FeedsView::openMessagesInNewspaperView,
|
||||
this,
|
||||
&TabWidget::addNewspaperView);
|
||||
}
|
||||
|
||||
void TabWidget::initializeTabs() {
|
||||
@ -195,14 +201,12 @@ void TabWidget::closeCurrentTab() {
|
||||
|
||||
int TabWidget::addNewspaperView(RootItem* root, const QList<Message>& messages) {
|
||||
WebBrowser* browser = new WebBrowser(nullptr, this);
|
||||
|
||||
int index = addTab(browser,
|
||||
qApp->icons()->fromTheme(QSL("format-justify-fill")),
|
||||
tr("Newspaper view"),
|
||||
TabBar::TabType::Closable);
|
||||
|
||||
// NOTE: Do not bring "newspaper" tabs to front anymore.
|
||||
//setCurrentIndex(index);
|
||||
|
||||
QTimer::singleShot(300, browser, [browser, root, messages]() {
|
||||
browser->loadMessages(messages, root);
|
||||
});
|
||||
@ -232,14 +236,16 @@ int TabWidget::addBrowser(bool move_after_current, bool make_active, WebBrowser*
|
||||
|
||||
if (move_after_current) {
|
||||
// Insert web browser after current tab.
|
||||
final_index = insertTab(currentIndex() + 1, browser, qApp->icons()->fromTheme(QSL("text-html")),
|
||||
browser_tab_name, TabBar::TabType::Closable);
|
||||
final_index = insertTab(currentIndex() + 1,
|
||||
browser,
|
||||
qApp->icons()->fromTheme(QSL("text-html")),
|
||||
browser_tab_name,
|
||||
TabBar::TabType::Closable);
|
||||
}
|
||||
else {
|
||||
// Add new browser as the last tab.
|
||||
final_index = addTab(browser, qApp->icons()->fromTheme(QSL("text-html")),
|
||||
browser_tab_name,
|
||||
TabBar::TabType::Closable);
|
||||
final_index =
|
||||
addTab(browser, qApp->icons()->fromTheme(QSL("text-html")), browser_tab_name, TabBar::TabType::Closable);
|
||||
}
|
||||
|
||||
// Make connections.
|
||||
|
@ -152,8 +152,6 @@ void WebBrowser::loadMessages(const QList<Message>& messages, RootItem* root) {
|
||||
if (!m_root.isNull()) {
|
||||
m_searchWidget->hide();
|
||||
m_webView->loadMessages(messages, root);
|
||||
|
||||
show();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -67,7 +67,7 @@ int TextFactory::stringWidth(const QString& string, const QFontMetrics& metrics)
|
||||
bool TextFactory::couldBeHtml(const QString& string) {
|
||||
const QString sstring = string.simplified();
|
||||
|
||||
return sstring.startsWith(QL1S("<!")) || Qt::mightBeRichText(sstring);
|
||||
return sstring.startsWith(QL1S("<!")) || sstring.startsWith(QL1S("<figure")) || Qt::mightBeRichText(sstring);
|
||||
}
|
||||
|
||||
QDateTime TextFactory::parseDateTime(const QString& date_time) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user