From ba7f131447971563ad750b3acf84c0d7a8c45726 Mon Sep 17 00:00:00 2001 From: Prince Gupta <guptaprince8832@gmail.com> Date: Tue, 8 Dec 2020 19:07:10 +0530 Subject: [PATCH] qml: change row foreground color on highlighted in KeyNavigableTableView Signed-off-by: Pierre Lamot <pierre@videolabs.io> --- .../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 84b01696e4b2..e70ba6d1f644 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 6cdd5cfe390f..f47546518532 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 || "" @@ -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" diff --git a/modules/gui/qt/widgets/qml/TableColumns.qml b/modules/gui/qt/widgets/qml/TableColumns.qml index b2e943ab8313..293d6c596d3e 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 } } -- GitLab