diff --git a/doc/ncmpcpprc b/doc/ncmpcpprc index 632c38ad..e35ff355 100644 --- a/doc/ncmpcpprc +++ b/doc/ncmpcpprc @@ -116,6 +116,8 @@ # #colors_enabled = "yes" # +#fancy_scrolling = "yes" +# #empty_tag_color = "cyan" # #header_window_color = "default" diff --git a/src/ncmpcpp.cpp b/src/ncmpcpp.cpp index d2de2147..9d9988b6 100644 --- a/src/ncmpcpp.cpp +++ b/src/ncmpcpp.cpp @@ -719,11 +719,35 @@ int main(int argc, char *argv[]) if (Keypressed(input, Key.Up)) { - wCurrent->Go(wUp); + if (!Config.fancy_scrolling && (wCurrent == mLibArtists || wCurrent == mPlaylistList || wCurrent == mEditorLeftCol)) + { + wCurrent->SetTimeout(50); + while (Keypressed(input, Key.Up)) + { + wCurrent->Go(wUp); + wCurrent->Refresh(); + wCurrent->ReadKey(input); + } + wCurrent->SetTimeout(ncmpcpp_window_timeout); + } + else + wCurrent->Go(wUp); } else if (Keypressed(input, Key.Down)) { - wCurrent->Go(wDown); + if (!Config.fancy_scrolling && (wCurrent == mLibArtists || wCurrent == mPlaylistList || wCurrent == mEditorLeftCol)) + { + wCurrent->SetTimeout(50); + while (Keypressed(input, Key.Down)) + { + wCurrent->Go(wDown); + wCurrent->Refresh(); + wCurrent->ReadKey(input); + } + wCurrent->SetTimeout(ncmpcpp_window_timeout); + } + else + wCurrent->Go(wDown); } else if (Keypressed(input, Key.PageUp)) { diff --git a/src/settings.cpp b/src/settings.cpp index 785157b0..e706299b 100644 --- a/src/settings.cpp +++ b/src/settings.cpp @@ -169,6 +169,7 @@ void DefaultConfiguration(ncmpcpp_config &conf) conf.statusbar_color = clDefault; conf.active_column_color = clRed; conf.colors_enabled = true; + conf.fancy_scrolling = true; conf.columns_in_playlist = false; conf.header_visibility = true; conf.statusbar_visibility = true; @@ -501,6 +502,10 @@ void ReadConfiguration(ncmpcpp_config &conf) { conf.colors_enabled = v == "yes"; } + else if (it->find("fancy_scrolling") != string::npos) + { + conf.fancy_scrolling = v == "yes"; + } else if (it->find("playlist_display_mode") != string::npos) { conf.columns_in_playlist = v == "columns"; diff --git a/src/settings.h b/src/settings.h index cddbaf75..ae642fec 100644 --- a/src/settings.h +++ b/src/settings.h @@ -115,6 +115,7 @@ struct ncmpcpp_config Color active_column_color; bool colors_enabled; + bool fancy_scrolling; bool columns_in_playlist; bool set_window_title; bool header_visibility; diff --git a/src/window.cpp b/src/window.cpp index 3c8310ee..a0be2ee6 100644 --- a/src/window.cpp +++ b/src/window.cpp @@ -226,6 +226,7 @@ void Window::Refresh(bool stub) void Window::Clear(bool stub) { werase(itsWindow); + wrefresh(itsWindow); } void Window::Hide(char x) const