From f6f26af7cbe231505b2494f6fa538f026b7fa584 Mon Sep 17 00:00:00 2001 From: cryptochangements34 Date: Mon, 20 Nov 2017 20:16:53 -0500 Subject: use PNG for menuButton gradiency --- components/MenuButton.qml | 24 +++++++++++------------- images/menuButtonGradient.png | Bin 0 -> 3994 bytes qml.qrc | 1 + 3 files changed, 12 insertions(+), 13 deletions(-) create mode 100644 images/menuButtonGradient.png diff --git a/components/MenuButton.qml b/components/MenuButton.qml index 4321d248..afc2421a 100644 --- a/components/MenuButton.qml +++ b/components/MenuButton.qml @@ -61,19 +61,6 @@ Rectangle { property bool present: !under || under.checked || checked || under.numSelectedChildren > 0 height: present ? ((appWindow.height >= 800) ? 44 * scaleRatio : 38 * scaleRatio ) : 0 - // Button gradient whilst checked - // @TODO: replace by .png - gradient not available in 2d renderer - LinearGradient { - visible: button.checked ? true : false - anchors.fill: parent - start: Qt.point(0, 0) - end: Qt.point(300, 0) - gradient: Gradient { - GradientStop { position: 1.0; color: "#333333" } - GradientStop { position: 0.0; color: "black" } - } - } - // button decorations that are subject to leftMargin offsets Rectangle { anchors.left: parent.left @@ -114,6 +101,17 @@ Rectangle { } } + // button gradient while checked + Image { + width: 160 + anchors.verticalCenter: parent.verticalCenter + anchors.right: parent.right + anchors.rightMargin: 0 + anchors.leftMargin: parent.getOffset() + source: "../images/menuButtonGradient.png" + visible: button.checked + } + // menu button right arrow Image { anchors.verticalCenter: parent.verticalCenter diff --git a/images/menuButtonGradient.png b/images/menuButtonGradient.png new file mode 100644 index 00000000..616f72c1 Binary files /dev/null and b/images/menuButtonGradient.png differ diff --git a/qml.qrc b/qml.qrc index 7f5b673c..d7ea0e1d 100644 --- a/qml.qrc +++ b/qml.qrc @@ -178,6 +178,7 @@ images/titlebarGradient.jpg images/titlebarLogo.png images/menuArrow.png + images/menuButtonGradient.png fonts/SFUIDisplay-Medium.otf fonts/SFUIDisplay-Regular.otf fonts/SFUIDisplay-Light.otf -- cgit v1.2.3