on xenial help sign in
more fixes for the new theme palette Fixes: #1554616, #1557534

Approved by: Michael Zanetti

commit7999aea9820dce260f196439ec2bfe88714e58d3 authorMichael Zanetti <michael.zanetti@canonical.com> dateFri 18 Mar 2016, 17:12 (11 years ago) parentb7cd4c15077e15
12 files changed+62−51
qml/Components/ShellDialog.qml+3−1 qml/Launcher/LauncherPanel.qml+34−30 qml/Panel/IndicatorItem.qml−7 qml/Panel/Indicators/MenuItemFactory.qml+5 qml/Panel/IndicatorsMenu.qml+2−3 qml/Panel/Panel.qml+1−1 qml/Stages/WindowDecoration.qml+1−1 tests/qmltests/Panel/IndicatorTest.qml+2−1 tests/qmltests/Panel/tst_IndicatorItem.qml−3 tests/qmltests/Panel/tst_IndicatorItemRow.qml+1−2 tests/qmltests/Panel/tst_IndicatorsMenu.qml−1 tests/qmltests/tst_Shell.qml+13−1
qml/Components/ShellDialog.qml+3−1
@@ -17,6 +17,7 @@
1717import QtQuick 2.4
1818
1919import Ubuntu.Components 1.3
20+import Ubuntu.Components.Themes 1.3
2021import Ubuntu.Components.Popups 1.3
2122
2223/*
@@ -41,10 +42,11 @@ Dialog {
4142 // https://bugs.launchpad.net/ubuntu/+source/ubuntu-ui-toolkit/+bug/1555548
4243 ThemeSettings {
4344 id: themeHack
44− name: "Ubuntu.Components.Themes.Ambiance"
4545 }
4646
4747 Component.onCompleted: {
48+ themeHack.palette.normal.overlay = "white";
49+ themeHack.palette.normal.overlayText = UbuntuColors.slate;
4850 __foreground.theme = themeHack
4951 show();
5052 }
qml/Launcher/LauncherPanel.qml+34−30
@@ -767,38 +767,42 @@ Rectangle {
767767 quickList.state = "open";
768768 }
769769
770− Column {
771− id: quickListColumn
770+ StyledItem {
772771 width: parent.width
773− height: childrenRect.height
774−
775− Repeater {
776− id: popoverRepeater
777− model: quickList.model
778−
779− ListItems.Standard {
780− objectName: "quickListEntry" + index
781− text: (model.clickable ? "" : "<b>") + model.label + (model.clickable ? "" : "</b>")
782− highlightWhenPressed: model.clickable
783− selected: index === quickList.selectedIndex
784−
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: {
791− if (!model.clickable) {
792− return;
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
781+ height: childrenRect.height
782+
783+ Repeater {
784+ id: popoverRepeater
785+ model: quickList.model
786+
787+ ListItems.Standard {
788+ objectName: "quickListEntry" + index
789+ text: (model.clickable ? "" : "<b>") + model.label + (model.clickable ? "" : "</b>")
790+ highlightWhenPressed: model.clickable
791+ selected: index === quickList.selectedIndex
792+
793+ onClicked: {
794+ if (!model.clickable) {
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;
793805 }
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;
802806 }
803807 }
804808 }
qml/Panel/IndicatorItem.qml−7
@@ -113,13 +113,6 @@ IndicatorDelegate {
113113 source: modelData
114114 color: root.color
115115 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 } }
123116 }
124117 }
125118 }
qml/Panel/Indicators/MenuItemFactory.qml+5
@@ -228,6 +228,11 @@ Item {
228228 text: menuData && menuData.label || ""
229229 iconSource: menuData && menuData.icon || ""
230230 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"
231236 highlightWhenPressed: false
232237 }
233238 }
qml/Panel/IndicatorsMenu.qml+2−3
@@ -38,7 +38,7 @@ Showable {
3838 property bool enableHint: true
3939 property bool contentEnabled: true
4040 property bool showOnClick: true
41− property color panelColor: UbuntuColors.jet
41+ property color panelColor: theme.palette.normal.background
4242
4343 signal showTapped(point position)
4444
@@ -76,7 +76,6 @@ Showable {
7676 MenuContent {
7777 id: content
7878 objectName: "menuContent"
79− color: root.panelColor
8079
8180 anchors {
8281 left: parent.left
@@ -111,7 +110,7 @@ Showable {
111110 height: units.gu(0.5)
112111 gradient: Gradient {
113112 GradientStop { position: 0.0; color: "transparent" }
114− GradientStop { position: 1.0; color: root.panelColor }
113+ GradientStop { position: 1.0; color: theme.palette.normal.background }
115114 }
116115 opacity: 0.3
117116 }
qml/Panel/Panel.qml+1−1
@@ -89,7 +89,7 @@ Item {
8989
9090 Rectangle {
9191 id: indicatorAreaBackground
92− color: callHint.visible ? UbuntuColors.green : indicators.panelColor
92+ color: callHint.visible ? UbuntuColors.green : theme.palette.normal.background
9393 anchors {
9494 top: parent.top
9595 left: parent.left
qml/Stages/WindowDecoration.qml+1−1
@@ -67,7 +67,7 @@ MouseArea {
6767 anchors.fill: parent
6868 anchors.bottomMargin: -radius
6969 radius: units.gu(.5)
70− color: "#292929"
70+ color: theme.palette.normal.background
7171 }
7272
7373 Row {
tests/qmltests/Panel/IndicatorTest.qml+2−1
@@ -24,7 +24,8 @@ import Unity.Indicators 0.1 as Indicators
2424
2525Rectangle {
2626 id: root
27− color: "white"
27+ color: theme.palette.normal.background
28+ Component.onCompleted: theme.name = "Ubuntu.Components.Themes.SuruDark"
2829
2930 property alias indicatorsModel: __indicatorsModel
3031 property alias originalModelData: __indicatorsModel.originalModelData
tests/qmltests/Panel/tst_IndicatorItem.qml−3
@@ -184,21 +184,18 @@ Rectangle {
184184
185185 function test_select() {
186186 tryCompare(findChild(indicatorItem, "icon0"), "color", theme.palette.normal.backgroundText);
187− tryCompare(findChild(indicatorItem, "icon0"), "opacity", 1.0);
188187 tryCompare(findChild(indicatorItem, "leftLabel"), "color", theme.palette.normal.backgroundText);
189188 tryCompare(findChild(indicatorItem, "rightLabel"), "color", theme.palette.normal.backgroundText);
190189 tryCompare(findChild(indicatorItem, "indicatorName"), "color", theme.palette.normal.backgroundText);
191190
192191 indicatorItem.expanded = true;
193192 tryCompare(findChild(indicatorItem, "icon0"), "color", theme.palette.disabled.backgroundText);
194− tryCompare(findChild(indicatorItem, "icon0"), "opacity", 0.6);
195193 tryCompare(findChild(indicatorItem, "leftLabel"), "color", theme.palette.disabled.backgroundText);
196194 tryCompare(findChild(indicatorItem, "rightLabel"), "color", theme.palette.disabled.backgroundText);
197195 tryCompare(findChild(indicatorItem, "indicatorName"), "color", theme.palette.disabled.backgroundText);
198196
199197 indicatorItem.selected = true;
200198 tryCompare(findChild(indicatorItem, "icon0"), "color", theme.palette.normal.backgroundText);
201− tryCompare(findChild(indicatorItem, "icon0"), "opacity", 1.0);
202199 tryCompare(findChild(indicatorItem, "leftLabel"), "color", theme.palette.normal.backgroundText);
203200 tryCompare(findChild(indicatorItem, "rightLabel"), "color", theme.palette.normal.backgroundText);
204201 tryCompare(findChild(indicatorItem, "indicatorName"), "color", theme.palette.normal.backgroundText);
tests/qmltests/Panel/tst_IndicatorItemRow.qml+1−2
@@ -26,7 +26,6 @@ IndicatorTest {
2626 id: root
2727 width: units.gu(120)
2828 height: units.gu(40)
29− color: "white"
3029
3130 RowLayout {
3231 anchors.fill: parent
@@ -40,7 +39,7 @@ IndicatorTest {
4039 color: "blue"
4140
4241 Rectangle {
43− color: "black"
42+ color: theme.palette.normal.background
4443 anchors.fill: indicatorsRow
4544 }
4645
tests/qmltests/Panel/tst_IndicatorsMenu.qml−1
@@ -26,7 +26,6 @@ IndicatorTest {
2626 id: root
2727 width: units.gu(80)
2828 height: units.gu(71)
29− color: "white"
3029
3130 RowLayout {
3231 anchors.fill: parent
tests/qmltests/tst_Shell.qml+13−1
@@ -141,8 +141,10 @@ Rectangle {
141141 anchors { left: parent.left; right: parent.right; top: parent.top; margins: units.gu(1) }
142142 spacing: units.gu(1)
143143
144− Row {
144+ Flow {
145145 spacing: units.gu(1)
146+ anchors { left: parent.left; right: parent.right }
147+
146148 Button {
147149 text: "Show Greeter"
148150 activeFocusOnPress: false
@@ -169,6 +171,16 @@ Rectangle {
169171 }
170172 }
171173 }
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+ }
172184 }
173185 ListItem.ItemSelector {
174186 anchors { left: parent.left; right: parent.right }