on xenial help sign in
make it work with the real ApplicationManager
commitae38fdae951367f22294cf9055f000f22d3d490d authorMichael Zanetti <michael.zanetti@canonical.com> dateWed 9 Sep 2015, 15:44 (11 years ago) parent0052533
6 files changed+23−17
qml/Components/BlurLayer.qml+1−1 qml/Stages/ApplicationWindow.qml+3 qml/Stages/DesktopSpreadDelegate.qml+4−3 qml/Stages/DesktopStage.qml+9−11 qml/Stages/SessionContainer.qml+3 qml/Stages/SurfaceContainer.qml+3−2
qml/Components/BlurLayer.qml+1−1
@@ -38,7 +38,7 @@ Item {
3838 {
3939 highp vec4 sourceColor = texture2D(source, qt_TexCoord0);
4040 highp vec4 scaledColor = sourceColor * vec4(0.3, 0.59, 0.11, 1.0);
41− float luminance = scaledColor.r + scaledColor.g + scaledColor.b ;
41+ lowp float luminance = scaledColor.r + scaledColor.g + scaledColor.b ;
4242 gl_FragColor = mix(vec4(luminance, luminance, luminance, sourceColor.a), sourceColor, saturationValue);
4343 }"
4444 }
qml/Stages/ApplicationWindow.qml+3
@@ -20,6 +20,8 @@ import Unity.Application 0.1
2020
2121FocusScope {
2222 id: root
23+ implicitWidth: sessionContainer.implicitWidth
24+ implicitHeight: sessionContainer.implicitHeight
2325
2426 // to be read from outside
2527 readonly property bool fullscreen: application ? application.fullscreen : false
@@ -29,6 +31,7 @@ FocusScope {
2931 // to be set from outside
3032 property QtObject application
3133 property int surfaceOrientationAngle
34+ property alias resizeSurface: sessionContainer.resizeSurface
3235
3336 QtObject {
3437 id: d
qml/Stages/DesktopSpreadDelegate.qml+4−3
@@ -29,8 +29,8 @@ Item {
2929 property bool highlightShown: false
3030 property real shadowOpacity: 1
3131
32− property int windowWidth: width
33− property int windowHeight: height
32+ property int windowWidth: application.session.surface.size.width
33+ property int windowHeight: application.session.surface.size.height
3434
3535 state: "normal"
3636 states: [
@@ -93,7 +93,8 @@ Item {
9393 width: root.windowWidth
9494 height: root.windowHeight
9595 interactive: false
96− focus: true
96+ resizeSurface: false
97+ focus: false
9798
9899 property real itemScale: 1
99100 transform: [
qml/Stages/DesktopStage.qml+9−11
@@ -109,13 +109,6 @@ Rectangle {
109109 value: priv.focusedAppDelegate !== null && priv.focusedAppDelegate.state === "maximized"
110110 }
111111
112− Rectangle {
113− id: spreadBackground
114− anchors.fill: parent
115− color: "#55000000"
116− visible: false
117− }
118−
119112 FocusScope {
120113 id: appContainer
121114 objectName: "appContainer"
@@ -295,6 +288,13 @@ Rectangle {
295288 visible: false
296289 }
297290
291+ Rectangle {
292+ id: spreadBackground
293+ anchors.fill: parent
294+ color: "#55000000"
295+ visible: false
296+ }
297+
298298 Item {
299299 id: spreadContainer
300300 visible: false
@@ -340,9 +340,9 @@ Rectangle {
340340 objectName: "clippedSpreadDelegate"
341341 anchors.left: parent.left
342342 anchors.top: parent.top
343− windowWidth: parent.width
344− windowHeight: parent.height
345343 application: ApplicationManager.get(index)
344+ width: spreadMaths.spreadHeight
345+ height: spreadMaths.spreadHeight
346346
347347 transform: [
348348 Scale {
@@ -397,8 +397,6 @@ Rectangle {
397397 target: clippedSpreadDelegate
398398 highlightShown: index == spreadRepeater.highlightedIndex
399399 state: "transformed"
400− width: spreadMaths.spreadHeight
401− height: spreadMaths.spreadHeight
402400 shadowOpacity: spreadMaths.shadowOpacity
403401 anchors.topMargin: units.gu(2)
404402 }
qml/Stages/SessionContainer.qml+3
@@ -20,11 +20,14 @@ import "Animations"
2020FocusScope {
2121 id: root
2222 objectName: "sessionContainer"
23+ implicitWidth: _surfaceContainer.implicitWidth
24+ implicitHeight: _surfaceContainer.implicitHeight
2325 property QtObject session
2426 readonly property var childSessions: session ? session.childSessions : null
2527 readonly property alias surface: _surfaceContainer.surface
2628 property alias interactive: _surfaceContainer.interactive
2729 property alias surfaceOrientationAngle: _surfaceContainer.surfaceOrientationAngle
30+ property alias resizeSurface: _surfaceContainer.resizeSurface
2831
2932 readonly property alias surfaceContainer: _surfaceContainer
3033 SurfaceContainer {
qml/Stages/SurfaceContainer.qml+3−2
@@ -28,6 +28,7 @@ FocusScope {
2828 property bool hadSurface: false
2929 property bool interactive
3030 property int surfaceOrientationAngle: 0
31+ property bool resizeSurface: true
3132
3233 onSurfaceChanged: {
3334 if (surface) {
@@ -52,8 +53,8 @@ FocusScope {
5253
5354 consumesInput: true
5455
55− surfaceWidth: width
56− surfaceHeight: height
56+ surfaceWidth: root.resizeSurface ? width : -1
57+ surfaceHeight: root.resizeSurface ? height : -1
5758
5859 anchors.fill: root
5960 enabled: root.interactive