From c546f314beff5302dc9b6b7ab03cc0d6f48aa72b Mon Sep 17 00:00:00 2001 From: David Edmundson Date: Thu, 11 Dec 2014 15:06:54 +0100 Subject: [PATCH] Use the same text colour for comboboxes as buttons Given comboboxes use the same background as buttons they should use the same text colour too. This prevents a situation in Breeze where a ComboBox could get white text on a white background when using a colourscope with complementary colours. Change-Id: I21502186178a32ce480cd3e838335451bf644c3e --- .../plasmastyle/ComboBoxStyle.qml | 1 + tests/components/combobox.qml | 41 +++++++++++++++++++ 2 files changed, 42 insertions(+) create mode 100644 tests/components/combobox.qml diff --git a/src/declarativeimports/plasmastyle/ComboBoxStyle.qml b/src/declarativeimports/plasmastyle/ComboBoxStyle.qml index e73d0da84..501efed82 100644 --- a/src/declarativeimports/plasmastyle/ComboBoxStyle.qml +++ b/src/declarativeimports/plasmastyle/ComboBoxStyle.qml @@ -31,6 +31,7 @@ QtQuickControlStyle.ComboBoxStyle { label: PlasmaComponents.Label { text: control.currentText elide: Text.ElideRight + color: theme.buttonTextColor verticalAlignment: Text.AlignTop } diff --git a/tests/components/combobox.qml b/tests/components/combobox.qml new file mode 100644 index 000000000..76510f33d --- /dev/null +++ b/tests/components/combobox.qml @@ -0,0 +1,41 @@ +import QtQuick 2.0 + +import org.kde.plasma.components 2.0 +import org.kde.plasma.core 2.0 as PlasmaCore + +Rectangle { + id: root + color: "white" + width: 800 + height: 300 + + ListModel { + id: demoModel + ListElement { text: "Banana"; color: "Yellow" } + ListElement { text: "Apple"; color: "Green" } + ListElement { text: "Coconut"; color: "Brown" } + } + + Flow { + anchors.fill: parent + anchors.margins: 20 + spacing: 20 + + ComboBox { + model:demoModel + } + ComboBox { + editable: true + model: demoModel + } + PlasmaCore.ColorScope { + implicitWidth: childrenRect.width + implicitHeight: childrenRect.width + + colorGroup: PlasmaCore.Theme.ComplementaryColorGroup + ComboBox { + model:demoModel + } + } + } +} \ No newline at end of file