on xenial help sign in
more fixes for the new theme palette Fixes: #1554616, #1557534
7999aeaMichael Zanetti
qml/Components/ShellDialog.qml+3−1
@@ -17,6 +17,7 @@
17import QtQuick 2.4
17import QtQuick 2.4
18
18
19import Ubuntu.Components 1.3
19import Ubuntu.Components 1.3
20+import Ubuntu.Components.Themes 1.3
20import Ubuntu.Components.Popups 1.3
21import Ubuntu.Components.Popups 1.3
21
22
22/*
23/*
@@ -41,10 +42,11 @@ Dialog {
41 // https://bugs.launchpad.net/ubuntu/+source/ubuntu-ui-toolkit/+bug/1555548
42 // https://bugs.launchpad.net/ubuntu/+source/ubuntu-ui-toolkit/+bug/1555548
42 ThemeSettings {
43 ThemeSettings {
43 id: themeHack
44 id: themeHack
44− name: "Ubuntu.Components.Themes.Ambiance"
45 }
45 }
46
46
47 Component.onCompleted: {
47 Component.onCompleted: {
48+ themeHack.palette.normal.overlay = "white";
49+ themeHack.palette.normal.overlayText = UbuntuColors.slate;
48 __foreground.theme = themeHack
50 __foreground.theme = themeHack
49 show();
51 show();
50 }
52 }
qml/Launcher/LauncherPanel.qml+34−30
@@ -767,38 +767,42 @@ Rectangle {
767 quickList.state = "open";
767 quickList.state = "open";
768 }
768 }
769
769
770− Column {
770+ StyledItem {
771− id: quickListColumn
772 width: parent.width
771 width: parent.width
772+ height: quickListColumn.height
773+
774+ theme: ThemeSettings {
775+ name: "Ubuntu.Components.Themes.Ambiance"
776+ }
777+
778+ Column {
779+ id: quickListColumn
780+ width: parent.width
773− height: childrenRect.height
781+ height: childrenRect.height
774−
782+
775− Repeater {
783+ Repeater {
776− id: popoverRepeater
784+ id: popoverRepeater
777− model: quickList.model
785+ model: quickList.model
778−
786+
779− ListItems.Standard {
787+ ListItems.Standard {
780− objectName: "quickListEntry" + index
788+ objectName: "quickListEntry" + index
781− text: (model.clickable ? "" : "<b>") + model.label + (model.clickable ? "" : "</b>")
789+ text: (model.clickable ? "" : "<b>") + model.label + (model.clickable ? "" : "</b>")
782− highlightWhenPressed: model.clickable
790+ highlightWhenPressed: model.clickable
783− selected: index === quickList.selectedIndex
791+ selected: index === quickList.selectedIndex
784−
792+
785− // FIXME: This is a workaround for the theme not being context sensitive. I.e. the
786− // ListItems don't know that they are sitting in a themed Popover where the color
787− // needs to be inverted.
788− __foregroundColor: "black"
789−
790− onClicked: {
793+ onClicked: {
791− if (!model.clickable) {
794+ if (!model.clickable) {
792− return;
795+ return;
796+ }
797+ Haptics.play();
798+ quickList.state = "";
799+ // Unsetting model to prevent showing changing entries during fading out
800+ // that may happen because of triggering an action.
801+ LauncherModel.quickListActionInvoked(quickList.appId, index);
802+ quickList.focus = false;
803+ root.kbdNavigationCancelled();
804+ quickList.model = undefined;
793 }
805 }
794− Haptics.play();
795− quickList.state = "";
796− // Unsetting model to prevent showing changing entries during fading out
797− // that may happen because of triggering an action.
798− LauncherModel.quickListActionInvoked(quickList.appId, index);
799− quickList.focus = false;
800− root.kbdNavigationCancelled();
801− quickList.model = undefined;
802 }
806 }
803 }
807 }
804 }
808 }
qml/Panel/IndicatorItem.qml−7
@@ -113,13 +113,6 @@ IndicatorDelegate {
113 source: modelData
113 source: modelData
114 color: root.color
114 color: root.color
115 Behavior on color { ColorAnimation { duration: UbuntuAnimation.FastDuration; easing: UbuntuAnimation.StandardEasing } }
115 Behavior on color { ColorAnimation { duration: UbuntuAnimation.FastDuration; easing: UbuntuAnimation.StandardEasing } }
116−
117− opacity: {
118− if (!expanded) return 1.0;
119− if (!selected) return 0.6;
120− return 1.0;
121− }
122− Behavior on opacity { NumberAnimation { duration: UbuntuAnimation.FastDuration; easing: UbuntuAnimation.StandardEasing } }
123 }
116 }
124 }
117 }
125 }
118 }
qml/Panel/Indicators/MenuItemFactory.qml+5
@@ -228,6 +228,11 @@ Item {
228 text: menuData && menuData.label || ""
228 text: menuData && menuData.label || ""
229 iconSource: menuData && menuData.icon || ""
229 iconSource: menuData && menuData.icon || ""
230 value : menuData && menuData.actionState || 0.0
230 value : menuData && menuData.actionState || 0.0
231+ enabled: menuData && menuData.sensitive || false
232+ // FIXME: Because of this bug, setting it to the theme foreground color (white)
233+ // currently doesn't work. Let's hack it to be "close enough"
234+ // https://bugs.launchpad.net/ubuntu/+source/ubuntu-ui-toolkit/+bug/1555784
235+ foregroundColor: "#fffffe"
231 highlightWhenPressed: false
236 highlightWhenPressed: false
232 }
237 }
233 }
238 }
qml/Panel/IndicatorsMenu.qml+2−3
@@ -38,7 +38,7 @@ Showable {
38 property bool enableHint: true
38 property bool enableHint: true
39 property bool contentEnabled: true
39 property bool contentEnabled: true
40 property bool showOnClick: true
40 property bool showOnClick: true
41− property color panelColor: UbuntuColors.jet
41+ property color panelColor: theme.palette.normal.background
42
42
43 signal showTapped(point position)
43 signal showTapped(point position)
44
44
@@ -76,7 +76,6 @@ Showable {
76 MenuContent {
76 MenuContent {
77 id: content
77 id: content
78 objectName: "menuContent"
78 objectName: "menuContent"
79− color: root.panelColor
80
79
81 anchors {
80 anchors {
82 left: parent.left
81 left: parent.left
@@ -111,7 +110,7 @@ Showable {
111 height: units.gu(0.5)
110 height: units.gu(0.5)
112 gradient: Gradient {
111 gradient: Gradient {
113 GradientStop { position: 0.0; color: "transparent" }
112 GradientStop { position: 0.0; color: "transparent" }
114− GradientStop { position: 1.0; color: root.panelColor }
113+ GradientStop { position: 1.0; color: theme.palette.normal.background }
115 }
114 }
116 opacity: 0.3
115 opacity: 0.3
117 }
116 }
qml/Panel/Panel.qml+1−1
@@ -89,7 +89,7 @@ Item {
89
89
90 Rectangle {
90 Rectangle {
91 id: indicatorAreaBackground
91 id: indicatorAreaBackground
92− color: callHint.visible ? UbuntuColors.green : indicators.panelColor
92+ color: callHint.visible ? UbuntuColors.green : theme.palette.normal.background
93 anchors {
93 anchors {
94 top: parent.top
94 top: parent.top
95 left: parent.left
95 left: parent.left
qml/Stages/WindowDecoration.qml+1−1
@@ -67,7 +67,7 @@ MouseArea {
67 anchors.fill: parent
67 anchors.fill: parent
68 anchors.bottomMargin: -radius
68 anchors.bottomMargin: -radius
69 radius: units.gu(.5)
69 radius: units.gu(.5)
70− color: "#292929"
70+ color: theme.palette.normal.background
71 }
71 }
72
72
73 Row {
73 Row {
tests/qmltests/Panel/IndicatorTest.qml+2−1
@@ -24,7 +24,8 @@ import Unity.Indicators 0.1 as Indicators
24
24
25Rectangle {
25Rectangle {
26 id: root
26 id: root
27− color: "white"
27+ color: theme.palette.normal.background
28+ Component.onCompleted: theme.name = "Ubuntu.Components.Themes.SuruDark"
28
29
29 property alias indicatorsModel: __indicatorsModel
30 property alias indicatorsModel: __indicatorsModel
30 property alias originalModelData: __indicatorsModel.originalModelData
31 property alias originalModelData: __indicatorsModel.originalModelData
tests/qmltests/Panel/tst_IndicatorItem.qml−3
@@ -184,21 +184,18 @@ Rectangle {
184
184
185 function test_select() {
185 function test_select() {
186 tryCompare(findChild(indicatorItem, "icon0"), "color", theme.palette.normal.backgroundText);
186 tryCompare(findChild(indicatorItem, "icon0"), "color", theme.palette.normal.backgroundText);
187− tryCompare(findChild(indicatorItem, "icon0"), "opacity", 1.0);
188 tryCompare(findChild(indicatorItem, "leftLabel"), "color", theme.palette.normal.backgroundText);
187 tryCompare(findChild(indicatorItem, "leftLabel"), "color", theme.palette.normal.backgroundText);
189 tryCompare(findChild(indicatorItem, "rightLabel"), "color", theme.palette.normal.backgroundText);
188 tryCompare(findChild(indicatorItem, "rightLabel"), "color", theme.palette.normal.backgroundText);
190 tryCompare(findChild(indicatorItem, "indicatorName"), "color", theme.palette.normal.backgroundText);
189 tryCompare(findChild(indicatorItem, "indicatorName"), "color", theme.palette.normal.backgroundText);
191
190
192 indicatorItem.expanded = true;
191 indicatorItem.expanded = true;
193 tryCompare(findChild(indicatorItem, "icon0"), "color", theme.palette.disabled.backgroundText);
192 tryCompare(findChild(indicatorItem, "icon0"), "color", theme.palette.disabled.backgroundText);
194− tryCompare(findChild(indicatorItem, "icon0"), "opacity", 0.6);
195 tryCompare(findChild(indicatorItem, "leftLabel"), "color", theme.palette.disabled.backgroundText);
193 tryCompare(findChild(indicatorItem, "leftLabel"), "color", theme.palette.disabled.backgroundText);
196 tryCompare(findChild(indicatorItem, "rightLabel"), "color", theme.palette.disabled.backgroundText);
194 tryCompare(findChild(indicatorItem, "rightLabel"), "color", theme.palette.disabled.backgroundText);
197 tryCompare(findChild(indicatorItem, "indicatorName"), "color", theme.palette.disabled.backgroundText);
195 tryCompare(findChild(indicatorItem, "indicatorName"), "color", theme.palette.disabled.backgroundText);
198
196
199 indicatorItem.selected = true;
197 indicatorItem.selected = true;
200 tryCompare(findChild(indicatorItem, "icon0"), "color", theme.palette.normal.backgroundText);
198 tryCompare(findChild(indicatorItem, "icon0"), "color", theme.palette.normal.backgroundText);
201− tryCompare(findChild(indicatorItem, "icon0"), "opacity", 1.0);
202 tryCompare(findChild(indicatorItem, "leftLabel"), "color", theme.palette.normal.backgroundText);
199 tryCompare(findChild(indicatorItem, "leftLabel"), "color", theme.palette.normal.backgroundText);
203 tryCompare(findChild(indicatorItem, "rightLabel"), "color", theme.palette.normal.backgroundText);
200 tryCompare(findChild(indicatorItem, "rightLabel"), "color", theme.palette.normal.backgroundText);
204 tryCompare(findChild(indicatorItem, "indicatorName"), "color", theme.palette.normal.backgroundText);
201 tryCompare(findChild(indicatorItem, "indicatorName"), "color", theme.palette.normal.backgroundText);
tests/qmltests/Panel/tst_IndicatorItemRow.qml+1−2
@@ -26,7 +26,6 @@ IndicatorTest {
26 id: root
26 id: root
27 width: units.gu(120)
27 width: units.gu(120)
28 height: units.gu(40)
28 height: units.gu(40)
29− color: "white"
30
29
31 RowLayout {
30 RowLayout {
32 anchors.fill: parent
31 anchors.fill: parent
@@ -40,7 +39,7 @@ IndicatorTest {
40 color: "blue"
39 color: "blue"
41
40
42 Rectangle {
41 Rectangle {
43− color: "black"
42+ color: theme.palette.normal.background
44 anchors.fill: indicatorsRow
43 anchors.fill: indicatorsRow
45 }
44 }
46
45
tests/qmltests/Panel/tst_IndicatorsMenu.qml−1
@@ -26,7 +26,6 @@ IndicatorTest {
26 id: root
26 id: root
27 width: units.gu(80)
27 width: units.gu(80)
28 height: units.gu(71)
28 height: units.gu(71)
29− color: "white"
30
29
31 RowLayout {
30 RowLayout {
32 anchors.fill: parent
31 anchors.fill: parent
tests/qmltests/tst_Shell.qml+13−1
@@ -141,8 +141,10 @@ Rectangle {
141 anchors { left: parent.left; right: parent.right; top: parent.top; margins: units.gu(1) }
141 anchors { left: parent.left; right: parent.right; top: parent.top; margins: units.gu(1) }
142 spacing: units.gu(1)
142 spacing: units.gu(1)
143
143
144− Row {
144+ Flow {
145 spacing: units.gu(1)
145 spacing: units.gu(1)
146+ anchors { left: parent.left; right: parent.right }
147+
146 Button {
148 Button {
147 text: "Show Greeter"
149 text: "Show Greeter"
148 activeFocusOnPress: false
150 activeFocusOnPress: false
@@ -169,6 +171,16 @@ Rectangle {
169 }
171 }
170 }
172 }
171 }
173 }
174+ Button {
175+ text: callManager.foregroundCall ? "Hide Call" : "Show Call"
176+ activeFocusOnPress: false
177+ onClicked: {
178+ if (shellLoader.status !== Loader.Ready)
179+ return;
180+
181+ callManager.foregroundCall = callManager.foregroundCall ? null : phoneCall;
182+ }
183+ }
172 }
184 }
173 ListItem.ItemSelector {
185 ListItem.ItemSelector {
174 anchors { left: parent.left; right: parent.right }
186 anchors { left: parent.left; right: parent.right }