on xenial help sign in
react to window caption changes
f631453Lukáš Tinkl
qml/Stages/ApplicationWindow.qml+2
@@ -25,6 +25,8 @@ FocusScope {
25 readonly property bool fullscreen: application ? application.fullscreen : false
25 readonly property bool fullscreen: application ? application.fullscreen : false
26 property alias interactive: sessionContainer.interactive
26 property alias interactive: sessionContainer.interactive
27 property bool orientationChangesEnabled: d.supportsSurfaceResize ? d.surfaceOldEnoughToBeResized : true
27 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
28
30
29 // to be set from outside
31 // to be set from outside
30 property QtObject application
32 property QtObject application
qml/Stages/DecoratedWindow.qml+1−1
@@ -91,7 +91,7 @@ FocusScope {
91 objectName: application ? "appWindowDecoration_" + application.appId : "appWindowDecoration_null"
91 objectName: application ? "appWindowDecoration_" + application.appId : "appWindowDecoration_null"
92 anchors { left: parent.left; top: parent.top; right: parent.right }
92 anchors { left: parent.left; top: parent.top; right: parent.right }
93 height: units.gu(3)
93 height: units.gu(3)
94− title: model.name
94+ title: window.title !== "" ? window.title : model.name
95 onClose: root.close();
95 onClose: root.close();
96 onMaximize: root.maximize();
96 onMaximize: root.maximize();
97 onMinimize: root.minimize();
97 onMinimize: root.minimize();
qml/Stages/SurfaceContainer.qml+12
@@ -28,6 +28,7 @@ FocusScope {
28 property bool hadSurface: false
28 property bool hadSurface: false
29 property bool interactive
29 property bool interactive
30 property int surfaceOrientationAngle: 0
30 property int surfaceOrientationAngle: 0
31+ property string name: surface && surface.name !== "" ? surface.name : ""
31
32
32 onSurfaceChanged: {
33 onSurfaceChanged: {
33 if (surface) {
34 if (surface) {
@@ -36,6 +37,17 @@ FocusScope {
36 }
37 }
37 }
38 }
38
39
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+
39 InputWatcher {
51 InputWatcher {
40 target: surfaceItem
52 target: surfaceItem
41 onTargetPressedChanged: {
53 onTargetPressedChanged: {