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 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 {

View file

@ -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) {