diff options
author | louis <louis.braun@gmx.de> | 2013-10-03 11:24:09 +0200 |
---|---|---|
committer | louis <louis.braun@gmx.de> | 2013-10-03 11:24:09 +0200 |
commit | a62603f668789cd98d17e65f08cce62340676977 (patch) | |
tree | 35d66a7bc803c6778f1e9d9a22bcae8380f319cd /menuitem.c | |
parent | 342afc759bb81fd1065048893a020c1a38d200aa (diff) | |
download | skin-nopacity-a62603f668789cd98d17e65f08cce62340676977.tar.gz skin-nopacity-a62603f668789cd98d17e65f08cce62340676977.tar.bz2 |
Configurable Menu Item Scroll Mode
Diffstat (limited to 'menuitem.c')
-rw-r--r-- | menuitem.c | 16 |
1 files changed, 14 insertions, 2 deletions
@@ -115,6 +115,8 @@ void cNopacityMenuItem::DrawDelimiter(const char *del, const char *icon, eBackgr } void cNopacityMenuItem::Action(void) { + bool carriageReturn = (config.scrollMode == 0) ? true : false; + int scrollDelta = 1; int scrollDelay = config.menuScrollDelay * 1000; DoSleep(scrollDelay); cPixmap::Lock(); @@ -133,11 +135,21 @@ void cNopacityMenuItem::Action(void) { uint64_t Now = cTimeMs::Now(); cPixmap::Lock(); drawPortX = pixmapTextScroller->DrawPort().X(); - drawPortX -= 1; + drawPortX -= scrollDelta; cPixmap::Unlock(); + if (abs(drawPortX) > maxX) { DoSleep(scrollDelay); - drawPortX = 0; + if (carriageReturn) + drawPortX = 0; + else { + scrollDelta *= -1; + drawPortX -= scrollDelta; + } + doSleep = true; + } + if (!carriageReturn && (drawPortX == 0)) { + scrollDelta *= -1; doSleep = true; } cPixmap::Lock(); |