Skip to content

Commit

Permalink
fix: Optimize the selected icon position
Browse files Browse the repository at this point in the history
  Optimize the selected icon position

Log: Optimize the selected icon position
  • Loading branch information
starhcq committed Jul 23, 2024
1 parent 9dd7e0f commit 8737911
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 68 deletions.
45 changes: 11 additions & 34 deletions src/qml/Control/ListView/ThumbnailListDelegate.qml
Original file line number Diff line number Diff line change
Expand Up @@ -264,60 +264,37 @@ Item {
Component {
id: selectedIconComponent
Item {
anchors.fill: parent

// 计算图片区域的位置
Rectangle {
id: imageArea
anchors.centerIn: parent
width: parent.width - 14
height: parent.height - 14
visible: false
}
id: imageArea
anchors.top: parent.top
anchors.right: parent.right
anchors.topMargin: 2
anchors.rightMargin: 2
width: 20
height: 20

//选中后显示的图标
DciIcon {
name: "select_active_1"
visible: true
anchors {
top: imageArea.top
right: imageArea.right
topMargin: 5
rightMargin : 5
}
anchors.centerIn: parent
}

DciIcon {
name: "Inner_shadow"
visible: true
anchors {
top: imageArea.top
right: imageArea.right
topMargin: 5
rightMargin : 5
}
anchors.centerIn: parent
}

DciIcon {
name: "shadow"
visible: true
anchors {
top: imageArea.top
right: imageArea.right
topMargin: 5
rightMargin : 5
}
anchors.centerIn: parent
}

DciIcon {
name: "yes"
visible: true
anchors {
top: imageArea.top
right: imageArea.right
topMargin: 5
rightMargin : 5
}
anchors.centerIn: parent
}
}
}
Expand Down
45 changes: 11 additions & 34 deletions src/qml/Control/ListView/ThumbnailListDelegate2.qml
Original file line number Diff line number Diff line change
Expand Up @@ -204,60 +204,37 @@ Item {
Component {
id: selectedIconComponent
Item {
anchors.fill: parent

// 计算图片区域的位置
Rectangle {
id: imageArea
anchors.centerIn: parent
width: parent.width - 14
height: parent.height - 14
visible: false
}
id: imageArea
anchors.top: parent.top
anchors.right: parent.right
anchors.topMargin: 2
anchors.rightMargin: 2
width: 20
height: 20

//选中后显示的图标
DciIcon {
name: "select_active_1"
visible: true
anchors {
top: imageArea.top
right: imageArea.right
topMargin: 5
rightMargin : 5
}
anchors.centerIn: parent
}

DciIcon {
name: "Inner_shadow"
visible: true
anchors {
top: imageArea.top
right: imageArea.right
topMargin: 5
rightMargin : 5
}
anchors.centerIn: parent
}

DciIcon {
name: "shadow"
visible: true
anchors {
top: imageArea.top
right: imageArea.right
topMargin: 5
rightMargin : 5
}
anchors.centerIn: parent
}

DciIcon {
name: "yes"
visible: true
anchors {
top: imageArea.top
right: imageArea.right
topMargin: 5
rightMargin : 5
}
anchors.centerIn: parent
}
}
}
Expand Down

0 comments on commit 8737911

Please sign in to comment.