Commit 48e85d43 authored by Harald Sitter's avatar Harald Sitter 🏳️‍🌈
Browse files

make sure we use the desktop style

On Plasma qqc2-desktop-style is used automatically, but not on other
DEs. Set it as a default and allow overriding it via environment
variables.

Also add it as a runtime dep so distros actually ship it.

(cheekly inspired by other qml apps)
parent 058c033d
Pipeline #186068 passed with stage
in 2 minutes and 25 seconds
......@@ -39,7 +39,7 @@ include(KDEClangFormat)
include(KDEGitCommitHooks)
include(ECMFindQmlModule)
find_package(Qt${QT_MAJOR_VERSION} ${QT_REQUIRED_VERSION} CONFIG REQUIRED Core Widgets Svg Quick)
find_package(Qt${QT_MAJOR_VERSION} ${QT_REQUIRED_VERSION} CONFIG REQUIRED Core Widgets Svg Quick QuickControls2)
find_package(KF5 ${KF5_MIN_VERSION} REQUIRED
XmlGui # For app
KIO # For part
......@@ -49,6 +49,9 @@ find_package(KF5 ${KF5_MIN_VERSION} REQUIRED
)
find_package(KF5DocTools) # Optional, not needed on Windows for example.
find_package(KF5QQC2DesktopStyle ${KF5_MIN_VERSION})
set_package_properties(KF5QQC2DesktopStyle PROPERTIES TYPE RUNTIME)
ecm_find_qmlmodule(org.kde.kirigami 2.19)
ecm_find_qmlmodule(org.kde.quickcharts 1.0)
......
#######################################################################
# SPDX-FileCopyrightText: 2008-2014 Martin Sandsmark <martin.sandsmark@kde.org>
# SPDX-FileCopyrightText: 2017 Harald Sitter <sitter@kde.org>
# SPDX-FileCopyrightText: 2017-2022 Harald Sitter <sitter@kde.org>
#
# SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
#######################################################################
......@@ -67,6 +67,7 @@ target_link_libraries(filelight
KF5::Declarative
Qt${QT_MAJOR_VERSION}::Svg
Qt${QT_MAJOR_VERSION}::Quick
Qt${QT_MAJOR_VERSION}::QuickControls2
filelightInternal
)
if (WIN32)
......
......@@ -12,6 +12,7 @@
#include <QApplication>
#include <QCommandLineParser>
#include <QDir>
#include <QQuickStyle>
#include <QUrl>
#include <KAboutData>
......@@ -30,6 +31,10 @@ int main(int argc, char *argv[])
#endif
QApplication app(argc, argv);
if (qEnvironmentVariableIsEmpty("QT_QUICK_CONTROLS_STYLE")) {
QQuickStyle::setStyle(QStringLiteral("org.kde.desktop"));
}
KLocalizedString::setApplicationDomain("filelight");
auto config = KSharedConfig::openConfig();
auto stateConfig = KSharedConfig::openStateConfig();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment