Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions misc/dconfig/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
install(FILES
"org.deepin.dde.treeland.json"
"org.deepin.dde.treeland.app.json"
"org.deepin.dde.treeland.user.json"
"org.deepin.dde.treeland.output.json"
DESTINATION "${CMAKE_INSTALL_DATADIR}/dsg/configs/org.deepin.dde.treeland"
Expand Down
72 changes: 72 additions & 0 deletions misc/dconfig/org.deepin.dde.treeland.app.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
{
"magic": "dsg.config.meta",
"version": "1.0",
"contents": {
"enablePrelaunchSplash": {
"value": true,
"serial": 0,
"flags": ["global"],
"name": "Enable Prelaunch Splash",
"name[zh_CN]": "启用预启动闪屏",
"description": "Whether to show prelaunch splash for this app",
"description[zh_CN]": "是否为此应用显示预启动闪屏",
"permissions": "readwrite",
"visibility": "public"
},
"lastWindowWidth": {
"value": 800,
"serial": 0,
"flags": ["global"],
"name": "Last Window Width",
"name[zh_CN]": "上次关闭时的窗口宽度",
"description": "Window width saved when the window was last closed",
"description[zh_CN]": "记录窗口上次关闭时的宽度",
"permissions": "readwrite",
"visibility": "public"
},
"lastWindowHeight": {
"value": 600,
"serial": 0,
"flags": ["global"],
"name": "Last Window Height",
"name[zh_CN]": "上次关闭时的窗口高度",
"description": "Window height saved when the window was last closed",
"description[zh_CN]": "记录窗口上次关闭时的高度",
"permissions": "readwrite",
"visibility": "public"
},
"splashThemeType": {
"value": 0,
"serial": 0,
"flags": ["global"],
"name": "Splash Theme Type",
"name[zh_CN]": "闪屏主题类型",
"description": "Splash theme preference: 0 follow system, 1 light, 2 dark",
"description[zh_CN]": "闪屏主题偏好:0 跟随系统,1 亮色,2 暗色",
"permissions": "readwrite",
"visibility": "public"
},
"splashDarkPalette": {
"value": "#181818",
"serial": 0,
"flags": ["global"],
"name": "Splash Dark Palette",
"name[zh_CN]": "闪屏暗色配色",
"description": "Background color used when splash theme is dark",
"description[zh_CN]": "闪屏使用暗色主题时的背景色",
"permissions": "readwrite",
"visibility": "public"
},
"splashLightPalette": {
"value": "#FFFFFF",
"serial": 0,
"flags": ["global"],
"name": "Splash Light Palette",
"name[zh_CN]": "闪屏亮色配色",
"description": "Background color used when splash theme is light",
"description[zh_CN]": "闪屏使用亮色主题时的背景色",
"permissions": "readwrite",
"visibility": "public"
}
}
}
6 changes: 3 additions & 3 deletions misc/dconfig/org.deepin.dde.treeland.user.json
Original file line number Diff line number Diff line change
Expand Up @@ -234,13 +234,13 @@
"visibility": "public"
},
"windowThemeType": {
"value": 0,
"value": 1,
"serial": 0,
"flags": ["global"],
"name": "Global Window Theme Type",
"name[zh_CN]": "全局窗口主题类型",
"description": "Set all window theme type",
"description[zh_CN]": "设置所有窗口的主题类型",
"description": "System theme type: 1 light, 2 dark",
"description[zh_CN]": "系统主题类型:1 亮色,2 暗色",
"permissions": "readwrite",
"visibility": "public"
},
Expand Down
11 changes: 10 additions & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,13 @@ dtk_add_config_to_cpp(
CLASS_NAME "OutputConfig"
)

dtk_add_config_to_cpp(
APP_CONFIG
"${PROJECT_SOURCE_DIR}/misc/dconfig/org.deepin.dde.treeland.app.json"
OUTPUT_FILE_NAME "appconfig.hpp"
CLASS_NAME "AppConfig"
)

qt_add_library(libtreeland SHARED)

