make progressbar look customizable

This commit is contained in:
Andrzej Rybczak
2009-08-26 03:25:06 +02:00
parent 8c3760111d
commit d92d7779e2
6 changed files with 16 additions and 4 deletions

View File

@@ -1146,8 +1146,8 @@ int main(int argc, char *argv[])
int howlong = wFooter->GetWidth()*progressbar_size;
mvwhline(wFooter->Raw(), 0, 0, 0, wFooter->GetWidth());
mvwhline(wFooter->Raw(), 0, 0, '=',howlong);
mvwaddch(wFooter->Raw(), 0, howlong, '>');
mvwhline(wFooter->Raw(), 0, 0, Config.progressbar[0], howlong);
mvwaddch(wFooter->Raw(), 0, howlong, Config.progressbar[1]);
*wFooter << fmtBoldEnd;
wFooter->Refresh();
}

View File

@@ -251,6 +251,7 @@ void DefaultConfiguration(ncmpcpp_config &conf)
conf.new_header_first_line = "{$b$1$aqqu$/a$9 {%t}|{%f} $1$atqq$/a$9$/b}";
conf.new_header_second_line = "{{{$4$b%a$/b$9}{ - $7%b$9}{ ($4%y$9)}}|{%D}}";
conf.browser_playlist_prefix << clRed << "(playlist)" << clEnd << ' ';
conf.progressbar = "=>";
conf.pattern = "%n - %t";
conf.selected_item_prefix << clMagenta;
conf.selected_item_suffix << clEnd;
@@ -621,6 +622,11 @@ void ReadConfiguration(ncmpcpp_config &conf)
String2Buffer(v, conf.browser_playlist_prefix);
}
}
else if (cl.find("progressbar_look") != std::string::npos)
{
if (v.length() == 2)
conf.progressbar = v;
}
else if (cl.find("default_tag_editor_pattern") != std::string::npos)
{
if (!v.empty())

View File

@@ -139,6 +139,7 @@ struct ncmpcpp_config
std::string execute_on_song_change;
std::string new_header_first_line;
std::string new_header_second_line;
std::string progressbar;
std::string pattern;

View File

@@ -502,8 +502,8 @@ void NcmpcppStatusChanged(Connection *, StatusChanges changed, void *)
mvwhline(wFooter->Raw(), 0, 0, 0, wFooter->GetWidth());
if (np.GetTotalLength())
{
mvwhline(wFooter->Raw(), 0, 0, '=',howlong);
mvwaddch(wFooter->Raw(), 0, howlong, '>');
mvwhline(wFooter->Raw(), 0, 0, Config.progressbar[0], howlong);
mvwaddch(wFooter->Raw(), 0, howlong, Config.progressbar[1]);
}
wFooter->SetColor(Config.statusbar_color);
}