react to window caption changes
commitf6314531c6037c5ce453374f05d1714fff9404f9
authorLukáš Tinkl <lukas.tinkl@canonical.com>
dateFri 25 Sep 2015, 23:10 (11 years ago)
parent8fe7c59
qml/Stages/ApplicationWindow.qml+2
@@ -25,6 +25,8 @@ FocusScope {
2525 readonly property bool fullscreen: application ? application.fullscreen : false
2626 property alias interactive: sessionContainer.interactive
2727 property bool orientationChangesEnabled: d.supportsSurfaceResize ? d.surfaceOldEnoughToBeResized : true
28+ readonly property string title: sessionContainer.surfaceContainer.surface && sessionContainer.surfaceContainer.surface.name !== "" ?
29+ sessionContainer.surfaceContainer.surface.name : d.name
2830
2931 // to be set from outside
3032 property QtObject application
qml/Stages/DecoratedWindow.qml+1−1
@@ -91,7 +91,7 @@ FocusScope {
9191 objectName: application ? "appWindowDecoration_" + application.appId : "appWindowDecoration_null"
9292 anchors { left: parent.left; top: parent.top; right: parent.right }
9393 height: units.gu(3)
94− title: model.name
94+ title: window.title !== "" ? window.title : model.name
9595 onClose: root.close();
9696 onMaximize: root.maximize();
9797 onMinimize: root.minimize();
qml/Stages/SurfaceContainer.qml+12
@@ -28,6 +28,7 @@ FocusScope {
2828 property bool hadSurface: false
2929 property bool interactive
3030 property int surfaceOrientationAngle: 0
31+ property string name: surface && surface.name !== "" ? surface.name : ""
3132
3233 onSurfaceChanged: {
3334 if (surface) {
@@ -36,6 +37,17 @@ FocusScope {
3637 }
3738 }
3839
40+ Connections {
41+ target: root.surface
42+ onNameChanged: {
43+ print("SURFACE RENAMED")
44+ if (name !== "") {
45+ print("RENAMING SURFACE", name);
46+ root.name = name;
47+ }
48+ }
49+ }
50+
3951 InputWatcher {
4052 target: surfaceItem
4153 onTargetPressedChanged: {