on xenial help sign in
display the maximized window's title in the panel, next to the buttons
commit1da1ee8b2de88babed11d2fbf816e25d6227f306 authorLukáš Tinkl <lukas.tinkl@canonical.com> dateTue 27 Oct 2015, 00:30 (11 years ago) parent0d19772
3 files changed+28−1
qml/Panel/Panel.qml+18−1 qml/Stages/DecoratedWindow.qml+1 qml/Stages/DesktopStage.qml+9
qml/Panel/Panel.qml+18−1
@@ -137,7 +137,7 @@ Item {
137137 }
138138
139139 shown: false
140− width: root.width - (windowControlButtons.visible ? windowControlButtons.width : 0)
140+ width: root.width - (windowControlButtons.visible ? windowControlButtons.width + titleLabel.width : 0)
141141 minimizedPanelHeight: units.gu(3)
142142 expandedPanelHeight: units.gu(7)
143143 openedHeight: root.height - indicatorOrangeLine.height
@@ -178,6 +178,23 @@ Item {
178178 onMaximize: PanelState.maximize()
179179 }
180180
181+ Label {
182+ id: titleLabel
183+ objectName: "windowDecorationTitle"
184+ anchors {
185+ left: windowControlButtons.right
186+ top: parent.top
187+ margins: units.gu(0.7)
188+ }
189+ color: "#DFDBD2"
190+ height: windowControlButtons.height
191+ visible: windowControlButtons.visible
192+ verticalAlignment: Text.AlignVCenter
193+ fontSize: "small"
194+ font.bold: true
195+ text: PanelState.title
196+ }
197+
181198 PanelSeparatorLine {
182199 id: indicatorOrangeLine
183200 anchors {
qml/Stages/DecoratedWindow.qml+1
@@ -26,6 +26,7 @@ FocusScope {
2626 property alias window: applicationWindow
2727 property alias application: applicationWindow.application
2828 property alias active: decoration.active
29+ property alias title: decoration.title
2930
3031 property bool decorationShown: true
3132 property bool highlightShown: false
qml/Stages/DesktopStage.qml+9
@@ -211,6 +211,14 @@ Rectangle {
211211 property: "buttonsVisible"
212212 value: priv.focusedAppDelegate !== null && priv.focusedAppDelegate.maximized
213213 }
214+
215+ Binding {
216+ target: PanelState
217+ property: "title"
218+ value: priv.focusedAppDelegate.title
219+ when: priv.focusedAppDelegate && priv.focusedAppDelegate.maximized
220+ }
221+
214222 Component.onDestruction: PanelState.buttonsVisible = false;
215223
216224 FocusScope {
@@ -246,6 +254,7 @@ Rectangle {
246254 property bool minimized: false
247255 readonly property string appId: model.appId
248256 property bool animationsEnabled: true
257+ property alias title: decoratedWindow.title
249258
250259 onFocusChanged: {
251260 if (focus && ApplicationManager.focusedApplicationId !== appId) {