discard column colors if item is selected (optional)

This commit is contained in:
Andrzej Rybczak
2010-01-24 01:21:07 +01:00
parent f991a41c1a
commit 359ce4fa9c
5 changed files with 16 additions and 3 deletions

View File

@@ -222,6 +222,8 @@
#
#search_engine_display_mode = "classic" (classic/columns)
#
#discard_column_colors_if_item_is_selected = "yes"
#
#incremental_seeking = "yes"
#
#seek_time = "1"

View File

@@ -177,6 +177,9 @@ Default display mode for Browser.
.B search_engine_display_mode = classic/columns
Default display mode for Search engine.
.TP
.B discard_column_colors_if_item_is_selected = yes/no
Indicates whether colors in column view have to be discarded if item is selected or not.
.TP
.B header_visibility = yes/no
If enabled, header window will be displayed, otherwise hidden.
.TP

View File

@@ -130,13 +130,15 @@ void Display::SongsInColumns(const MPD::Song &s, void *, Menu<MPD::Song> *menu)
if (Config.columns.size() > 1)
next2last = Config.columns.end()-2;
bool discard_colors = Config.discard_column_colors_if_item_is_selected && menu->isSelected(menu->CurrentlyDrawedPosition());
for (it = Config.columns.begin(); it != Config.columns.end(); ++it)
{
if (where)
{
menu->GotoXY(where, menu->Y());
*menu << ' ';
if ((it-1)->color != clDefault)
if (!discard_colors && (it-1)->color != clDefault)
*menu << clEnd;
}
@@ -203,7 +205,7 @@ void Display::SongsInColumns(const MPD::Song &s, void *, Menu<MPD::Song> *menu)
default:
break;
}
if (it->color != clDefault)
if (!discard_colors && it->color != clDefault)
*menu << it->color;
whline(menu->Raw(), 32, menu->GetWidth()-where);
std::string tag = get ? s.GetTags(get) : "";
@@ -226,7 +228,7 @@ void Display::SongsInColumns(const MPD::Song &s, void *, Menu<MPD::Song> *menu)
}
where += width;
}
if ((--it)->color != clDefault)
if (!discard_colors && (--it)->color != clDefault)
*menu << clEnd;
if (is_now_playing)
*menu << Config.now_playing_suffix;

View File

@@ -373,6 +373,7 @@ void DefaultConfiguration(ncmpcpp_config &conf)
conf.browser_sort_by_mtime = false;
conf.tag_editor_extended_numeration = false;
conf.media_library_display_date = true;
conf.discard_column_colors_if_item_is_selected = true;
conf.set_window_title = true;
conf.mpd_port = 6600;
conf.mpd_connection_timeout = 15;
@@ -952,6 +953,10 @@ void ReadConfiguration(ncmpcpp_config &conf)
{
conf.media_library_display_date = v == "yes";
}
else if (cl.find("discard_column_colors_if_item_is_selected") != std::string::npos)
{
conf.discard_column_colors_if_item_is_selected = v == "yes";
}
else if (cl.find("enable_window_title") != std::string::npos)
{
conf.set_window_title = v == "yes";

View File

@@ -220,6 +220,7 @@ struct ncmpcpp_config
bool browser_sort_by_mtime;
bool tag_editor_extended_numeration;
bool media_library_display_date;
bool discard_column_colors_if_item_is_selected;
int mpd_port;
int mpd_connection_timeout;