set_target_properties(libtreeland PROPERTIES
Expand All @@ -104,6 +111,7 @@ qt_add_qml_module(libtreeland
${TREELAND_CONFIG}
${TREELAND_USER_CONFIG}
${OUTPUT_CONFIG}
${APP_CONFIG}
common/treelandlogging.cpp
common/treelandlogging.h
core/layersurfacecontainer.cpp
Expand All @@ -120,7 +128,8 @@ qt_add_qml_module(libtreeland
core/treeland.h
core/windowpicker.cpp
core/windowpicker.h
core/windowsizestore.h
core/windowconfigstore.cpp
core/windowconfigstore.h
effects/tquickradiuseffect.cpp
effects/tquickradiuseffect.h
effects/tquickradiuseffect_p.h
Expand Down
3 changes: 2 additions & 1 deletion src/core/qml/PrelaunchSplash.qml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ Item {

required property real initialRadius
property var iconBuffer
required property color backgroundColor
property bool destroyAfterFade: false
signal destroyRequested

Expand All @@ -19,7 +20,7 @@ Item {

Rectangle {
id: background
color: "#ffffff" // TODO(rewine): Use theme color if available
color: splash.backgroundColor
anchors.fill: parent
radius: initialRadius

Expand Down
23 changes: 15 additions & 8 deletions src/core/qmlengine.cpp
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
// Copyright (C) 2024 UnionTech Software Technology Co., Ltd.
// Copyright (C) 2024-2026 UnionTech Software Technology Co., Ltd.
// SPDX-License-Identifier: Apache-2.0 OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only

#include "qmlengine.h"

#include "common/treelandlogging.h"

Check warning on line 6 in src/core/qmlengine.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: "common/treelandlogging.h" not found.
#include "core/rootsurfacecontainer.h"

Check warning on line 7 in src/core/qmlengine.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: "core/rootsurfacecontainer.h" not found.
#include "modules/capture/capture.h"

Check warning on line 8 in src/core/qmlengine.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: "modules/capture/capture.h" not found.
#include "output/output.h"

Check warning on line 9 in src/core/qmlengine.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: "output/output.h" not found.
#include "surface/surfacewrapper.h"

Check warning on line 10 in src/core/qmlengine.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: "surface/surfacewrapper.h" not found.
#include "workspace/workspace.h"

Check warning on line 11 in src/core/qmlengine.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: "workspace/workspace.h" not found.
#include "common/treelandlogging.h"

#include <woutput.h>

Check warning on line 13 in src/core/qmlengine.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <woutput.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
#include <woutputitem.h>

Check warning on line 14 in src/core/qmlengine.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <woutputitem.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.

#include <QQuickItem>

Expand Down Expand Up @@ -194,7 +194,8 @@
return createComponent(dockPreviewComponent, parent);
}

QQuickItem *QmlEngine::createLockScreen([[maybe_unused]] Output *output, [[maybe_unused]] QQuickItem *parent)
QQuickItem *QmlEngine::createLockScreen([[maybe_unused]] Output *output,

Check warning on line 197 in src/core/qmlengine.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

The function 'createLockScreen' is never used.
[[maybe_unused]] QQuickItem *parent)
{
#ifndef DISABLE_DDM
return createComponent(lockScreenComponent,
Expand Down Expand Up @@ -256,10 +257,16 @@
return createComponent(fpsDisplayComponent, parent);
}

QQuickItem *QmlEngine::createPrelaunchSplash(QQuickItem *parent, qreal initialRadius, QW_NAMESPACE::qw_buffer *iconBuffer)
QQuickItem *QmlEngine::createPrelaunchSplash(QQuickItem *parent,
qreal initialRadius,
QW_NAMESPACE::qw_buffer *iconBuffer,
const QColor &backgroundColor)
{
return createComponent(prelaunchSplashComponent, parent, {
{ "initialRadius", QVariant::fromValue(initialRadius) },
{ "iconBuffer", QVariant::fromValue(iconBuffer) },
});
return createComponent(prelaunchSplashComponent,
parent,
{
{ "initialRadius", QVariant::fromValue(initialRadius) },
{ "iconBuffer", QVariant::fromValue(iconBuffer) },
{ "backgroundColor", QVariant::fromValue(backgroundColor) },
});
}
10 changes: 7 additions & 3 deletions src/core/qmlengine.h
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
// Copyright (C) 2024 UnionTech Software Technology Co., Ltd.
// Copyright (C) 2024-2026 UnionTech Software Technology Co., Ltd.
// SPDX-License-Identifier: Apache-2.0 OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only

#pragma once

#include <wglobal.h>

Check warning on line 6 in src/core/qmlengine.h

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <wglobal.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.

#include <qwglobal.h>

#include <QColor>
#include <QQmlApplicationEngine>
#include <QQmlComponent>

Expand Down Expand Up @@ -67,11 +69,13 @@
QQuickItem *createShowDesktopAnimation(SurfaceWrapper *surface, QQuickItem *parent, bool show);
QQuickItem *createCaptureSelector(QQuickItem *parent, CaptureManagerV1 *captureManager);
QQuickItem *createWindowPicker(QQuickItem *parent);
QQuickItem *createLockScreenFallback(QQuickItem *parent, const QVariantMap &properties = QVariantMap());
QQuickItem *createLockScreenFallback(QQuickItem *parent,
const QVariantMap &properties = QVariantMap());
QQuickItem *createFpsDisplay(QQuickItem *parent);
QQuickItem *createPrelaunchSplash(QQuickItem *parent,
qreal initialRadius,
QW_NAMESPACE::qw_buffer *iconBuffer = nullptr);
QW_NAMESPACE::qw_buffer *iconBuffer,
const QColor &backgroundColor);

QQmlComponent *surfaceContentComponent()
{
Expand Down
Loading