Skip to content

Commit 14c6d60

Browse files
committed
fix(dock): restore fashion mode monitor stats and mail card
Keep the fashion mode mail plugin visible without waking the mail client when no mailbox account is configured, and read CPU and memory usage from /proc so the monitor plugin reports real values instead of stale fallback data. This revision also trims the PR back to dock-focused fashion mode changes so the GitHub diff stays below the cppcheck action limit, and refreshes the REUSE/SPDX metadata required by the current CI checks.
1 parent 61b4c67 commit 14c6d60

97 files changed

Lines changed: 10151 additions & 659 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

REUSE.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,12 @@ precedence = "aggregate"
3333
SPDX-FileCopyrightText = "UnionTech Software Technology Co., Ltd."
3434
SPDX-License-Identifier = "GPL-3.0-or-later"
3535

36+
[[annotations]]
37+
path = ["panels/dock/package/SpotlightGradient.png", "panels/dock/package/SpotlightGradient.svg"]
38+
precedence = "aggregate"
39+
SPDX-FileCopyrightText = "UnionTech Software Technology Co., Ltd."
40+
SPDX-License-Identifier = "GPL-3.0-or-later"
41+
3642
[[annotations]]
3743
path = ["**.qrc", "**/qmldir"]
3844
precedence = "aggregate"

panels/dock/AppletDockItem.qml

Lines changed: 0 additions & 17 deletions
This file was deleted.

