Skip to content
Snippets Groups Projects
Commit ba7f1314 authored by Prince Gupta's avatar Prince Gupta :speech_balloon: Committed by Pierre Lamot
Browse files

qml: change row foreground color on highlighted in KeyNavigableTableView


Signed-off-by: default avatarPierre Lamot <pierre@videolabs.io>
parent a93435cb
No related branches found
No related tags found
No related merge requests found
......@@ -164,6 +164,7 @@ Widgets.NavigableFocusScope {
Widgets.ListLabel {
text: rowModel ? rowModel.track_number : ""
color: foregroundColor
Layout.fillHeight: true
Layout.preferredWidth: VLCStyle.margin_large
......@@ -171,6 +172,7 @@ Widgets.NavigableFocusScope {
Widgets.ListLabel {
text: rowModel ? rowModel.title : ""
color: foregroundColor
Layout.fillHeight: true
Layout.fillWidth: true
......
......@@ -41,6 +41,7 @@ NavigableFocusScope {
anchors.fill: parent
text: !rowModel ? "" : (rowModel[model.criteria] || "")
color: parent.foregroundColor
}
property Component tableHeaderDelegate: Widgets.CaptionLabel {
text: model.text || ""
......@@ -200,6 +201,7 @@ NavigableFocusScope {
property var rowModel: model
property bool selected: selectionDelegateModel.isSelected(root.model.index(index, 0))
readonly property bool highlighted: selected || hoverArea.containsMouse || activeFocus
readonly property color foregroundColor: highlighted ? VLCStyle.colors.bgHoverText : VLCStyle.colors.text
readonly property int _index: index
property int _modifiersOnLastPress: Qt.NoModifier
......@@ -292,6 +294,7 @@ NavigableFocusScope {
property var colModel: modelData
readonly property bool currentlyFocused: lineView.activeFocus
readonly property bool containsMouse: hoverArea.containsMouse
readonly property color foregroundColor: lineView.foregroundColor
readonly property int index: lineView._index
anchors.fill: parent
......@@ -306,6 +309,7 @@ NavigableFocusScope {
anchors.left: content.right
anchors.leftMargin: VLCStyle.margin_xxsmall
anchors.verticalCenter: content.verticalCenter
color: lineView.foregroundColor
backgroundColor: hovered || activeFocus ?
VLCStyle.colors.getBgColor( lineView.selected, hovered,
activeFocus ) : "transparent"
......
......@@ -70,6 +70,7 @@ Item {
Widgets.ListLabel {
text: (!rowModel || !root.showTitleText) ? "" : (rowModel[model.criteria] || i18n.qtr("Unknown Title"))
visible: root.showTitleText
color: foregroundColor
Layout.fillHeight: true
Layout.fillWidth: true
......@@ -108,6 +109,7 @@ Item {
height: parent.height
horizontalAlignment: Text.AlignHCenter
text: !rowModel ? "" : rowModel[model.criteria] || ""
color: foregroundColor
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment