diff --git a/src/librssguard/CMakeLists.txt b/src/librssguard/CMakeLists.txt index c7ecbbe62..7e993ac7d 100644 --- a/src/librssguard/CMakeLists.txt +++ b/src/librssguard/CMakeLists.txt @@ -505,12 +505,6 @@ if(NOT USE_WEBENGINE) ) endif() -if(APPLE) - list(APPEND SOURCES - miscellaneous/disablewindowtabbing.mm - ) -endif() - set(UI_FILES gui/dialogs/formabout.ui gui/dialogs/formaddaccount.ui @@ -685,6 +679,7 @@ target_include_directories(rssguard # QLiteHtml. if(NOT USE_WEBENGINE) + # Gumbo. target_include_directories(rssguard PRIVATE 3rd-party/qlitehtml/3rdparty/litehtml/src/gumbo/include) target_include_directories(rssguard PRIVATE 3rd-party/qlitehtml/3rdparty/litehtml/src/gumbo/include/gumbo) @@ -692,6 +687,7 @@ if(NOT USE_WEBENGINE) target_include_directories(rssguard PRIVATE 3rd-party/qlitehtml/3rdparty/litehtml/src/gumbo/visualc/include) endif() + # LiteHtml. target_include_directories(rssguard PRIVATE 3rd-party/qlitehtml/3rdparty/litehtml/src) target_include_directories(rssguard PRIVATE 3rd-party/qlitehtml/3rdparty/litehtml/include) target_include_directories(rssguard PRIVATE 3rd-party/qlitehtml/3rdparty/litehtml/include/litehtml) @@ -700,6 +696,7 @@ if(NOT USE_WEBENGINE) target_compile_definitions(rssguard PUBLIC LITEHTML_UTF8) endif() + # QLiteHtml. target_include_directories(rssguard PRIVATE 3rd-party/qlitehtml) target_compile_definitions(rssguard diff --git a/src/librssguard/gui/tabwidget.cpp b/src/librssguard/gui/tabwidget.cpp index 47fbbd0e2..e31b7b5e1 100644 --- a/src/librssguard/gui/tabwidget.cpp +++ b/src/librssguard/gui/tabwidget.cpp @@ -17,6 +17,7 @@ #include "network-web/webfactory.h" #include +#include #include TabWidget::TabWidget(QWidget* parent) : QTabWidget(parent), m_menuMain(nullptr) { @@ -185,28 +186,20 @@ void TabWidget::closeCurrentTab() { } int TabWidget::addNewspaperView(RootItem* root, const QList& messages) { - // TODO: dodělat - - /* - int msg_height = height() - tabBar()->height() - 50; - NewspaperPreviewer* prev = new NewspaperPreviewer(msg_height, root, messages, this); - - connect(prev, &NewspaperPreviewer::markMessageRead, - m_feedMessageViewer->messagesView()->sourceModel(), &MessagesModel::setMessageReadById); - connect(prev, &NewspaperPreviewer::markMessageImportant, - m_feedMessageViewer->messagesView()->sourceModel(), &MessagesModel::setMessageImportantById); - - int index = addTab(prev, + WebBrowser* browser = new WebBrowser(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); + // NOTE: Do not bring "newspaper" tabs to front anymore. + //setCurrentIndex(index); - return index; - */ - return -1; + QTimer::singleShot(300, browser, [browser, root, messages]() { + browser->loadMessages(messages, root); + }); + + return index; } int TabWidget::addEmptyBrowser() { diff --git a/src/librssguard/miscellaneous/disablewindowtabbing.mm b/src/librssguard/miscellaneous/disablewindowtabbing.mm deleted file mode 100644 index 99b2d9dcb..000000000 --- a/src/librssguard/miscellaneous/disablewindowtabbing.mm +++ /dev/null @@ -1,11 +0,0 @@ - -#import - -// Disables auto window tabbing where supported, otherwise a no-op. -// See http://lists.qt-project.org/pipermail/interest/2016-September/024488.html -void disableWindowTabbing() -{ - //if ([NSWindow respondsToSelector:@selector(allowsAutomaticWindowTabbing)]) { - // NSWindow.allowsAutomaticWindowTabbing = NO; - //} -}