From 77ba9156235231de2b7f2977fb03bd34cd8c2cd1 Mon Sep 17 00:00:00 2001 From: namedkitten Date: Sun, 3 May 2020 17:09:52 +0100 Subject: [PATCH] Fix button. --- src/qml/UIComponents/SmoothButton.qml | 26 +++++++++++++------------- src/qml/main.qml | 2 +- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/qml/UIComponents/SmoothButton.qml b/src/qml/UIComponents/SmoothButton.qml index 4d7caec..e777c98 100644 --- a/src/qml/UIComponents/SmoothButton.qml +++ b/src/qml/UIComponents/SmoothButton.qml @@ -22,19 +22,19 @@ 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 - color: getAppearanceValueForTheme(appearance.themeName, "buttonColor") - cached: false - Binding on color { - when: root.hovered - value: root.hovered ? getAppearanceValueForTheme( - appearance.themeName, - "buttonHoverColor") : getAppearanceValueForTheme( - appearance.themeName, "buttonColor") - } + } + ColorOverlay { + id: colorOverlay + anchors.fill: buttonImage + source: buttonImage + color: getAppearanceValueForTheme(appearance.themeName, "buttonColor") + cached: true + Binding on color { + when: root.hovered + value: root.hovered ? getAppearanceValueForTheme( + appearance.themeName, + "buttonHoverColor") : getAppearanceValueForTheme( + appearance.themeName, "buttonColor") } } diff --git a/src/qml/main.qml b/src/qml/main.qml index 5e2ff05..f57ccc9 100644 --- a/src/qml/main.qml +++ b/src/qml/main.qml @@ -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) {