mirror of
https://github.com/KDE/kasts.git
synced 2024-12-22 21:47:56 +01:00
Revert to using a Label for Entry Rendering :(
This commit is contained in:
parent
ca4a4de2e6
commit
17b4e39eb2
@ -18,7 +18,7 @@ include(KDEClangFormat)
|
||||
include(KDECMakeSettings)
|
||||
include(KDECompilerSettings NO_POLICY_SCOPE)
|
||||
|
||||
find_package(Qt5 ${QT_MIN_VERSION} REQUIRED NO_MODULE COMPONENTS Core Quick Test Gui QuickControls2 Sql WebView)
|
||||
find_package(Qt5 ${QT_MIN_VERSION} REQUIRED NO_MODULE COMPONENTS Core Quick Test Gui QuickControls2 Sql)
|
||||
find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS CoreAddons Syndication Config I18n)
|
||||
|
||||
if (ANDROID)
|
||||
@ -26,7 +26,7 @@ if (ANDROID)
|
||||
find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS Kirigami2)
|
||||
find_package(OpenSSL REQUIRED)
|
||||
else()
|
||||
find_package(Qt5 ${QT_MIN_VERSION} REQUIRED COMPONENTS Widgets WebEngine)
|
||||
find_package(Qt5 ${QT_MIN_VERSION} REQUIRED COMPONENTS Widgets)
|
||||
endif()
|
||||
|
||||
add_definitions(-DQT_NO_CAST_FROM_ASCII -DQT_NO_CAST_TO_ASCII -DQT_NO_URL_CAST_FROM_STRING)
|
||||
|
@ -13,7 +13,7 @@ set(alligator_SRCS
|
||||
kconfig_add_kcfg_files(alligator_SRCS alligatorsettings.kcfgc GENERATE_MOC)
|
||||
|
||||
add_executable(alligator ${alligator_SRCS})
|
||||
target_link_libraries(alligator PRIVATE Qt5::Core Qt5::Qml Qt5::Quick Qt5::Sql Qt5::WebView KF5::Syndication KF5::CoreAddons KF5::ConfigGui KF5::I18n)
|
||||
target_link_libraries(alligator PRIVATE Qt5::Core Qt5::Qml Qt5::Quick Qt5::Sql KF5::Syndication KF5::CoreAddons KF5::ConfigGui KF5::I18n)
|
||||
|
||||
if(ANDROID)
|
||||
target_link_libraries(alligator PRIVATE
|
||||
@ -35,7 +35,7 @@ if(ANDROID)
|
||||
globe
|
||||
)
|
||||
else()
|
||||
target_link_libraries(alligator PRIVATE Qt5::Widgets Qt5::WebEngine)
|
||||
target_link_libraries(alligator PRIVATE Qt5::Widgets)
|
||||
endif()
|
||||
|
||||
install(TARGETS alligator ${KF5_INSTALL_TARGETS_DEFAULT_ARGS})
|
||||
|
@ -25,7 +25,6 @@
|
||||
#endif
|
||||
|
||||
#include <QCommandLineParser>
|
||||
#include <QtWebView>
|
||||
#include <QQmlApplicationEngine>
|
||||
#include <QQmlContext>
|
||||
#include <QQuickView>
|
||||
@ -45,7 +44,6 @@ Q_DECL_EXPORT
|
||||
#endif
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
QtWebView::initialize();
|
||||
#ifdef Q_OS_ANDROID
|
||||
QGuiApplication app(argc, argv);
|
||||
#else
|
||||
|
@ -21,27 +21,26 @@
|
||||
import QtQuick 2.14
|
||||
import QtQuick.Controls 2.14 as Controls
|
||||
import QtQuick.Layouts 1.14
|
||||
import QtWebView 1.14
|
||||
|
||||
import org.kde.kirigami 2.12 as Kirigami
|
||||
|
||||
import org.kde.alligator 1.0
|
||||
|
||||
Kirigami.Page {
|
||||
Kirigami.ScrollablePage {
|
||||
id: page
|
||||
|
||||
property QtObject entry
|
||||
|
||||
property var content: "<style> img { max-width: 100%; } body { background: " + Kirigami.Theme.backgroundColor + "; font-family: " + Kirigami.Theme.defaultFont.family + "; } </style><body>" + page.entry.content + "</body>";
|
||||
|
||||
title: entry.title
|
||||
|
||||
WebView {
|
||||
id: webView
|
||||
anchors.fill: parent
|
||||
Component.onCompleted: {
|
||||
loadHtml(page.content, page.entry.baseUrl)
|
||||
}
|
||||
Controls.Label {
|
||||
//anchors.fill: parent
|
||||
text: page.entry.content
|
||||
baseUrl: page.entry.baseUrl
|
||||
textFormat: Text.RichText
|
||||
wrapMode: Text.WordWrap
|
||||
Layout.fillWidth: true
|
||||
onLinkActivated: Qt.openUrlExternally(link)
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user