From 9f2a04bf783b4147a6a9543b26997fcbf754de40 Mon Sep 17 00:00:00 2001 From: casey Date: Tue, 31 May 2016 22:36:09 -0700 Subject: [PATCH] A couple small color tweaks to make the currently playing track more obvious. --- src/musikbox/app/window/TrackListView.cpp | 10 +++++++--- src/musikbox/cursespp/Colors.cpp | 1 + src/musikbox/cursespp/Colors.h | 1 + 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/musikbox/app/window/TrackListView.cpp b/src/musikbox/app/window/TrackListView.cpp index b5b403207..c0bf4b802 100755 --- a/src/musikbox/app/window/TrackListView.cpp +++ b/src/musikbox/app/window/TrackListView.cpp @@ -126,12 +126,16 @@ IScrollAdapter::EntryPtr TrackListView::Adapter::GetEntry(size_t index) { TrackPtr track = parent.metadata->at(index); TrackPtr playing = parent.playing; - if (!selected && - playing && + if (playing && playing->Id() == track->Id() && playing->LibraryId() == track->LibraryId()) { - attrs = COLOR_PAIR(BOX_COLOR_YELLOW_ON_BLACK); + if (selected) { + attrs = COLOR_PAIR(BOX_COLOR_BLACK_ON_YELLOW); + } + else { + attrs = COLOR_PAIR(BOX_COLOR_YELLOW_ON_BLACK) | A_BOLD; + } } std::string trackNum = track->GetValue(constants::Track::TRACK_NUM); diff --git a/src/musikbox/cursespp/Colors.cpp b/src/musikbox/cursespp/Colors.cpp index 986319bb3..da27cd2d3 100755 --- a/src/musikbox/cursespp/Colors.cpp +++ b/src/musikbox/cursespp/Colors.cpp @@ -19,4 +19,5 @@ void Colors::Init() { init_pair(BOX_COLOR_GREEN_ON_BLACK, COLOR_GREEN, COLOR_BLACK); init_pair(BOX_COLOR_BLACK_ON_BLACK, COLOR_BLACK, COLOR_BLACK); init_pair(BOX_COLOR_RED_ON_GREEN, COLOR_RED, COLOR_GREEN); + init_pair(BOX_COLOR_BLACK_ON_YELLOW, COLOR_BLACK, COLOR_YELLOW); } diff --git a/src/musikbox/cursespp/Colors.h b/src/musikbox/cursespp/Colors.h index f0d79de2e..38ce8ebd3 100755 --- a/src/musikbox/cursespp/Colors.h +++ b/src/musikbox/cursespp/Colors.h @@ -14,6 +14,7 @@ #define BOX_COLOR_GREEN_ON_BLACK 10 #define BOX_COLOR_BLACK_ON_BLACK 11 #define BOX_COLOR_RED_ON_GREEN 12 +#define BOX_COLOR_BLACK_ON_YELLOW 13 namespace cursespp { class Colors {