1
0
Fork 0

Fix button.

This commit is contained in:
namedkitten 2020-05-03 17:09:52 +01:00
parent 78b6497b0a
commit 77ba915623
2 changed files with 14 additions and 14 deletions

View file

@ -22,12 +22,13 @@ Control {
fillMode: Image.PreserveAspectFit
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))
}
ColorOverlay {
id: colorOverlay
anchors.fill: parent
source: parent
anchors.fill: buttonImage
source: buttonImage
color: getAppearanceValueForTheme(appearance.themeName, "buttonColor")
cached: false
cached: true
Binding on color {
when: root.hovered
value: root.hovered ? getAppearanceValueForTheme(
@ -36,7 +37,6 @@ Control {
appearance.themeName, "buttonColor")
}
}
}
MouseArea {

View file

@ -391,7 +391,7 @@ Window {
}
}
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) {
appearance.scaleFactor += 0.2
} else if (velocity < -2 && isLongEnough) {