on xenial help sign in
revert rounded window corners
25b08e4Lukáš Tinkl
qml/Stages/DecoratedWindow.qml+11
@@ -34,6 +34,7 @@ FocusScope {
34
34
35 readonly property bool decorationShown: !fullscreen
35 readonly property bool decorationShown: !fullscreen
36 property bool highlightShown: false
36 property bool highlightShown: false
37+ property real shadowOpacity: 1
37
38
38 property alias requestedWidth: applicationWindow.requestedWidth
39 property alias requestedWidth: applicationWindow.requestedWidth
39 property real requestedHeight
40 property real requestedHeight
@@ -65,6 +66,16 @@ FocusScope {
65 visible: highlightShown
66 visible: highlightShown
66 }
67 }
67
68
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+
68 WindowDecoration {
79 WindowDecoration {
69 id: decoration
80 id: decoration
70 target: root.parent
81 target: root.parent
qml/Stages/DesktopStage.qml−57
@@ -544,63 +544,6 @@ AbstractStage {
544 onDecorationPressed: { ApplicationManager.focusApplication(model.appId) }
544 onDecorationPressed: { ApplicationManager.focusApplication(model.appId) }
545 }
545 }
546
546
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−
604 WindowedFullscreenPolicy {
547 WindowedFullscreenPolicy {
605 id: fullscreenPolicy
548 id: fullscreenPolicy
606 active: true
549 active: true
qml/Stages/WindowDecoration.qml+4
@@ -22,6 +22,7 @@ import "../Components/PanelState"
22
22
23MouseArea {
23MouseArea {
24 id: root
24 id: root
25+ clip: true
25
26
26 property Item target
27 property Item target
27 property alias title: titleLabel.text
28 property alias title: titleLabel.text
@@ -63,6 +64,9 @@ MouseArea {
63 }
64 }
64
65
65 Rectangle {
66 Rectangle {
67+ anchors.fill: parent
68+ anchors.bottomMargin: -radius
69+ radius: units.gu(.5)
66 color: theme.palette.normal.background
70 color: theme.palette.normal.background
67 }
71 }
68
72
tests/qmltests/Stages/SurfaceManagerControls.qml+6−7
@@ -20,14 +20,13 @@ import Unity.Application 0.1
20
20
21Column {
21Column {
22 id: root
22 id: root
23− property color textColor: "black"
24
23
25 Label {text: "Size hints for new surface:"; color: root.textColor; font.bold: true}
24 Label {text: "Size hints for new surface:"; color: root.textColor; font.bold: true}
26
25
27− SurfaceManagerField { text: "min width"; propertyName: "newSurfaceMinimumWidth"; textColor: root.textColor }
26+ SurfaceManagerField { text: "min width"; propertyName: "newSurfaceMinimumWidth"; }
28− SurfaceManagerField { text: "max width"; propertyName: "newSurfaceMaximumWidth"; textColor: root.textColor }
27+ SurfaceManagerField { text: "max width"; propertyName: "newSurfaceMaximumWidth"; }
29− SurfaceManagerField { text: "min height"; propertyName: "newSurfaceMinimumHeight"; textColor: root.textColor }
28+ SurfaceManagerField { text: "min height"; propertyName: "newSurfaceMinimumHeight"; }
30− SurfaceManagerField { text: "max height"; propertyName: "newSurfaceMaximumHeight"; textColor: root.textColor }
29+ SurfaceManagerField { text: "max height"; propertyName: "newSurfaceMaximumHeight"; }
31− SurfaceManagerField { text: "width increment"; propertyName: "newSurfaceWidthIncrement"; textColor: root.textColor }
30+ SurfaceManagerField { text: "width increment"; propertyName: "newSurfaceWidthIncrement"; }
32− SurfaceManagerField { text: "height increment"; propertyName: "newSurfaceHeightIncrement"; textColor: root.textColor }
31+ SurfaceManagerField { text: "height increment"; propertyName: "newSurfaceHeightIncrement"; }
33}
32}
tests/qmltests/Stages/tst_DesktopStage.qml+5−2
@@ -40,7 +40,10 @@ Item {
40 value: false
40 value: false
41 }
41 }
42
42
43− Component.onCompleted: resetGeometry()
43+ Component.onCompleted: {
44+ theme.name = "Ubuntu.Components.Themes.SuruDark";
45+ resetGeometry();
46+ }
44
47
45 function resetGeometry() {
48 function resetGeometry() {
46 // ensures apps which are tested decorations are in view.
49 // ensures apps which are tested decorations are in view.
@@ -82,7 +85,7 @@ Item {
82 Rectangle {
85 Rectangle {
83 id: controls
86 id: controls
84 width: units.gu(30)
87 width: units.gu(30)
85− color: "darkgrey"
88+ color: theme.palette.normal.background
86 anchors {
89 anchors {
87 top: parent.top
90 top: parent.top
88 bottom: parent.bottom
91 bottom: parent.bottom