Consolidate qml alpha gradient workaround to desktop

This commit is contained in:
Zach Pomerantz 2016-04-07 18:28:53 -07:00
parent e54cfce392
commit d719b3692e
3 changed files with 9 additions and 6 deletions

View file

@ -34,6 +34,10 @@ FocusScope {
// The VR version of the primary menu // The VR version of the primary menu
property var rootMenu: Menu { objectName: "rootMenu" } property var rootMenu: Menu { objectName: "rootMenu" }
// FIXME: Alpha gradients display as fuschia under QtQuick 2.5 on OSX/AMD
// because shaders are 4.2, and do not include #version declarations.
property bool gradientsSupported: Qt.platform.os != "osx" && !~GL.vendor.indexOf("ATI")
readonly property alias zLevels: zLevels readonly property alias zLevels: zLevels
QtObject { QtObject {
id: zLevels; id: zLevels;

View file

@ -20,6 +20,8 @@ Item {
default property var decoration default property var decoration
property bool gradientsSupported: desktop.gradientsSupported
readonly property int iconSize: 22 readonly property int iconSize: 22
readonly property int frameMargin: 9 readonly property int frameMargin: 9
readonly property int frameMarginLeft: frameMargin readonly property int frameMarginLeft: frameMargin
@ -59,9 +61,7 @@ Item {
height: 1.66 * window.height height: 1.66 * window.height
x: (window.width - width) / 2 x: (window.width - width) / 2
y: window.height / 2 - 0.375 * height y: window.height / 2 - 0.375 * height
// FIXME: Alpha gradients display as fuschia under QtQuick 2.5 on OSX/AMD visible: gradientsSupported && window && window.focus && pane.visible
// because shaders are 4.2, and do not include #version declaration.
visible: window && window.focus && pane.visible && Qt.platform.os != "osx" && !~GL.vendor.indexOf("ATI")
gradient: Gradient { gradient: Gradient {
// GradientStop position 0.5 is at full circumference of circle that fits inside the square. // GradientStop position 0.5 is at full circumference of circle that fits inside the square.
GradientStop { position: 0.0; color: "#ff000000" } // black, 100% opacity GradientStop { position: 0.0; color: "#ff000000" } // black, 100% opacity

View file

@ -51,6 +51,7 @@ Fadable {
// property bool pinnable: false // property bool pinnable: false
// property bool pinned: false // property bool pinned: false
property bool resizable: false property bool resizable: false
property bool gradientsSupported: desktop.gradientsSupported
property vector2d minSize: Qt.vector2d(100, 100) property vector2d minSize: Qt.vector2d(100, 100)
property vector2d maxSize: Qt.vector2d(1280, 800) property vector2d maxSize: Qt.vector2d(1280, 800)
@ -142,9 +143,7 @@ Fadable {
} }
LinearGradient { LinearGradient {
// FIXME: Alpha gradients display as fuschia under QtQuick 2.5 on OSX/AMD visible: gradientsSupported && modality != Qt.ApplicationModal
// because shaders are 4.2, and do not include #version declaration.
visible: modality != Qt.ApplicationModal && Qt.platform.os != "osx" && !~GL.vendor.indexOf("ATI")
anchors.top: contentBackground.bottom anchors.top: contentBackground.bottom
anchors.left: contentBackground.left anchors.left: contentBackground.left
width: contentBackground.width - 1 width: contentBackground.width - 1