poc newspaper

This commit is contained in:
Martin Rotter 2022-03-26 09:00:49 +01:00
parent 03ce10cbdf
commit d48309cd17
3 changed files with 13 additions and 34 deletions

View File

@ -505,12 +505,6 @@ if(NOT USE_WEBENGINE)
) )
endif() endif()
if(APPLE)
list(APPEND SOURCES
miscellaneous/disablewindowtabbing.mm
)
endif()
set(UI_FILES set(UI_FILES
gui/dialogs/formabout.ui gui/dialogs/formabout.ui
gui/dialogs/formaddaccount.ui gui/dialogs/formaddaccount.ui
@ -685,6 +679,7 @@ target_include_directories(rssguard
# QLiteHtml. # QLiteHtml.
if(NOT USE_WEBENGINE) 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)
target_include_directories(rssguard PRIVATE 3rd-party/qlitehtml/3rdparty/litehtml/src/gumbo/include/gumbo) 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) target_include_directories(rssguard PRIVATE 3rd-party/qlitehtml/3rdparty/litehtml/src/gumbo/visualc/include)
endif() endif()
# LiteHtml.
target_include_directories(rssguard PRIVATE 3rd-party/qlitehtml/3rdparty/litehtml/src) 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)
target_include_directories(rssguard PRIVATE 3rd-party/qlitehtml/3rdparty/litehtml/include/litehtml) 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) target_compile_definitions(rssguard PUBLIC LITEHTML_UTF8)
endif() endif()
# QLiteHtml.
target_include_directories(rssguard PRIVATE 3rd-party/qlitehtml) target_include_directories(rssguard PRIVATE 3rd-party/qlitehtml)
target_compile_definitions(rssguard target_compile_definitions(rssguard

View File

@ -17,6 +17,7 @@
#include "network-web/webfactory.h" #include "network-web/webfactory.h"
#include <QMenu> #include <QMenu>
#include <QTimer>
#include <QToolButton> #include <QToolButton>
TabWidget::TabWidget(QWidget* parent) : QTabWidget(parent), m_menuMain(nullptr) { TabWidget::TabWidget(QWidget* parent) : QTabWidget(parent), m_menuMain(nullptr) {
@ -185,28 +186,20 @@ void TabWidget::closeCurrentTab() {
} }
int TabWidget::addNewspaperView(RootItem* root, const QList<Message>& messages) { int TabWidget::addNewspaperView(RootItem* root, const QList<Message>& messages) {
// TODO: dodělat WebBrowser* browser = new WebBrowser(this);
int index = addTab(browser,
/*
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,
qApp->icons()->fromTheme(QSL("format-justify-fill")), qApp->icons()->fromTheme(QSL("format-justify-fill")),
tr("Newspaper view"), tr("Newspaper view"),
TabBar::TabType::Closable); TabBar::TabType::Closable);
// NOTE: Do not bring "newspaper" tabs to front anymore. // NOTE: Do not bring "newspaper" tabs to front anymore.
//setCurrentIndex(index); //setCurrentIndex(index);
return index; QTimer::singleShot(300, browser, [browser, root, messages]() {
*/ browser->loadMessages(messages, root);
return -1; });
return index;
} }
int TabWidget::addEmptyBrowser() { int TabWidget::addEmptyBrowser() {

View File

@ -1,11 +0,0 @@
#import <AppKit/AppKit.h>
// 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;
//}
}