make progressbar look customizable

master
Andrzej Rybczak 17 years ago
parent 8c3760111d
commit d92d7779e2
  1. 2
      doc/config
  2. 3
      doc/ncmpcpp.1
  3. 4
      src/ncmpcpp.cpp
  4. 6
      src/settings.cpp
  5. 1
      src/settings.h
  6. 4
      src/status.cpp

@ -167,6 +167,8 @@
#
#autocenter_mode = "no"
#
#progressbar_look = "=>"
#
#default_place_to_search_in = "database" (database/playlist)
#
#user_interface = "classic" (classic/alternative)

@ -159,6 +159,9 @@ If enabled, statusbar will be displayed, otherwise hidden.
.B autocenter_mode = yes/no
Default state for autocenter mode at start.
.TP
.B progressbar_look = TEXT
This variable defines the look of progressbar. Note that it has to be exactly two characters long.
.TP
.B default_find_mode = wrapped/normal
If set to "wrapped", going from last found position to next will take you to the first one (same goes for the first position and going to previous one), otherwise no actions will be performed.
.TP

@ -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();
}

@ -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())

@ -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;

@ -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);
}

Loading…
Cancel
Save