feat: adjust hover color

This commit is contained in:
kateleet 2021-12-21 22:16:38 +08:00
parent 248c1deda4
commit c026d3a844

View file

@ -98,22 +98,6 @@ Item {
visible: !_image.visible visible: !_image.visible
smooth: true smooth: true
antialiasing: true antialiasing: true
ColorOverlay {
anchors.fill: _icon
source: _icon
color: FishUI.Theme.highlightColor
opacity: 0.5
visible: control.selected
}
ColorOverlay {
anchors.fill: _icon
source: _icon
color: "white"
opacity: 0.3
visible: control.hovered && !control.selected
}
} }
Image { Image {
@ -133,23 +117,6 @@ Item {
smooth: true smooth: true
antialiasing: true antialiasing: true
// Because of the effect of OpacityMask.
ColorOverlay {
anchors.fill: _image
source: _image
color: FishUI.Theme.highlightColor
opacity: 0.5
visible: control.selected
}
ColorOverlay {
anchors.fill: _image
source: _image
color: "white"
opacity: FishUI.Theme.darkMode ? 0.3 : 0.4
visible: control.hovered && !control.selected
}
layer.enabled: _image.visible layer.enabled: _image.visible
layer.effect: OpacityMask { layer.effect: OpacityMask {
maskSource: Item { maskSource: Item {
@ -176,23 +143,23 @@ Item {
sourceSize: Qt.size(width, height) sourceSize: Qt.size(width, height)
} }
// ColorOverlay { ColorOverlay {
// id: _selectedColorOverlay id: _selectedColorOverlay
// anchors.fill: _image.visible ? _image : _icon anchors.fill: _iconItem
// source: _image.visible ? _image : _icon source: _iconItem
// color: FishUI.Theme.highlightColor color: FishUI.Theme.highlightColor
// opacity: 0.5 opacity: 0.5
// visible: control.selected visible: control.selected
// } }
// ColorOverlay { ColorOverlay {
// id: _hoveredColorOverlay id: _hoveredColorOverlay
// anchors.fill: _image.visible ? _image : _icon anchors.fill: _iconItem
// source: _image.visible ? _image : _icon source: _iconItem
// color: Qt.lighter(FishUI.Theme.highlightColor, 1.6) color: "white"
// opacity: FishUI.Theme.darkMode ? 0.4 : 0.6 opacity: 0.3
// visible: control.hovered && !control.selected visible: control.hovered && !control.selected
// } }
} }
Label { Label {
@ -223,7 +190,19 @@ Item {
radius: 4 radius: 4
color: FishUI.Theme.highlightColor color: FishUI.Theme.highlightColor
opacity: control.selected ? control.GridView.view.isDesktopView ? 1: 0.2 : 0 opacity: {
if (control.selected && control.GridView.view.isDesktopView)
return 1
if (control.selected)
return 0.2
if (control.hovered)
return 0.05
return 0
}
} }
DropShadow { DropShadow {