on xenial help sign in
fix maxmimze transitions and states
commitf34e98fba4df1eb33b247a049d000bea2002a994 authorMichael Zanetti <michael.zanetti@canonical.com> dateFri 5 Aug 2016, 13:47 (10 years ago) parent9891641
2 files changed+36−20
qml/Stage/Stage.qml+35−19 tests/mocks/Unity/Application/MirSurfaceItem.cpp+1−1
qml/Stage/Stage.qml+35−19
@@ -913,8 +913,8 @@ AbstractStage {
913913 name: "maximized"; when: root.state === "windowed" && appDelegate.maximized && !appDelegate.minimized
914914 PropertyChanges {
915915 target: appDelegate;
916− x: root.leftMargin;
917− y: 0;
916+ requestedX: root.leftMargin;
917+ requestedY: 0;
918918 visuallyMinimized: false;
919919 visuallyMaximized: true
920920 requestedWidth: appContainer.width - root.leftMargin;
@@ -925,8 +925,8 @@ AbstractStage {
925925 name: "fullscreen"; when: surface ? surface.state === Mir.FullscreenState : application.fullscreen && !appDelegate.minimized
926926 PropertyChanges {
927927 target: appDelegate;
928− x: rotation == 0 ? 0 : (parent.width - width) / 2 + (shellOrientationAngle == 90 ? 0 : PanelState.panelHeight)
929− y: rotation == 0 ? 0 : (parent.height - height) / 2
928+ requestedX: rotation == 0 ? 0 : (parent.width - width) / 2 + (shellOrientationAngle == 90 ? 0 : PanelState.panelHeight)
929+ requestedY: rotation == 0 ? 0 : (parent.height - height) / 2
930930 requestedWidth: appContainer.width;
931931 requestedHeight: appContainer.height;
932932 }
@@ -952,13 +952,13 @@ AbstractStage {
952952 name: "maximizedLeft"; when: appDelegate.maximizedLeft && !appDelegate.minimized
953953 PropertyChanges {
954954 target: appDelegate
955− x: root.leftMargin
956− y: PanelState.panelHeight
955+ requestedX: root.leftMargin
956+ requestedY: PanelState.panelHeight
957+ requestedWidth: (appContainer.width - root.leftMargin)/2
958+ requestedHeight: appContainer.height - PanelState.panelHeight
957959 }
958960 PropertyChanges {
959961 target: decoratedWindow
960− requestedWidth: (appContainer.width - root.leftMargin)/2
961− requestedHeight: appContainer.height - PanelState.panelHeight
962962 shadowOpacity: .3
963963 }
964964 },
@@ -966,31 +966,41 @@ AbstractStage {
966966 name: "maximizedRight"; when: appDelegate.maximizedRight && !appDelegate.minimized
967967 PropertyChanges {
968968 target: appDelegate;
969− x: (appContainer.width + root.leftMargin)/2
970− y: PanelState.panelHeight
969+ requestedX: (appContainer.width + root.leftMargin)/2
970+ requestedY: PanelState.panelHeight
971+ requestedWidth: (appContainer.width - root.leftMargin)/2
972+ requestedHeight: appContainer.height - PanelState.panelHeight
971973 }
972974 PropertyChanges {
973975 target: decoratedWindow
974− requestedWidth: (appContainer.width - root.leftMargin)/2
975− requestedHeight: appContainer.height - PanelState.panelHeight
976976 shadowOpacity: .3
977977 }
978978 },
979979 State {
980980 name: "maximizedHorizontally"; when: appDelegate.maximizedHorizontally && !appDelegate.minimized
981− PropertyChanges { target: appDelegate; x: root.leftMargin }
982981 PropertyChanges {
983− target: decoratedWindow;
982+ target: appDelegate;
983+ requestedX: root.leftMargin
984+ requestedY: appDelegate.windowedY
984985 requestedWidth: appContainer.width - root.leftMargin
986+ requestedHeight: appDelegate.windowedHeight
987+ }
988+ PropertyChanges {
989+ target: decoratedWindow;
985990 shadowOpacity: .3
986991 }
987992 },
988993 State {
989994 name: "maximizedVertically"; when: appDelegate.maximizedVertically && !appDelegate.minimized
990− PropertyChanges { target: appDelegate; y: PanelState.panelHeight }
991995 PropertyChanges {
992− target: decoratedWindow;
996+ target: appDelegate;
997+ requestedX: appDelegate.windowedX
998+ requestedY: PanelState.panelHeight
999+ requestedWidth: appDelegate.windowedWidth
9931000 requestedHeight: appContainer.height - PanelState.panelHeight
1001+ }
1002+ PropertyChanges {
1003+ target: decoratedWindow;
9941004 shadowOpacity: .3
9951005 }
9961006 },
@@ -1015,10 +1025,16 @@ AbstractStage {
10151025 UbuntuNumberAnimation { target: appDelegate; properties: "x,y,opacity,requestedWidth,requestedHeight,scale"; duration: priv.animationDuration }
10161026 },
10171027 Transition {
1018− from: "maximized"; to: "normal"
1028+ from: "maximized,maximizedHorizontally,maximizedVertically,maximizedLeft,maximizedRight"; to: "normal"
1029+ enabled: appDelegate.animationsEnabled
1030+ PropertyAction { target: appDelegate; properties: "visuallyMinimized,visuallyMaximized" }
1031+ UbuntuNumberAnimation { target: appDelegate; properties: "requestedX,requestedY,requestedWidth,requestedHeight"; duration: priv.animationDuration }
1032+ },
1033+ Transition {
1034+ from: "normal"; to: "maximized,maximizedHorizontally,maximizedVertically,maximizedLeft,maximizedRight"
10191035 enabled: appDelegate.animationsEnabled
10201036 PropertyAction { target: appDelegate; properties: "visuallyMinimized,visuallyMaximized" }
1021− UbuntuNumberAnimation { target: appDelegate; properties: "x,y,requestedWidth,requestedHeight"; duration: priv.animationDuration }
1037+ UbuntuNumberAnimation { target: appDelegate; properties: "requestedX,requestedY,requestedWidth,requestedHeight"; duration: priv.animationDuration }
10221038 },
10231039 Transition {
10241040 from: "spread"; to: "*"
@@ -1052,7 +1068,7 @@ AbstractStage {
10521068 SequentialAnimation {
10531069 PropertyAction { target: appDelegate; property: "visuallyMinimized" }
10541070 ParallelAnimation {
1055− UbuntuNumberAnimation { target: appDelegate; properties: "x,y,opacity,scale,requestedWidth,requestedHeight"; duration: UbuntuAnimation.FastDuration }
1071+ UbuntuNumberAnimation { target: appDelegate; properties: "requestedX,requestedY,opacity,scale,requestedWidth,requestedHeight"; duration: UbuntuAnimation.FastDuration }
10561072 }
10571073 PropertyAction { target: appDelegate; property: "visuallyMaximized" }
10581074 }
tests/mocks/Unity/Application/MirSurfaceItem.cpp+1−1
@@ -330,7 +330,7 @@ int MirSurfaceItem::surfaceWidth() const
330330
331331void MirSurfaceItem::setSurfaceWidth(int value)
332332{
333− qDebug() << "setSurfaceWidth called" << value;
333+// qDebug() << "setSurfaceWidth called" << value;
334334 if (value != -1 && m_surfaceWidth != value) {
335335 m_surfaceWidth = value;
336336 Q_EMIT surfaceWidthChanged(m_surfaceWidth);