introduce switch for 'fancy scrolling'

This commit is contained in:
unK
2008-09-13 23:50:24 +02:00
parent 8bdda428bb
commit fb04687fef
5 changed files with 35 additions and 2 deletions

View File

@@ -116,6 +116,8 @@
# #
#colors_enabled = "yes" #colors_enabled = "yes"
# #
#fancy_scrolling = "yes"
#
#empty_tag_color = "cyan" #empty_tag_color = "cyan"
# #
#header_window_color = "default" #header_window_color = "default"

View File

@@ -719,11 +719,35 @@ int main(int argc, char *argv[])
if (Keypressed(input, Key.Up)) 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)) 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)) else if (Keypressed(input, Key.PageUp))
{ {

View File

@@ -169,6 +169,7 @@ void DefaultConfiguration(ncmpcpp_config &conf)
conf.statusbar_color = clDefault; conf.statusbar_color = clDefault;
conf.active_column_color = clRed; conf.active_column_color = clRed;
conf.colors_enabled = true; conf.colors_enabled = true;
conf.fancy_scrolling = true;
conf.columns_in_playlist = false; conf.columns_in_playlist = false;
conf.header_visibility = true; conf.header_visibility = true;
conf.statusbar_visibility = true; conf.statusbar_visibility = true;
@@ -501,6 +502,10 @@ void ReadConfiguration(ncmpcpp_config &conf)
{ {
conf.colors_enabled = v == "yes"; 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) else if (it->find("playlist_display_mode") != string::npos)
{ {
conf.columns_in_playlist = v == "columns"; conf.columns_in_playlist = v == "columns";

View File

@@ -115,6 +115,7 @@ struct ncmpcpp_config
Color active_column_color; Color active_column_color;
bool colors_enabled; bool colors_enabled;
bool fancy_scrolling;
bool columns_in_playlist; bool columns_in_playlist;
bool set_window_title; bool set_window_title;
bool header_visibility; bool header_visibility;

View File

@@ -226,6 +226,7 @@ void Window::Refresh(bool stub)
void Window::Clear(bool stub) void Window::Clear(bool stub)
{ {
werase(itsWindow); werase(itsWindow);
wrefresh(itsWindow);
} }
void Window::Hide(char x) const void Window::Hide(char x) const