feat: add attention animation toggle for taskmanager#1558
Conversation
Reviewer's GuideImplements a new task manager setting that controls whether the dock shows the ripple-style attention animation for apps with notifications, wiring it through DConfig, C++ settings/backend, and QML so the animation can be toggled on/off from configuration. Sequence diagram for attention animation toggle propagationsequenceDiagram
participant User
participant SettingsUI
participant TaskManagerSettings
participant DConfig
participant TaskManager
participant QML_AppItem as AppItem_qml
User->>SettingsUI: Toggle showAttentionAnimation
SettingsUI->>TaskManagerSettings: setShowAttentionAnimation(show bool)
TaskManagerSettings->>TaskManagerSettings: m_showAttentionAnimation = show
TaskManagerSettings->>DConfig: setValue(TASKMANAGER_SHOW_ATTENTION_ANIMATION_KEY, show)
TaskManagerSettings-->>TaskManager: showAttentionAnimationChanged()
TaskManager-->>QML_AppItem: showAttentionAnimation property changed
QML_AppItem->>QML_AppItem: animationRoot.active = root.attention && !Panel.rootObject.isDragging && TaskManager.showAttentionAnimation
Class diagram for new attention animation toggle in task managerclassDiagram
class DConfig {
+value(key QString, defaultValue QVariant) QVariant
+setValue(key QString, value QVariant) void
}
class TaskManagerSettings {
-DConfig* m_taskManagerDconfig
-bool m_allowForceQuit
-bool m_showAttentionAnimation
-bool m_windowSplit
-bool m_cgroupsBasedGrouping
-QStringList m_dockedElements
-QStringList m_dockedItems
+TaskManagerSettings(parent QObject)
+bool isAllowedForceQuit()
+void setAllowedForceQuit(allowed bool)
+bool showAttentionAnimation() const
+void setShowAttentionAnimation(show bool)
+bool isWindowSplit()
+void setWindowSplit(split bool)
+bool isCgroupsBasedGrouping()
+void setCgroupsBasedGrouping(enabled bool)
+QStringList dockedElements() const
+void setDockedElements(elements QStringList)
+QStringList dockedItems() const
+void setDockedItems(items QStringList)
+void sync()
+void reload()
+void init()
<<signals>> allowedForceQuitChanged()
<<signals>> showAttentionAnimationChanged()
<<signals>> windowSplitChanged()
<<signals>> dockedItemsChanged()
<<signals>> dockedElementsChanged()
}
class AbstractTaskManager {
<<interface>>
+void requestActivate(index QModelIndex) const
+void requestNewInstance(index QModelIndex, action QString) const
}
class DContainment {
}
class TaskManager {
Q_PROPERTY bool windowSplit
Q_PROPERTY bool windowFullscreen
Q_PROPERTY bool allowForceQuit
Q_PROPERTY bool showAttentionAnimation
+TaskManager(parent QObject)
+bool windowSplit()
+bool windowFullscreen()
+bool allowForceQuit()
+bool showAttentionAnimation()
+void requestActivate(index QModelIndex) const
+void requestNewInstance(index QModelIndex, action QString) const
<<signals>> windowSplitChanged()
<<signals>> windowFullscreenChanged(fullscreen bool)
<<signals>> allowedForceQuitChanged()
<<signals>> showAttentionAnimationChanged()
-void handleWindowAdded(window QPointer_AbstractWindow)
}
DContainment <|-- TaskManager
AbstractTaskManager <|.. TaskManager
TaskManagerSettings --> DConfig : uses
TaskManager --> TaskManagerSettings : uses
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Added a new configuration option to control the display of attention animation for applications in the dock task manager. The animation shows a ripple effect when applications have new notifications. This feature includes DConfig settings, QML property binding, and C++ backend implementation to allow users to enable/disable the animation based on their preference. Log: Added toggle for attention animation in dock task manager settings feat: 为任务管理器添加消息通知动画开关 新增配置选项用于控制任务管理器中的应用消息通知动画显示。当应用有新消息 时,会显示水波纹动画效果。此功能包含 DConfig 设置、QML 属性绑定和 C++ 后 端实现,允许用户根据个人偏好启用或禁用该动画。 Log: 在任务管理器设置中添加了消息通知动画开关
126312e to
8b966a5
Compare
deepin pr auto review这段代码的主要目的是在任务栏的任务管理器中添加一个可配置的"显示消息通知动画"(水波纹动画)的功能。整体来看,代码逻辑清晰,遵循了项目的现有架构和命名规范。以下是对语法逻辑、代码质量、代码性能和代码安全的详细审查意见: 1. 语法与逻辑
2. 代码质量
3. 代码性能
4. 代码安全
5. 改进建议
总结这段代码实现了一个新的功能开关,代码质量高,逻辑清晰,且完美融入了现有代码库。没有发现明显的安全隐患或性能瓶颈。代码可以合并。 |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: BLumia, mhduiy The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Added a new configuration option to control the display of attention animation for applications in the dock task manager. The animation shows a ripple effect when applications have new notifications. This feature includes DConfig settings, QML property binding, and C++ backend implementation to allow users to enable/disable the animation based on their preference.
Log: Added toggle for attention animation in dock task manager settings
feat: 为任务管理器添加消息通知动画开关
新增配置选项用于控制任务管理器中的应用消息通知动画显示。当应用有新消息
时,会显示水波纹动画效果。此功能包含 DConfig 设置、QML 属性绑定和 C++ 后
端实现,允许用户根据个人偏好启用或禁用该动画。
Log: 在任务管理器设置中添加了消息通知动画开关
Summary by Sourcery
Add a configurable toggle to control attention notification animations for dock task manager items.
New Features:
Enhancements: