Fix button.
This commit is contained in:
parent
78b6497b0a
commit
77ba915623
|
@ -22,12 +22,13 @@ Control {
|
||||||
fillMode: Image.PreserveAspectFit
|
fillMode: Image.PreserveAspectFit
|
||||||
sourceSize.height: Math.floor(root.parent.height / (appearance.themeName == "Niconico" ? 1.8 : 1.25))
|
sourceSize.height: Math.floor(root.parent.height / (appearance.themeName == "Niconico" ? 1.8 : 1.25))
|
||||||
sourceSize.width: Math.floor(root.parent.height / (appearance.themeName == "Niconico" ? 1.8 : 1.25))
|
sourceSize.width: Math.floor(root.parent.height / (appearance.themeName == "Niconico" ? 1.8 : 1.25))
|
||||||
|
}
|
||||||
ColorOverlay {
|
ColorOverlay {
|
||||||
id: colorOverlay
|
id: colorOverlay
|
||||||
anchors.fill: parent
|
anchors.fill: buttonImage
|
||||||
source: parent
|
source: buttonImage
|
||||||
color: getAppearanceValueForTheme(appearance.themeName, "buttonColor")
|
color: getAppearanceValueForTheme(appearance.themeName, "buttonColor")
|
||||||
cached: false
|
cached: true
|
||||||
Binding on color {
|
Binding on color {
|
||||||
when: root.hovered
|
when: root.hovered
|
||||||
value: root.hovered ? getAppearanceValueForTheme(
|
value: root.hovered ? getAppearanceValueForTheme(
|
||||||
|
@ -36,7 +37,6 @@ Control {
|
||||||
appearance.themeName, "buttonColor")
|
appearance.themeName, "buttonColor")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
MouseArea {
|
MouseArea {
|
||||||
|
|
|
@ -391,7 +391,7 @@ Window {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
onReleased: {
|
onReleased: {
|
||||||
var isLongEnough = Math.hypot(xStart, mouse.x) > mainWindow.width * 0.3
|
var isLongEnough = Math.sqrt(xStart*xStart, mouse.x*mouse.x) > mainWindow.width * 0.3
|
||||||
if (velocity > 2 && isLongEnough) {
|
if (velocity > 2 && isLongEnough) {
|
||||||
appearance.scaleFactor += 0.2
|
appearance.scaleFactor += 0.2
|
||||||
} else if (velocity < -2 && isLongEnough) {
|
} else if (velocity < -2 && isLongEnough) {
|
||||||
|
|
Loading…
Reference in a new issue