Skip to content

Commit

Permalink
fix: the fullscreen launcher icon flashes when resizing the dock size
Browse files Browse the repository at this point in the history
give the max sourceSize and use scale

Issue: linuxdeepin/developer-center#10456
  • Loading branch information
xionglinlin authored and deepin-bot[bot] committed Aug 30, 2024
1 parent 1bd7109 commit 7a61820
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions qml/IconItemDelegate.qml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@ Control {
id: root

property var icons: undefined
property int preferredIconSize: 48

// TODO: When DciIcon changes the sourceSize, the icon will flash, It may be a bug of dciicon or qt?
// So we give the max sourceSize and use scale to solve it.
property int maxIconSize: 128
property int maxIconSizeInFolder: 64
property string text: display.startsWith("internal/category/") ? getCategoryName(display.substring(18)) : display

property string iconSource
Expand Down Expand Up @@ -133,7 +137,8 @@ Control {
Layout.alignment: Qt.AlignTop | Qt.AlignLeft

name: modelData
sourceSize: Qt.size(parent.width / 2, parent.height / 2)
sourceSize: Qt.size(root.maxIconSizeInFolder, root.maxIconSizeInFolder)
scale: parent.width / 2 / root.maxIconSizeInFolder
palette: DTK.makeIconPalette(root.palette)
theme: ApplicationHelper.DarkType
}
Expand Down Expand Up @@ -162,7 +167,8 @@ Control {
objectName: "appIcon"
anchors.fill: parent
name: iconSource
sourceSize: Qt.size(parent.width, parent.height)
sourceSize: Qt.size(root.maxIconSize, root.maxIconSize)
scale: parent.width / root.maxIconSize
palette: DTK.makeIconPalette(root.palette)
theme: ApplicationHelper.DarkType
}
Expand Down

0 comments on commit 7a61820

Please sign in to comment.