[vlc-devel] [PATCH 29/30] qml: change row foreground color on highlighted in KeyNavigableTableView
Prince Gupta
guptaprince8832 at gmail.com
Mon Dec 14 14:28:07 CET 2020
---
.../gui/qt/medialibrary/qml/MusicAlbumsGridExpandDelegate.qml | 2 ++
modules/gui/qt/widgets/qml/KeyNavigableTableView.qml | 4 ++++
modules/gui/qt/widgets/qml/TableColumns.qml | 2 ++
3 files changed, 8 insertions(+)
diff --git a/modules/gui/qt/medialibrary/qml/MusicAlbumsGridExpandDelegate.qml b/modules/gui/qt/medialibrary/qml/MusicAlbumsGridExpandDelegate.qml
index 84b01696e4..e70ba6d1f6 100644
--- a/modules/gui/qt/medialibrary/qml/MusicAlbumsGridExpandDelegate.qml
+++ b/modules/gui/qt/medialibrary/qml/MusicAlbumsGridExpandDelegate.qml
@@ -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
diff --git a/modules/gui/qt/widgets/qml/KeyNavigableTableView.qml b/modules/gui/qt/widgets/qml/KeyNavigableTableView.qml
index 58dc2d287f..b19f097b0e 100644
--- a/modules/gui/qt/widgets/qml/KeyNavigableTableView.qml
+++ b/modules/gui/qt/widgets/qml/KeyNavigableTableView.qml
@@ -41,6 +41,7 @@ NavigableFocusScope {
anchors.fill: parent
text: !rowModel ? "" : (rowModel[model.criteria] || "")
+ color: parent.foregroundColor
}
property Component tableHeaderDelegate: Widgets.CaptionLabel {
text: model.text || ""
@@ -199,6 +200,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
width: view.width
@@ -268,6 +270,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
@@ -282,6 +285,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"
diff --git a/modules/gui/qt/widgets/qml/TableColumns.qml b/modules/gui/qt/widgets/qml/TableColumns.qml
index b2e943ab83..293d6c596d 100644
--- a/modules/gui/qt/widgets/qml/TableColumns.qml
+++ b/modules/gui/qt/widgets/qml/TableColumns.qml
@@ -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
}
}
--
2.25.1
More information about the vlc-devel
mailing list