Verified Commit 08301318 authored by Xuetian Weng's avatar Xuetian Weng
Browse files

kimpanel: Use highlight text color.

According to breeze theme, the widgets/viewitem is using button focus
color, which is used with highlight text color in normal widget. Tested
with a few different colorscheme and plasma theme, using highlight text
color seems to be a better choice for readability.
parent 7bf17781
...@@ -30,7 +30,7 @@ PlasmaCore.Dialog { ...@@ -30,7 +30,7 @@ PlasmaCore.Dialog {
flags: Qt.Popup | Qt.WindowStaysOnTopHint | Qt.WindowDoesNotAcceptFocus flags: Qt.Popup | Qt.WindowStaysOnTopHint | Qt.WindowDoesNotAcceptFocus
location: PlasmaCore.Types.Floating location: PlasmaCore.Types.Floating
visible: helper.auxVisible || helper.preeditVisible || helper.lookupTableVisible visible: helper.auxVisible || helper.preeditVisible || helper.lookupTableVisible
property bool verticalLayout: (helper.lookupTableLayout === 1) || (helper.lookupTableLayout === 0 && plasmoid.configuration.vertical_lookup_table); readonly property bool verticalLayout: (helper.lookupTableLayout === 1) || (helper.lookupTableLayout === 0 && plasmoid.configuration.vertical_lookup_table);
property int highlightCandidate: helper.lookupTableCursor property int highlightCandidate: helper.lookupTableCursor
property int hoveredCandidate: -1 property int hoveredCandidate: -1
property font preferredFont: plasmoid.configuration.use_default_font ? theme.defaultFont : plasmoid.configuration.font property font preferredFont: plasmoid.configuration.use_default_font ? theme.defaultFont : plasmoid.configuration.font
...@@ -101,6 +101,7 @@ PlasmaCore.Dialog { ...@@ -101,6 +101,7 @@ PlasmaCore.Dialog {
dynamicRoles: true dynamicRoles: true
} }
delegate: Item { delegate: Item {
id: candidateDelegate
width: candidate.width + highlight.marginHints.left + highlight.marginHints.right width: candidate.width + highlight.marginHints.left + highlight.marginHints.right
height: candidate.height + highlight.marginHints.top + highlight.marginHints.bottom height: candidate.height + highlight.marginHints.top + highlight.marginHints.bottom
Layout.minimumWidth: width Layout.minimumWidth: width
...@@ -108,6 +109,8 @@ PlasmaCore.Dialog { ...@@ -108,6 +109,8 @@ PlasmaCore.Dialog {
Layout.maximumWidth: width Layout.maximumWidth: width
Layout.maximumHeight: height Layout.maximumHeight: height
readonly property bool selected: inputpanel.highlightCandidate === model.index || candidateMouseArea.pressed
Row { Row {
id: candidate id: candidate
width: childrenRect.width width: childrenRect.width
...@@ -119,11 +122,13 @@ PlasmaCore.Dialog { ...@@ -119,11 +122,13 @@ PlasmaCore.Dialog {
text: model.label text: model.label
font: preferredFont font: preferredFont
opacity: 0.8 opacity: 0.8
color: selected ? theme.highlightedTextColor : theme.textColor
} }
PlasmaComponents.Label { PlasmaComponents.Label {
id: textLabel id: textLabel
text: model.text text: model.text
font: preferredFont font: preferredFont
color: selected ? theme.highlightedTextColor : theme.textColor
} }
} }
MouseArea { MouseArea {
...@@ -140,7 +145,7 @@ PlasmaCore.Dialog { ...@@ -140,7 +145,7 @@ PlasmaCore.Dialog {
z: -1 z: -1
visible: inputpanel.highlightCandidate === model.index || inputpanel.hoveredCandidate === model.index visible: inputpanel.highlightCandidate === model.index || inputpanel.hoveredCandidate === model.index
hover: candidateMouseArea.containsMouse hover: candidateMouseArea.containsMouse
selected: inputpanel.highlightCandidate === model.index || candidateMouseArea.pressed selected: candidateDelegate.selected
anchors { anchors {
fill: parent fill: parent
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment