on xenial help sign in
panel improvements
commit8072745fb38fd05b7bc1001f051a29e477637535 authorLukáš Tinkl <lukas.tinkl@canonical.com> dateWed 4 Nov 2015, 03:02 (11 years ago) parent0876c08
7 files changed+41−19
qml/Panel/IndicatorsMenu.qml+2−2 qml/Panel/MenuContent.qml+1−1 qml/Panel/Panel.qml+20−10 qml/Panel/PanelBackground.qml+1−1 qml/Stages/DecoratedWindow.qml+1−2 qml/Stages/DesktopStage.qml+13−3 qml/Stages/WindowDecoration.qml+3
qml/Panel/IndicatorsMenu.qml+2−2
@@ -38,7 +38,7 @@ Showable {
3838 property bool enableHint: true
3939 property bool contentEnabled: true
4040 property bool showOnClick: true
41− property color panelColor: "black"
41+ property color panelColor: "#333333"
4242
4343 signal showTapped(point position)
4444
@@ -110,7 +110,7 @@ Showable {
110110 height: units.gu(0.5)
111111 gradient: Gradient {
112112 GradientStop { position: 0.0; color: "transparent" }
113− GradientStop { position: 1.0; color: "black" }
113+ GradientStop { position: 1.0; color: "#333333" }
114114 }
115115 opacity: 0.3
116116 }
qml/Panel/MenuContent.qml+1−1
@@ -27,7 +27,7 @@ Rectangle {
2727
2828 property QtObject indicatorsModel: null
2929 property int currentMenuIndex: -1
30− color: "#221e1c" // FIXME not in palette yet
30+ color: "#333333" // FIXME not in palette yet
3131
3232 width: units.gu(40)
3333 height: units.gu(42)
qml/Panel/Panel.qml+20−10
@@ -39,7 +39,7 @@ Item {
3939 fill: parent
4040 topMargin: panelHeight
4141 }
42− color: "#333333"
42+ color: "black"
4343 opacity: indicators.unitProgress * darkenedOpacity
4444 visible: !indicators.fullyClosed
4545
@@ -57,7 +57,7 @@ Item {
5757 anchors.fill: parent
5858
5959 Behavior on anchors.topMargin {
60− NumberAnimation { duration: UbuntuAnimation.FastDuration; easing: UbuntuAnimation.StandardEasing }
60+ UbuntuNumberAnimation {}
6161 }
6262
6363 transform: Translate {
@@ -115,13 +115,16 @@ Item {
115115 }
116116
117117 MouseArea {
118+ id: mouseArea
118119 anchors {
119120 top: parent.top
120121 left: parent.left
121122 right: indicators.left
122123 }
123124 height: indicators.minimizedPanelHeight
125+ hoverEnabled: true
124126 onClicked: { if (callHint.visible) { callHint.showLiveCall(); } }
127+ onDoubleClicked: PanelState.maximize()
125128 }
126129
127130 IndicatorsMenu {
@@ -166,10 +169,13 @@ Item {
166169 anchors {
167170 left: parent.left
168171 top: parent.top
169− margins: units.gu(0.7)
172+ leftMargin: units.gu(1)
173+ topMargin: units.gu(0.5)
174+ bottomMargin: units.gu(0.5)
170175 }
171− height: indicators.minimizedPanelHeight - anchors.margins * 2
172− visible: PanelState.buttonsVisible && !root.locked
176+ height: indicators.minimizedPanelHeight - anchors.topMargin - anchors.bottomMargin
177+ visible: PanelState.buttonsVisible && mouseArea.containsMouse && !root.locked && !callHint.visible
178+ active: PanelState.buttonsVisible
173179 onClose: PanelState.close()
174180 onMinimize: PanelState.minimize()
175181 onMaximize: PanelState.maximize()
@@ -179,19 +185,23 @@ Item {
179185 id: titleLabel
180186 objectName: "windowDecorationTitle"
181187 anchors {
182− left: PanelState.buttonsVisible ? windowControlButtons.right : parent.left // FIXME this should be separate from the buttons, also based on LIM
188+ left: parent.left
183189 top: parent.top
184− margins: units.gu(0.7)
190+ leftMargin: units.gu(1)
191+ topMargin: units.gu(0.5)
192+ bottomMargin: units.gu(0.5)
185193 }
186194 color: PanelState.buttonsVisible ? "#ffffff" : "#5d5d5d"
187− height: windowControlButtons.height
188− visible: true // TODO the title should exchange with the menu on mouse hover
195+ height: indicators.minimizedPanelHeight - anchors.topMargin - anchors.bottomMargin
196+ visible: !windowControlButtons.visible && !root.locked && !callHint.visible
189197 verticalAlignment: Text.AlignVCenter
190198 fontSize: "medium"
191− font.weight: Font.Light
199+ font.weight: Font.Normal
192200 text: PanelState.title
193201 }
194202
203+ // TODO here would the LIM come
204+
195205 PanelSeparatorLine {
196206 id: indicatorOrangeLine
197207 anchors {
qml/Panel/PanelBackground.qml+1−1
@@ -17,5 +17,5 @@
1717import QtQuick 2.0
1818
1919Rectangle {
20− color: "black"
20+ color: "#333333"
2121}
qml/Stages/DecoratedWindow.qml+1−2
@@ -31,7 +31,6 @@ FocusScope {
3131
3232 property bool decorationShown: true
3333 property bool highlightShown: false
34− property real shadowOpacity: 1
3534
3635 signal close()
3736 signal maximize()
@@ -53,7 +52,7 @@ FocusScope {
5352 visible: highlightShown
5453 }
5554
56− RectangularGlow {
55+ RectangularGlow { // drop shadow around the window
5756 anchors.fill: parent
5857 color: "#333333"
5958 glowRadius: active ? units.dp(6) : units.dp(4)
qml/Stages/DesktopStage.qml+13−3
@@ -175,7 +175,8 @@ Rectangle {
175175 ApplicationManager.stopApplication(ApplicationManager.focusedApplicationId)
176176 }
177177 onMinimize: appRepeater.itemAt(0).minimize(true);
178− onMaximize: appRepeater.itemAt(0).restore();
178+ onMaximize: priv.focusedAppDelegate // don't restore minimized apps when double clicking the panel
179+ && priv.focusedAppDelegate.restore();
179180 }
180181
181182 Binding {
@@ -187,8 +188,16 @@ Rectangle {
187188 Binding {
188189 target: PanelState
189190 property: "title"
190− value: priv.focusedAppDelegate !== null && priv.focusedAppDelegate.title
191− when: priv.focusedAppDelegate && priv.focusedAppDelegate.maximized
191+ value: {
192+ if (priv.focusedAppDelegate !== null) {
193+ if (priv.focusedAppDelegate.maximized)
194+ return priv.focusedAppDelegate.title
195+ else
196+ return priv.focusedAppDelegate.appName
197+ }
198+ return ""
199+ }
200+ when: priv.focusedAppDelegate
192201 }
193202
194203 Component.onDestruction: PanelState.buttonsVisible = false;
@@ -227,6 +236,7 @@ Rectangle {
227236 readonly property string appId: model.appId
228237 property bool animationsEnabled: true
229238 property alias title: decoratedWindow.title
239+ readonly property string appName: model.name
230240
231241 onFocusChanged: {
232242 if (focus && ApplicationManager.focusedApplicationId !== appId) {
qml/Stages/WindowDecoration.qml+3
@@ -32,6 +32,8 @@ MouseArea {
3232 signal minimize()
3333 signal maximize()
3434
35+ onDoubleClicked: root.maximize()
36+
3537 QtObject {
3638 id: priv
3739 property real distanceX
@@ -71,6 +73,7 @@ MouseArea {
7173 anchors {
7274 fill: parent
7375 leftMargin: units.gu(1)
76+ rightMargin: units.gu(1)
7477 topMargin: units.gu(0.5)
7578 bottomMargin: units.gu(0.5)
7679 }