on xenial help sign in
add a gsettings schema to select the usage mode
commitfff8cf812174e4613210f3f1572031fbfdf3e3c8 authorMichael Zanetti <michael.zanetti@canonical.com> dateWed 19 Nov 2014, 14:39 (12 years ago) parente5eb93d
4 files changed+27−10
com.canonical.Unity8.gschema.xml+14 debian/unity8-common.install+1 qml/Shell.qml+7−2 qml/Stages/DesktopStage.qml+5−8
com.canonical.Unity8.gschema.xmlnew file+14
@@ -0,0 +1,14 @@
1+<schemalist>
2+ <enum id="usage-mode-enum">
3+ <value nick="Spread" value="0" />
4+ <value nick="Windowed" value="1" />
5+ </enum>
6+
7+ <schema path="/com/canonical/unity8/" id="com.canonical.Unity8" gettext-domain="unity8">
8+ <key enum="usage-mode-enum" name="usageMode">
9+ <default>"Spread"</default>
10+ <summary>The usage mode.</summary>
11+ <description>The usage mode chosen will affect the Window Management behaviour.</description>
12+ </key>
13+ </schema>
14+</schemalist>
debian/unity8-common.install+1
@@ -3,3 +3,4 @@ usr/share/unity8/Components
33usr/share/unity8/Dash
44usr/share/unity8/Notifications
55usr/share/unity8/graphics
6+com.canonical.Unity8.gschema.xml usr/share/glib-2.0/schemas/
qml/Shell.qml+7−2
@@ -254,8 +254,13 @@ Item {
254254 // the screen larger (maybe connects to monitor) and tries to enter
255255 // tablet mode.
256256 property bool tabletMode: shell.sideStageEnabled && !greeter.hasLockedApp
257− //source: tabletMode ? "Stages/TabletStage.qml" : "Stages/PhoneStage.qml"
258− source: "Stages/DesktopStage.qml"
257+ source: usageModeSettings.usageMode === "Windowed" ? "Stages/DesktopStage.qml"
258+ : tabletMode ? "Stages/TabletStage.qml" : "Stages/PhoneStage.qml"
259+
260+ GSettings {
261+ id: usageModeSettings
262+ schema.id: "com.canonical.Unity8"
263+ }
259264
260265 Binding {
261266 target: applicationsDisplayLoader.item
qml/Stages/DesktopStage.qml+5−8
@@ -10,8 +10,9 @@ Item {
1010 Connections {
1111 target: ApplicationManager
1212 onApplicationAdded: {
13+ // Initial placement to avoid having the window decoration behind the panel
14+ appRepeater.itemAt(ApplicationManager.count-1).y = units.gu(3)
1315 ApplicationManager.requestFocusApplication(ApplicationManager.get(ApplicationManager.count-1).appId)
14−// ApplicationManager.move(ApplicationManager.count - 1, 0)
1516 }
1617
1718 onFocusRequested: {
@@ -32,8 +33,6 @@ Item {
3233 }
3334 return -1;
3435 }
35−
36−
3736 }
3837
3938 Repeater {
@@ -42,8 +41,6 @@ Item {
4241
4342 delegate: Item {
4443 id: appDelegate
45− x: units.gu(5)
46− y: units.gu(5)
4744 height: units.gu(30)
4845 width: units.gu(30)
4946 z: ApplicationManager.count - index
@@ -58,12 +55,12 @@ Item {
5855 },
5956 State {
6057 name: "minimized"
61− PropertyChanges { target: appDelegate; x: 0; width: units.gu(5); height: units.gu(5); opacity: 0 }
58+ PropertyChanges { target: appDelegate; x: -appDelegate.width / 2; scale: units.gu(5) / appDelegate.width; opacity: 0 }
6259 }
6360 ]
6461 transitions: [
6562 Transition {
66− PropertyAnimation { target: appDelegate; properties: "x,y,opacity,width,height" }
63+ PropertyAnimation { target: appDelegate; properties: "x,y,opacity,width,height,scale" }
6764 }
6865 ]
6966
@@ -129,7 +126,7 @@ Item {
129126 height: units.gu(3)
130127 title: model.name
131128 onClose: ApplicationManager.stopApplication(model.appId)
132− onMaximize: appDelegate.state = "maximized"
129+ onMaximize: appDelegate.state = (appDelegate.state == "maximized" ? "normal" : "maximized")
133130 onMinimize: appDelegate.state = "minimized"
134131 }
135132