Simplify the handling of visibility in the QML view
This commit is contained in:
parent
25ff37df18
commit
51792459fb
1 changed files with 5 additions and 4 deletions
|
@ -77,6 +77,8 @@ Rectangle {
|
||||||
MouseArea {
|
MouseArea {
|
||||||
id: mouseArea
|
id: mouseArea
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
height: parent.height
|
||||||
|
width: parent.width
|
||||||
|
|
||||||
hoverEnabled: true
|
hoverEnabled: true
|
||||||
onClicked: {
|
onClicked: {
|
||||||
|
@ -86,8 +88,6 @@ Rectangle {
|
||||||
|
|
||||||
onEntered: {
|
onEntered: {
|
||||||
|
|
||||||
viewButton.visible = true
|
|
||||||
downloadButton.visible = true
|
|
||||||
viewButton.opacity = 1
|
viewButton.opacity = 1
|
||||||
downloadButton.opacity = 1
|
downloadButton.opacity = 1
|
||||||
|
|
||||||
|
@ -101,7 +101,7 @@ Rectangle {
|
||||||
Button {
|
Button {
|
||||||
id: viewButton
|
id: viewButton
|
||||||
iconName: "view-preview"
|
iconName: "view-preview"
|
||||||
visible: false
|
visible: opacity > 0
|
||||||
opacity: 0
|
opacity: 0
|
||||||
|
|
||||||
anchors.top: parent.top
|
anchors.top: parent.top
|
||||||
|
@ -129,7 +129,8 @@ Rectangle {
|
||||||
|
|
||||||
id: downloadButton
|
id: downloadButton
|
||||||
iconName: "download"
|
iconName: "download"
|
||||||
visible: false
|
visible: opacity > 0
|
||||||
|
opacity: 0
|
||||||
|
|
||||||
anchors.bottom: parent.bottom
|
anchors.bottom: parent.bottom
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue