Compare commits
3
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3e34afe8a1 | ||
|
|
a9f7d9c770 | ||
|
|
5d85acecf4 |
@@ -24,7 +24,7 @@ jobs:
|
||||
SHA256=$(sha256sum source.tar.gz | awk '{print $1}')
|
||||
|
||||
cat << 'EOF' > PKGBUILD
|
||||
# Maintainer: Uyanide <me@uyani.de>
|
||||
# Maintainer: Uyanide <pywang0608@foxmail.com>
|
||||
pkgname=wallreel
|
||||
pkgver=${{ env.VERSION }}
|
||||
pkgrel=1
|
||||
@@ -34,6 +34,7 @@ jobs:
|
||||
license=('MIT')
|
||||
depends=('qt6-base' 'qt6-declarative' 'gcc-libs' 'glibc')
|
||||
makedepends=('cmake')
|
||||
optdepends=('qqc2-desktop-style: native Plasma look and feel')
|
||||
options=('!debug')
|
||||
source=("${pkgname}-${pkgver}.tar.gz::https://git.uyani.de/Uyanide/WallReel/archive/v${pkgver}.tar.gz")
|
||||
sha256sums=('INSERT_SHA256_HERE')
|
||||
@@ -150,7 +151,7 @@ jobs:
|
||||
cd aur-repo
|
||||
|
||||
cat << 'EOF' > LICENSE
|
||||
Copyright (C) 2026 by Uyanide me@uyani.de
|
||||
Copyright (C) 2026 by Uyanide pywang0608@foxmail.com
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted.
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Copyright 2026 Uyanide me@uyani.de
|
||||
Copyright 2026 Uyanide pywang0608@foxmail.com
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
|
||||
+31
-3
@@ -1,8 +1,8 @@
|
||||
#include <qobject.h>
|
||||
|
||||
#include <QApplication>
|
||||
#include <QFileInfo>
|
||||
#include <QQmlApplicationEngine>
|
||||
#include <QQmlContext>
|
||||
#include <QQuickStyle>
|
||||
#include <QSocketNotifier>
|
||||
|
||||
extern "C" {
|
||||
@@ -21,6 +21,26 @@ using namespace WallReel::Core;
|
||||
|
||||
WALLREEL_DECLARE_SENDER("Main")
|
||||
|
||||
static QString pickControlsStyle(const QQmlApplicationEngine& engine) {
|
||||
// Respect env
|
||||
if (!qEnvironmentVariableIsEmpty("QT_QUICK_CONTROLS_STYLE"))
|
||||
return {};
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 4, 0)
|
||||
using namespace Qt::StringLiterals;
|
||||
// Prefer KDE style if available,
|
||||
for (const QString& p : engine.importPathList())
|
||||
if (QFileInfo::exists(p + u"/org/kde/desktop/qmldir"_s))
|
||||
return u"org.kde.desktop"_s;
|
||||
// fallback to Fusion
|
||||
return u"Fusion"_s;
|
||||
#else
|
||||
for (const QString& p : engine.importPathList())
|
||||
if (QFileInfo::exists(p + u"/org/kde/desktop/qmldir"_qs))
|
||||
return u"org.kde.desktop"_qs;
|
||||
return u"Fusion"_qs;
|
||||
#endif
|
||||
}
|
||||
|
||||
int main(int argc, char* argv[]) {
|
||||
// Destruction order after QApplication quits its event loop:
|
||||
// 1. QQmlApplicationEngine (with all QML objects)
|
||||
@@ -46,12 +66,14 @@ int main(int argc, char* argv[]) {
|
||||
QApplication a(argc, argv);
|
||||
a.setApplicationName(APP_NAME);
|
||||
a.setApplicationVersion(APP_VERSION);
|
||||
{
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 4, 0)
|
||||
using namespace Qt::StringLiterals;
|
||||
a.setWindowIcon(QIcon(u":/icon.svg"_s));
|
||||
#else
|
||||
a.setWindowIcon(QIcon(u":/%1.svg"_qs.arg(APP_NAME)));
|
||||
a.setWindowIcon(QIcon(u":/icon.svg"_qs));
|
||||
#endif
|
||||
}
|
||||
|
||||
{
|
||||
Logger::init();
|
||||
@@ -105,6 +127,10 @@ int main(int argc, char* argv[]) {
|
||||
{
|
||||
QQmlApplicationEngine engine;
|
||||
|
||||
if (const QString s = pickControlsStyle(engine); !s.isEmpty()) {
|
||||
QQuickStyle::setStyle(s);
|
||||
}
|
||||
|
||||
QObject::connect(
|
||||
&engine,
|
||||
&QQmlApplicationEngine::objectCreationFailed,
|
||||
@@ -112,6 +138,7 @@ int main(int argc, char* argv[]) {
|
||||
[]() { QCoreApplication::exit(-1); },
|
||||
Qt::QueuedConnection);
|
||||
|
||||
{
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 5, 0)
|
||||
using namespace Qt::StringLiterals;
|
||||
engine.loadFromModule(UIMODULE_URI, u"Main"_s);
|
||||
@@ -119,6 +146,7 @@ int main(int argc, char* argv[]) {
|
||||
engine.addImportPath(u"qrc:/"_qs);
|
||||
engine.load(QUrl(u"qrc:/WallReel/UI/Main.qml"_qs));
|
||||
#endif
|
||||
}
|
||||
|
||||
bootstrap.start();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user