summaryrefslogtreecommitdiff
path: root/src/display.cpp
diff options
context:
space:
mode:
authorAndrzej Rybczak <electricityispower@gmail.com>2012-08-31 04:38:03 +0200
committerAndrzej Rybczak <electricityispower@gmail.com>2012-08-31 04:38:20 +0200
commitd8b2d20bdb277c94ceae922c0a60a78ca6a944be (patch)
tree22a6ebbcc7a773f32cbea09179c3a7117991b19b /src/display.cpp
parent0ba847dc3c0923ded45972eaf2be3ee7c36a5cf1 (diff)
menu: move a few methods to Item class
Diffstat (limited to 'src/display.cpp')
-rw-r--r--src/display.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/display.cpp b/src/display.cpp
index 4eeb5063..6cdb3ad5 100644
--- a/src/display.cpp
+++ b/src/display.cpp
@@ -157,7 +157,7 @@ void Display::SongsInColumns(Menu<MPD::Song> &menu, const MPD::Song &s, BasicScr
int song_pos = menu.isFiltered() ? s.getPosition() : menu.CurrentlyDrawedPosition();
bool is_now_playing = &menu == myPlaylist->Items && song_pos == myPlaylist->NowPlaying;
- bool is_selected = menu.isSelected(menu.CurrentlyDrawedPosition());
+ bool is_selected = menu[menu.CurrentlyDrawedPosition()].isSelected();
bool discard_colors = Config.discard_colors_if_item_is_selected && is_selected;
if (is_now_playing)
@@ -287,7 +287,8 @@ void Display::Songs(Menu<MPD::Song> &menu, const MPD::Song &s, BasicScreen &scre
mvwhline(menu.Raw(), menu.Y(), 0, ' ', menu.GetWidth());
}
- bool discard_colors = Config.discard_colors_if_item_is_selected && menu.isSelected(menu.CurrentlyDrawedPosition());
+ bool discard_colors = Config.discard_colors_if_item_is_selected
+ && menu[menu.CurrentlyDrawedPosition()].isSelected();
std::string line = s.toString(format, "$");
for (std::string::const_iterator it = line.begin(); it != line.end(); ++it)
@@ -313,7 +314,7 @@ void Display::Songs(Menu<MPD::Song> &menu, const MPD::Song &s, BasicScreen &scre
buf.RemoveFormatting();
if (is_now_playing)
buf << Config.now_playing_suffix;
- menu << XY(menu.GetWidth()-buf.Str().length()-(menu.isSelected(menu.CurrentlyDrawedPosition()) ? Config.selected_item_suffix_length : 0), menu.Y()) << buf;
+ menu << XY(menu.GetWidth()-buf.Str().length()-(menu[menu.CurrentlyDrawedPosition()].isSelected() ? Config.selected_item_suffix_length : 0), menu.Y()) << buf;
if (separate_albums)
menu << fmtUnderlineEnd;
return;