on xenial help sign in
revert rounded window corners

plus some colors fixes for the demos

commit25b08e4213639b5fa92d20268f84dc1b1ef636fa authorLukáš Tinkl <lukas.tinkl@canonical.com> dateTue 29 Mar 2016, 11:21 (11 years ago) parentac673fc
5 files changed+26−66
qml/Stages/DecoratedWindow.qml+11 qml/Stages/DesktopStage.qml−57 qml/Stages/WindowDecoration.qml+4 tests/qmltests/Stages/SurfaceManagerControls.qml+6−7 tests/qmltests/Stages/tst_DesktopStage.qml+5−2
qml/Stages/DecoratedWindow.qml+11
@@ -34,6 +34,7 @@ FocusScope {
3434
3535 readonly property bool decorationShown: !fullscreen
3636 property bool highlightShown: false
37+ property real shadowOpacity: 1
3738
3839 property alias requestedWidth: applicationWindow.requestedWidth
3940 property real requestedHeight
@@ -65,6 +66,16 @@ FocusScope {
6566 visible: highlightShown
6667 }
6768
69+ BorderImage {
70+ anchors {
71+ fill: root
72+ margins: active ? -units.gu(2) : -units.gu(1.5)
73+ }
74+ source: "graphics/dropshadow2gu.sci"
75+ opacity: root.shadowOpacity * .3
76+ visible: !fullscreen
77+ }
78+
6879 WindowDecoration {
6980 id: decoration
7081 target: root.parent
qml/Stages/DesktopStage.qml−57
@@ -544,63 +544,6 @@ AbstractStage {
544544 onDecorationPressed: { ApplicationManager.focusApplication(model.appId) }
545545 }
546546
547− BorderImage {
548− anchors {
549− fill: decoratedWindow
550− margins: decoratedWindow.active ? -units.gu(2) : -units.gu(1.5)
551− }
552− source: "graphics/dropshadow2gu.sci"
553− opacity: .3
554− visible: !decoratedWindow.fullscreen && !appDelegate.maximized
555− enabled: visible
556− }
557−
558− Rectangle {
559− id: mask
560− radius: appDelegate.maximized ? 0 : units.gu(.7) // disable rounded corners when maximized
561− anchors.fill: decoratedWindow
562− }
563−
564− ShaderEffectSource {
565− id: sourceMask
566− hideSource: true
567− sourceItem: mask
568− }
569−
570− ShaderEffectSource {
571− id: sourceImage
572− hideSource: !decoratedWindow.fullscreen
573− sourceItem: decoratedWindow
574− }
575−
576− ShaderEffect {
577− id: maskEffect
578− anchors.fill: mask
579− blending: false
580− enabled: state == "normal" || state == "closing"
581− || appDelegate.maximizedLeft || appDelegate.maximizedRight
582−
583− property variant sourceTexture: sourceImage
584− property variant maskTexture: sourceMask
585−
586− fragmentShader: "
587− uniform sampler2D sourceTexture;
588− uniform sampler2D maskTexture;
589− varying highp vec2 qt_TexCoord0;
590−
591− void main()
592− {
593− highp vec4 c = texture2D(sourceTexture, qt_TexCoord0);
594− highp vec4 m = texture2D(maskTexture, qt_TexCoord0);
595−
596− if (m.a == 0.0) // if the mask is transparent, discard the pixel
597− discard;
598− else
599− gl_FragColor = c; // otherwise use the original color
600− }
601− "
602− }
603−
604547 WindowedFullscreenPolicy {
605548 id: fullscreenPolicy
606549 active: true
qml/Stages/WindowDecoration.qml+4
@@ -22,6 +22,7 @@ import "../Components/PanelState"
2222
2323MouseArea {
2424 id: root
25+ clip: true
2526
2627 property Item target
2728 property alias title: titleLabel.text
@@ -63,6 +64,9 @@ MouseArea {
6364 }
6465
6566 Rectangle {
67+ anchors.fill: parent
68+ anchors.bottomMargin: -radius
69+ radius: units.gu(.5)
6670 color: theme.palette.normal.background
6771 }
6872
tests/qmltests/Stages/SurfaceManagerControls.qml+6−7
@@ -20,14 +20,13 @@ import Unity.Application 0.1
2020
2121Column {
2222 id: root
23− property color textColor: "black"
2423
2524 Label {text: "Size hints for new surface:"; color: root.textColor; font.bold: true}
2625
27− SurfaceManagerField { text: "min width"; propertyName: "newSurfaceMinimumWidth"; textColor: root.textColor }
28− SurfaceManagerField { text: "max width"; propertyName: "newSurfaceMaximumWidth"; textColor: root.textColor }
29− SurfaceManagerField { text: "min height"; propertyName: "newSurfaceMinimumHeight"; textColor: root.textColor }
30− SurfaceManagerField { text: "max height"; propertyName: "newSurfaceMaximumHeight"; textColor: root.textColor }
31− SurfaceManagerField { text: "width increment"; propertyName: "newSurfaceWidthIncrement"; textColor: root.textColor }
32− SurfaceManagerField { text: "height increment"; propertyName: "newSurfaceHeightIncrement"; textColor: root.textColor }
26+ SurfaceManagerField { text: "min width"; propertyName: "newSurfaceMinimumWidth"; }
27+ SurfaceManagerField { text: "max width"; propertyName: "newSurfaceMaximumWidth"; }
28+ SurfaceManagerField { text: "min height"; propertyName: "newSurfaceMinimumHeight"; }
29+ SurfaceManagerField { text: "max height"; propertyName: "newSurfaceMaximumHeight"; }
30+ SurfaceManagerField { text: "width increment"; propertyName: "newSurfaceWidthIncrement"; }
31+ SurfaceManagerField { text: "height increment"; propertyName: "newSurfaceHeightIncrement"; }
3332}
tests/qmltests/Stages/tst_DesktopStage.qml+5−2
@@ -40,7 +40,10 @@ Item {
4040 value: false
4141 }
4242
43− Component.onCompleted: resetGeometry()
43+ Component.onCompleted: {
44+ theme.name = "Ubuntu.Components.Themes.SuruDark";
45+ resetGeometry();
46+ }
4447
4548 function resetGeometry() {
4649 // ensures apps which are tested decorations are in view.
@@ -82,7 +85,7 @@ Item {
8285 Rectangle {
8386 id: controls
8487 width: units.gu(30)
85− color: "darkgrey"
88+ color: theme.palette.normal.background
8689 anchors {
8790 top: parent.top
8891 bottom: parent.bottom