summaryrefslogtreecommitdiff
path: root/menuitem.c
diff options
context:
space:
mode:
authorlouis <louis.braun@gmx.de>2013-10-03 11:24:09 +0200
committerlouis <louis.braun@gmx.de>2013-10-03 11:24:09 +0200
commita62603f668789cd98d17e65f08cce62340676977 (patch)
tree35d66a7bc803c6778f1e9d9a22bcae8380f319cd /menuitem.c
parent342afc759bb81fd1065048893a020c1a38d200aa (diff)
downloadskin-nopacity-a62603f668789cd98d17e65f08cce62340676977.tar.gz
skin-nopacity-a62603f668789cd98d17e65f08cce62340676977.tar.bz2
Configurable Menu Item Scroll Mode
Diffstat (limited to 'menuitem.c')
-rw-r--r--menuitem.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/menuitem.c b/menuitem.c
index cf6dca1..d2cf730 100644
--- a/menuitem.c
+++ b/menuitem.c
@@ -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();