stop using literal 500 as a window timeout

This commit is contained in:
Andrzej Rybczak
2015-05-19 19:15:09 +02:00
parent 125ae9b505
commit 7c15dd954e
4 changed files with 7 additions and 5 deletions

View File

@@ -2686,7 +2686,7 @@ void seek()
auto t = Timer;
int old_timeout = wFooter->getTimeout();
wFooter->setTimeout(500);
wFooter->setTimeout(BaseScreen::defaultWindowTimeout);
auto seekForward = &Actions::get(Actions::Type::SeekForward);
auto seekBackward = &Actions::get(Actions::Type::SeekBackward);

View File

@@ -163,7 +163,7 @@ public:
MediaLibrary::MediaLibrary()
: m_timer(boost::posix_time::from_time_t(0))
, m_window_timeout(Config.data_fetching_delay ? 250 : 500)
, m_window_timeout(Config.data_fetching_delay ? 250 : BaseScreen::defaultWindowTimeout)
, m_fetching_delay(boost::posix_time::milliseconds(Config.data_fetching_delay ? 250 : -1))
{
hasTwoColumns = 0;

View File

@@ -62,7 +62,7 @@ bool SongEntryMatcher(const Regex::Regex &rx, const MPD::Song &s);
PlaylistEditor::PlaylistEditor()
: m_timer(boost::posix_time::from_time_t(0))
, m_window_timeout(Config.data_fetching_delay ? 250 : 500)
, m_window_timeout(Config.data_fetching_delay ? 250 : BaseScreen::defaultWindowTimeout)
, m_fetching_delay(boost::posix_time::milliseconds(Config.data_fetching_delay ? 250 : -1))
{
LeftColumnWidth = COLS/3-1;

View File

@@ -101,6 +101,8 @@ struct BaseScreen
/// Unlocks a screen, ie. hides merged window (if there is one set).
static void unlock();
const static int defaultWindowTimeout = 500;
protected:
/// Gets X offset and width of current screen to be used eg. in resize() function.
/// @param adjust_locked_screen indicates whether this function should
@@ -187,9 +189,9 @@ public:
}
/// @return timeout parameter used for the screen (in ms)
/// @default 500
/// @default defaultWindowTimeout
virtual int windowTimeout() OVERRIDE {
return 500;
return defaultWindowTimeout;
}
/// Invoked after there was one of mouse buttons pressed