make number of lines scrolled with mouse wheel configurable

This commit is contained in:
Andrzej Rybczak
2009-08-09 20:56:15 +02:00
parent ea1edd4d4a
commit dbca4a80ee
5 changed files with 16 additions and 2 deletions

View File

@@ -25,6 +25,7 @@
#include "menu.h"
#include "mpdpp.h"
#include "helpers.h"
#include "settings.h"
#include "status.h"
class BasicScreen
@@ -149,12 +150,12 @@ template <> inline void Screen<Scrollpad>::MouseButtonPressed(MEVENT me)
{
if (me.bstate & BUTTON2_PRESSED)
{
for (size_t i = 0; i < 2; ++i)
for (size_t i = 0; i < Config.lines_scrolled; ++i)
Scroll(wDown);
}
else if (me.bstate & BUTTON4_PRESSED)
{
for (size_t i = 0; i < 2; ++i)
for (size_t i = 0; i < Config.lines_scrolled; ++i)
Scroll(wUp);
}
}

View File

@@ -293,6 +293,7 @@ void DefaultConfiguration(ncmpcpp_config &conf)
conf.message_delay_time = 4;
conf.lyrics_db = 0;
conf.regex_type = 0;
conf.lines_scrolled = 2;
}
void ReadKeys(ncmpcpp_keys &keys)
@@ -708,6 +709,11 @@ void ReadConfiguration(ncmpcpp_config &conf)
conf.lyrics_db = n < Lyrics::DBs ? n : 0;
}
}
else if (cl.find("lines_scrolled") != std::string::npos)
{
if (!v.empty())
conf.lines_scrolled = StrToInt(v);
}
else if (cl.find("song_window_title_format") != std::string::npos)
{
if (!v.empty())

View File

@@ -196,6 +196,8 @@ struct ncmpcpp_config
int message_delay_time;
int lyrics_db;
int regex_type;
unsigned lines_scrolled;
};
extern ncmpcpp_config Config;