fix: disable smooth rendering for tray icons to prevent blur#1544
fix: disable smooth rendering for tray icons to prevent blur#1544wjyrich wants to merge 1 commit intolinuxdeepin:masterfrom
Conversation
1. Removed `smooth: false` from AppletItemButton.qml and moved it to Component.onCompleted to ensure it's applied after component initialization 2. Added `smooth: false` to PanelTrayItem.qml's IconItem to prevent blurry icons in quick panel 3. Replaced ShellSurfaceItem with ShellSurfaceItemProxy in ActionLegacyTrayPluginDelegate.qml and updated hover/tap handler parent references 4. Added fixPosition function to ShellSurfaceItemProxy to handle position adjustments when tray items move 5. Added smooth property setting to IconItem in PanelTrayItem.qml to ensure consistent rendering Log: Fixed blurry tray icons in dock and quick panel Influence: 1. Verify tray icons appear sharp and not blurry in both dock and quick panel 2. Test hover and click functionality on legacy tray icons 3. Check that tray icon positioning remains stable when moving dock items 4. Ensure all tray icons maintain consistent visual quality 5. Test with various icon sizes and scaling factors fix: 禁用托盘图标平滑渲染以防止模糊 1. 从 AppletItemButton.qml 中移除 `smooth: false` 并将其移至 Component.onCompleted,确保在组件初始化后应用 2. 在 PanelTrayItem.qml 的 IconItem 中添加 `smooth: false` 以防止快速面 板中的图标模糊 3. 在 ActionLegacyTrayPluginDelegate.qml 中将 ShellSurfaceItem 替换为 ShellSurfaceItemProxy,并更新悬停/点击处理器的父引用 4. 在 ShellSurfaceItemProxy 中添加 fixPosition 函数以处理托盘项目移动时 的位置调整 5. 在 PanelTrayItem.qml 的 IconItem 中添加平滑属性设置以确保一致的渲染 效果 Log: 修复了托盘和快速面板中托盘图标模糊的问题 Influence: 1. 验证托盘图标在托盘和快速面板中显示清晰不模糊 2. 测试传统托盘图标的悬停和点击功能 3. 检查移动托盘项目时图标位置是否保持稳定 4. 确保所有托盘图标保持一致的视觉质量 5. 测试不同图标大小和缩放比例下的显示效果
Reviewer's guide (collapsed on small PRs)Reviewer's GuideThis PR removes direct smooth rendering configuration from the dock tray icon button, centralizes non-smooth icon rendering via Component.onCompleted and quick panel IconItem properties, and refactors legacy tray shell surface handling to go through a ShellSurfaceItemProxy that exposes the underlying ShellSurfaceItem and a position-fixing helper used when tray items move. Sequence diagram for legacy tray item movement and position fixingsequenceDiagram
participant PluginItem
participant ActionLegacyTrayPluginDelegate as Delegate
participant ShellSurfaceItemProxy as Proxy
participant ShellSurfaceItem as ShellItem
participant FixPositionTimer as Timer
PluginItem->>Delegate: itemGlobalPosChanged
Delegate->>Delegate: onItemGlobalPosChanged
Delegate->>Delegate: updatePluginItemPosTimer.start()
Delegate->>Proxy: fixPosition()
Proxy->>Timer: fixPositionTimer.start()
Timer-->>Proxy: timeout
Proxy->>ShellItem: adjust position based on tray layout
Sequence diagram for hover and tap events via ShellSurfaceItemProxysequenceDiagram
actor User
participant Pointer
participant HoverHandler as Hover
participant TapHandler as Tap
participant ShellSurfaceItemProxy as Proxy
participant ShellSurfaceItem as ShellItem
User->>Pointer: move over legacy tray icon
Pointer->>Hover: update
Hover->>ShellItem: hover event (parent is ShellItem)
ShellItem->>Proxy: update hovered state
Proxy-->>Hover: hovered property
User->>Pointer: click legacy tray icon
Pointer->>Tap: press and release
Tap->>ShellItem: tap event (parent is ShellItem)
ShellItem->>Proxy: update pressed state and activate shellSurface
Proxy-->>Tap: pressed property
Class diagram for updated tray icon components and proxyclassDiagram
class AppletItemButton {
IconButton base
+int icon_width
+int icon_height
+Component_onCompleted()
}
class ContentItem {
+bool smooth
}
class PanelTrayItem {
Control base
}
class IconItem {
+string name
+palette palette
+theme theme
+bool smooth
}
class ShellSurfaceItemProxy {
Item base
+ShellSurface shellSurface
+bool hovered
+bool pressed
+int cursorShape
+ShellSurfaceItem shellSurfaceItem
+void takeFocus()
+void fixPosition()
}
class ShellSurfaceItem {
+int width
+int height
+void takeFocus()
}
class HoverHandler {
Item parent
+bool hovered
}
class TapHandler {
Item parent
+bool pressed
}
AppletItemButton o-- ContentItem : contentItem
PanelTrayItem o-- IconItem : trayIcon
ShellSurfaceItemProxy o-- ShellSurfaceItem : impl
ShellSurfaceItemProxy o-- HoverHandler : hoverHandler
ShellSurfaceItemProxy o-- TapHandler : tapHandler
HoverHandler --> ShellSurfaceItem : parent
TapHandler --> ShellSurfaceItem : parent
Flow diagram for applying non-smooth icon renderingflowchart TD
A[AppletItemButton created] --> B[Component_onCompleted]
B --> C[Set contentItem.smooth = false]
D[PanelTrayItem created] --> E[Create IconItem]
E --> F[Set IconItem.smooth = false]
C --> G[Dock tray icons render sharp]
F --> H[Quick panel tray icons render sharp]
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- In AppletItemButton.qml, consider making the
smoothassignment resilient to runtime changes tocontentItem(e.g., guard with a null check or react tocontentItemchanges) so it doesn’t silently break if the underlying control implementation changes. - In ShellSurfaceItemProxy.qml, it might be clearer to route hover/tap handling directly through the proxy (e.g., dedicated functions or signals) rather than having external code reach into the
shellSurfaceItemalias, which tightens coupling to the internal implementation.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- In AppletItemButton.qml, consider making the `smooth` assignment resilient to runtime changes to `contentItem` (e.g., guard with a null check or react to `contentItem` changes) so it doesn’t silently break if the underlying control implementation changes.
- In ShellSurfaceItemProxy.qml, it might be clearer to route hover/tap handling directly through the proxy (e.g., dedicated functions or signals) rather than having external code reach into the `shellSurfaceItem` alias, which tightens coupling to the internal implementation.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: 18202781743, wjyrich 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 |
smooth: falsefrom AppletItemButton.qml and moved it to Component.onCompleted to ensure it's applied after component initializationsmooth: falseto PanelTrayItem.qml's IconItem to prevent blurry icons in quick panelLog: Fixed blurry tray icons in dock and quick panel
Influence:
fix: 禁用托盘图标平滑渲染以防止模糊
smooth: false并将其移至 Component.onCompleted,确保在组件初始化后应用smooth: false以防止快速面 板中的图标模糊Log: 修复了托盘和快速面板中托盘图标模糊的问题
Influence:
Summary by Sourcery
Improve tray icon rendering quality and interaction by adjusting icon smoothing and using a proxy wrapper for legacy tray shell surfaces.
Bug Fixes:
Enhancements: