diff options
author | Katja Marttila <katja.marttila@theqtcompany.com> | 2016-01-04 14:24:09 +0200 |
---|---|---|
committer | Katja Marttila <katja.marttila@theqtcompany.com> | 2016-01-14 09:58:06 +0000 |
commit | 9834944a9d042e3e484bd5cf915f2056473d1b0a (patch) | |
tree | 87fb8bd9230d0c82441343d151388998425fd497 | |
parent | ee4b861ee051bf495382440b29a7a8fb1b69b440 (diff) |
Remove saw edges around demo images
Change-Id: I39089136ec63a957e050ad77a9f969d71e34c0dd
Task-number: QTRD-3798
Reviewed-by: Kimmo Ollila <kimmo.ollila@theqtcompany.com>
-rw-r--r-- | qml/ApplicationIcon.qml | 30 |
1 files changed, 27 insertions, 3 deletions
diff --git a/qml/ApplicationIcon.qml b/qml/ApplicationIcon.qml index 06138c1..94131df 100644 --- a/qml/ApplicationIcon.qml +++ b/qml/ApplicationIcon.qml @@ -35,21 +35,38 @@ Item { asynchronous: true anchors.fill: parent visible: false || !engine.glAvailable - } - + Rectangle { + anchors.fill: parent + color: "transparent" + border.color: "white" + border.width: 2 + } + Rectangle { + anchors.fill: parent + anchors.margins: 2 + color: "transparent" + border.color: "black" + border.width: 2 + } + } + ShaderEffectSource { + id: source + sourceItem: preview + } ShaderEffect { id: shader visible: preview.status == Image.Ready anchors.fill: parent - property variant source: preview + property variant source: source property real x1: appIcon.x1; property real x2: appIcon.x2 - appIcon.x1; property real shift: appIcon.shift; property real selection: appIcon.PathView.isCurrentItem ? 1 : 0.7; + property real border: 1.0 / height * 3 Behavior on selection { NumberAnimation { duration: 300; } @@ -84,9 +101,16 @@ Item { uniform sampler2D source; uniform lowp float selection; + uniform lowp float border; varying highp vec2 v_TexCoord; void main() { + lowp float b_max = 1.0 - border; + lowp float b_min = border; + if (v_TexCoord.x < b_max && v_TexCoord.x > b_min && v_TexCoord.y < b_max && v_TexCoord.y > b_min) { gl_FragColor = vec4(texture2D(source, v_TexCoord).rgb * selection, 1.0) * qt_Opacity; + } else { + gl_FragColor = vec4(texture2D(source, v_TexCoord).rgb * 1.0, 1.0) * qt_Opacity; + } } " } |