panels/dock/AppletItemButton.qml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ IconButton {
1212
id: control
1313
property bool isActive
1414
property real radius: 4
15+
property point lastSpotlightPoint: Qt.point(0, 0)
1516
property bool autoClosePopup: false
17+
readonly property bool drivesDockSpotlight: Window.window === Panel.rootObject
1618

1719
padding: 4
1820
topPadding: undefined
@@ -26,6 +28,35 @@ IconButton {
2628
icon.width: 16
2729
icon.height: 16
2830

31+
function mapSpotlightPoint(localPoint) {
32+
if (!drivesDockSpotlight) {
33+
return Qt.point(0, 0)
34+
}
35+
36+
const point = localPoint || Qt.point(width / 2, height / 2)
37+
return mapToItem(null, point.x, point.y)
38+
}
39+
40+
function updateSpotlight(localPoint) {
41+
if (!drivesDockSpotlight) {
42+
lastSpotlightPoint = Qt.point(0, 0)
43+
Panel.reportMousePresence(false)
44+
return
45+
}
46+
47+
lastSpotlightPoint = mapSpotlightPoint(localPoint)
48+
Panel.reportMousePresence(true, lastSpotlightPoint)
49+
}
50+
51+
function clearSpotlight() {
52+
if (!drivesDockSpotlight) {
53+
Panel.reportMousePresence(false)
54+
return
55+
}
56+
57+
Panel.reportMousePresence(false, lastSpotlightPoint)
58+
}
59+
2960
Connections {
3061
target: control
3162
enabled: autoClosePopup
@@ -42,4 +73,38 @@ IconButton {
4273
Component.onCompleted: {
4374
contentItem.smooth = false
4475
}
76+
77+
HoverHandler {
78+
id: spotlightHoverHandler
79+
acceptedDevices: PointerDevice.Mouse | PointerDevice.TouchPad | PointerDevice.Stylus
80+
enabled: control.enabled && control.visible && control.hoverEnabled
81+
82+
onPointChanged: {
83+
if (hovered) {
84+
spotlightClearTimer.stop()
85+
control.updateSpotlight(spotlightHoverHandler.point.position)
86+
}
87+
}
88+
89+
onHoveredChanged: {
90+
if (hovered) {
91+
spotlightClearTimer.stop()
92+
control.updateSpotlight()
93+
return
94+
}
95+
96+
spotlightClearTimer.restart()
97+
}
98+
}
99+
100+
Timer {
101+
id: spotlightClearTimer
102+
interval: 70
103+
repeat: false
104+
onTriggered: {
105+
if (!spotlightHoverHandler.hovered) {
106+
control.clearSpotlight()
107+
}
108+
}
109+
}
45110
}

panels/dock/CMakeLists.txt

Lines changed: 32 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# SPDX-FileCopyrightText: 2023 - 2026 UnionTech Software Technology Co., Ltd.
1+
# SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd.
22
#
33
# SPDX-License-Identifier: GPL-3.0-or-later
44

@@ -7,7 +7,7 @@ set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-undefined")
77
configure_file(environments.h.in environments.h @ONLY)
88

99
find_package(PkgConfig REQUIRED)
10-
find_package(Qt${QT_VERSION_MAJOR} ${REQUIRED_QT_VERSION} COMPONENTS Core DBus Gui Qml WaylandCompositor Widgets WaylandClient)
10+
find_package(Qt${QT_VERSION_MAJOR} ${REQUIRED_QT_VERSION} COMPONENTS Core DBus Gui Network Qml WaylandCompositor Widgets WaylandClient)
1111
find_package(DdeTrayLoader REQUIRED)
1212
find_package(TreelandProtocols REQUIRED)
1313
pkg_check_modules(WaylandClient REQUIRED IMPORTED_TARGET wayland-client)
@@ -18,6 +18,8 @@ file(
1818
dockabstractsettingsconfig.h
1919
dockdbusproxy.cpp
2020
dockdbusproxy.h
21+
dockiteminfo.cpp
22+
dockiteminfo.h
2123
dockpanel.cpp
2224
dockpanel.h
2325
docksettings.cpp
@@ -59,6 +61,25 @@ add_library(dockpanel SHARED
5961
${dock_panel_sources}
6062
)
6163

64+
add_dependencies(dockpanel tray_loader_font_sync)
65+
66+
add_library(tray_loader_font_sync SHARED
67+
tray_loader_font_sync.cpp
68+
tray_loader_font_sync.qrc
69+
)
70+
71+
set_target_properties(tray_loader_font_sync PROPERTIES
72+
LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}"
73+
)
74+
75+
target_link_libraries(tray_loader_font_sync PRIVATE
76+
Qt${QT_VERSION_MAJOR}::Core
77+
Qt${QT_VERSION_MAJOR}::Gui
78+
Qt${QT_VERSION_MAJOR}::Widgets
79+
)
80+
81+
install(TARGETS tray_loader_font_sync DESTINATION "${CMAKE_INSTALL_LIBDIR}/dde-shell")
82+
6283
qt_generate_wayland_protocol_client_sources(dockpanel
6384
NO_INCLUDE_CORE_ONLY
6485
FILES
@@ -72,7 +93,6 @@ target_link_libraries(dockpanel PRIVATE
7293
Qt${QT_VERSION_MAJOR}::WaylandClientPrivate
7394
Qt${QT_VERSION_MAJOR}::Widgets
7495
dde-shell-frame
75-
dde-shell-dock
7696
)
7797

7898
if (BUILD_WITH_X11)
@@ -96,7 +116,6 @@ add_subdirectory(showdesktop)
96116
add_subdirectory(taskmanager)
97117
add_subdirectory(tray)
98118
add_subdirectory(multitaskview)
99-
add_subdirectory(frame)
100119

101120
#add_subdirectory(appruntimeitem)
102121

@@ -106,6 +125,8 @@ file(
106125
constants.h
107126
# dockfilterproxymodel.cpp
108127
# dockfilterproxymodel.h
128+
fashionleftpluginprovider.h
129+
fashionleftpluginprovider.cpp
109130
pluginmanagerextension_p.h
110131
pluginmanagerextension.cpp
111132
pluginmanagerintegration_p.h
@@ -135,7 +156,6 @@ qt_add_qml_module(dock-plugin
135156
QML_FILES DockCompositor.qml OverflowContainer.qml MenuHelper.qml DockPalette.qml
136157
AppletItemButton.qml
137158
AppletItemBackground.qml
138-
AppletDockItem.qml
139159
OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/plugins/org/deepin/ds/dock/
140160
)
141161

@@ -147,7 +167,10 @@ qt_generate_wayland_protocol_server_sources(dock-plugin
147167

148168
target_link_libraries(dock-plugin PUBLIC
149169
Qt${QT_VERSION_MAJOR}::Core
170+
Qt${QT_VERSION_MAJOR}::Concurrent
171+
Qt${QT_VERSION_MAJOR}::DBus
150172
Qt${QT_VERSION_MAJOR}::Gui
173+
Qt${QT_VERSION_MAJOR}::Network
151174
Qt${QT_VERSION_MAJOR}::Qml
152175
Qt${QT_VERSION_MAJOR}::Widgets
153176
Qt${QT_VERSION_MAJOR}::WaylandCompositor
@@ -171,3 +194,7 @@ dtk_add_config_meta_files(APPID org.deepin.ds.dock FILES dconfig/org.deepin.ds.d
171194
dtk_add_config_meta_files(APPID org.deepin.ds.dock FILES dconfig/org.deepin.ds.dock.tray.json) # compat
172195
dtk_add_config_meta_files(APPID org.deepin.dde.shell FILES dconfig/org.deepin.ds.dock.json)
173196
dtk_add_config_meta_files(APPID org.deepin.dde.shell FILES dconfig/org.deepin.ds.dock.tray.json)
197+
dtk_add_config_meta_files(APPID org.deepin.dde.dock FILES dconfig/org.deepin.dde.dock.json)
198+
dtk_add_config_meta_files(APPID org.deepin.dde.dock FILES dconfig/org.deepin.dde.dock.plugin.quick-panel.json)
199+
dtk_add_config_meta_files(APPID org.deepin.dde.tray-loader FILES dconfig/org.deepin.dde.dock.json)
200+
dtk_add_config_meta_files(APPID org.deepin.dde.tray-loader FILES dconfig/org.deepin.dde.dock.plugin.quick-panel.json)

panels/dock/OverflowContainer.qml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ Item {
1919
property alias addDisplaced: listView.addDisplaced
2020
property alias removeDisplaced: listView.removeDisplaced
2121
property alias moveDisplaced: listView.moveDisplaced
22+
property alias footer: listView.footer
23+
property alias footerPositioning: listView.footerPositioning
2224
ListView {
2325
id: listView
2426
anchors.fill: parent
@@ -54,6 +56,30 @@ Item {
5456
return listView.indexAt(x, y)
5557
}
5658

59+
function childTargetImplicitWidth(child) {
60+
if (!child) {
61+
return 0
62+
}
63+
64+
if (child.targetImplicitWidth !== undefined) {
65+
return child.targetImplicitWidth
66+
}
67+
68+
return child.implicitWidth
69+
}
70+
71+
function childTargetImplicitHeight(child) {
72+
if (!child) {
73+
return 0
74+
}
75+
76+
if (child.targetImplicitHeight !== undefined) {
77+
return child.targetImplicitHeight
78+
}
79+
80+
return child.implicitHeight
81+
}
82+
5783
implicitWidth: {
5884
let width = 0
5985
for (let child of listView.contentItem.visibleChildren) {
@@ -70,4 +96,20 @@ Item {
7096
}
7197
return Math.max(height, 1)
7298
}
99+
100+
readonly property real targetImplicitWidth: {
101+
let width = 0
102+
for (let child of listView.contentItem.visibleChildren) {
103+
width = calculateImplicitWidth(width, childTargetImplicitWidth(child))
104+
}
105+
return Math.max(width, 1)
106+
}
107+
108+
readonly property real targetImplicitHeight: {
109+
let height = 0
110+
for (let child of listView.contentItem.visibleChildren) {
111+
height = calculateImplicitHeight(height, childTargetImplicitHeight(child))
112+
}
113+
return Math.max(height, 1)
114+
}
73115
}

panels/dock/appruntimeitem/CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# SPDX-FileCopyrightText: 2024 - 2026 UnionTech Software Technology Co., Ltd.
1+
# SPDX-FileCopyrightText: 2024 UnionTech Software Technology Co., Ltd.
22
#
33
# SPDX-License-Identifier: GPL-3.0-or-later
44

@@ -13,8 +13,8 @@ add_library(dock-appruntimeitem SHARED
1313
xcbgetinfo.h
1414
xcbgetinfo.cpp
1515
qmlappruntime.qrc
16-
${CMAKE_SOURCE_DIR}/frame/dock/dockiteminfo.cpp
17-
${CMAKE_SOURCE_DIR}/frame/dock/dockiteminfo.h
16+
${CMAKE_SOURCE_DIR}/panels/dock/dockiteminfo.cpp
17+
${CMAKE_SOURCE_DIR}/panels/dock/dockiteminfo.h
1818
${CMAKE_SOURCE_DIR}/panels/dock/constants.h
1919
${CMAKE_SOURCE_DIR}/panels/dock/taskmanager/x11utils.h
2020
${CMAKE_SOURCE_DIR}/panels/dock/taskmanager/x11utils.cpp

panels/dock/appruntimeitem/appruntimeitem.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
// SPDX-FileCopyrightText: 2024 - 2026 UnionTech Software Technology Co., Ltd.
1+
// SPDX-FileCopyrightText: 2024-2026 UnionTech Software Technology Co., Ltd.
22
//
33
// SPDX-License-Identifier: GPL-3.0-or-later
44

55
#pragma once
66
#include "applet.h"
77
#include "dsglobal.h"
8-
#include "dock/dockiteminfo.h"
8+
#include "dockiteminfo.h"
99

1010
#include <QGuiApplication>
1111
#include <QQmlApplicationEngine>

panels/dock/constants.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,12 @@ enum ItemAlignment {
3838
LeftAlignment = 1,
3939
};
4040

41+
enum ViewMode {
42+
CenteredMode = 0,
43+
LeftAlignedMode = 1,
44+
FashionMode = 2,
45+
};
46+
4147
enum ColorTheme {
4248
Light = Dtk::Gui::DGuiApplicationHelper::ColorType::LightType,
4349
Dark = Dtk::Gui::DGuiApplicationHelper::ColorType::DarkType,
@@ -148,6 +154,7 @@ const QString DCCIconPath = CMAKE_INSTALL_PREFIX + QString("/share/dde-dock/icon
148154
Q_ENUM_NS(SIZE)
149155
Q_ENUM_NS(IndicatorStyle)
150156
Q_ENUM_NS(ItemAlignment)
157+
Q_ENUM_NS(ViewMode)
151158
Q_ENUM_NS(ColorTheme)
152159
Q_ENUM_NS(HideMode)
153160
Q_ENUM_NS(Position)
@@ -162,6 +169,7 @@ Q_ENUM_NS(TrayPluginSizePolicy)
162169
Q_DECLARE_METATYPE(dock::SIZE)
163170
Q_DECLARE_METATYPE(dock::IndicatorStyle)
164171
Q_DECLARE_METATYPE(dock::ItemAlignment)
172+
Q_DECLARE_METATYPE(dock::ViewMode)
165173
Q_DECLARE_METATYPE(dock::ColorTheme)
166174
Q_DECLARE_METATYPE(dock::HideMode)
167175
Q_DECLARE_METATYPE(dock::HideState)

0 commit comments

Comments
 (0)