summaryrefslogtreecommitdiff
path: root/baserender.c
diff options
context:
space:
mode:
authorMartin Schirrmacher <vdr.skinflatplus@schirrmacher.eu>2014-06-30 17:26:17 +0200
committerMartin Schirrmacher <vdr.skinflatplus@schirrmacher.eu>2014-06-30 17:26:17 +0200
commitdf1bbb5136b0d5a5aa49917e77073e7c4818428b (patch)
treefef17aff0d0ff9f99abe738abbf09e3c1d44f77f /baserender.c
parentc47fb40c9e8b8dbbe5125119feb4db324edb6778 (diff)
downloadskin-flatplus-df1bbb5136b0d5a5aa49917e77073e7c4818428b.tar.gz
skin-flatplus-df1bbb5136b0d5a5aa49917e77073e7c4818428b.tar.bz2
fix flicker with textscroller
Diffstat (limited to 'baserender.c')
-rw-r--r--baserender.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/baserender.c b/baserender.c
index 2afa89f2..233d397e 100644
--- a/baserender.c
+++ b/baserender.c
@@ -17,6 +17,7 @@ cFlatBaseRender::cFlatBaseRender(void) {
tobBarTitleExtra2 = "";
topBarLastDate = "";
topBarUpdateTitle = false;
+ topBarUpdateScroller = false;
topBarHeight = 0;
topBarExtraIconSet = false;
topBarMenuIconSet = false;
@@ -131,6 +132,11 @@ void cFlatBaseRender::TopBarCreate(void) {
}
void cFlatBaseRender::TopBarSetTitle(cString title) {
+ if( strcmp(*topBarTitle, *title) != 0 )
+ topBarUpdateScroller = true;
+
+ dsyslog("topBarTitle: %s title: %s topBarUpdateScroller: %d", *topBarTitle, *title, topBarUpdateScroller);
+
topBarTitle = title;
tobBarTitleExtra1 = "";
tobBarTitleExtra2 = "";
@@ -200,14 +206,13 @@ void cFlatBaseRender::TopBarEnableDiskUsage(void) {
TopBarSetTitleExtra(extra1, extra2);
TopBarSetExtraIcon(iconName);
}
-// sollte bei jedum "Flush" aufgerufen werden!
+// sollte bei jedem "Flush" aufgerufen werden!
void cFlatBaseRender::TopBarUpdate(void) {
cString curDate = DayDateTime();
int TopBarWidth = osdWidth - Config.decorBorderTopBarSize*2;
int MenuIconWidth = 0;
if ( strcmp(curDate, topBarLastDate) || topBarUpdateTitle ) {
- topBarScroller.Clear();
topBarUpdateTitle = false;
topBarLastDate = curDate;
@@ -365,7 +370,11 @@ void cFlatBaseRender::TopBarUpdate(void) {
int maxWidth = extraLeft - (MenuIconWidth + marginItem*2) - marginItem;
if( (TitleWidth > maxWidth) && Config.ScrollerEnable ) {
- topBarScroller.AddScroller(*topBarTitle, cRect(MenuIconWidth + marginItem*2, fontTop, maxWidth, topBarFontHeight), Theme.Color(clrTopBarFont), clrTransparent, topBarFont);
+ if( topBarUpdateScroller ) {
+ topBarScroller.Clear();
+ topBarScroller.AddScroller(*topBarTitle, cRect(MenuIconWidth + marginItem*2, fontTop, maxWidth, topBarFontHeight), Theme.Color(clrTopBarFont), clrTransparent, topBarFont);
+ topBarUpdateScroller = false;
+ }
TitleWidth = TitleWidthLeft;
} else {
/* int dotsWidth = topBarFont->Width("... ");
@@ -403,7 +412,6 @@ void cFlatBaseRender::TopBarUpdate(void) {
else
topBarPixmap->DrawText(cPoint(ConLeft + ConW + marginItem, fontSmlTop), ConNum, Theme.Color(clrTopBarConflictHighFg), Theme.Color(clrTopBarConflictHighBg), topBarFontSml);
}
-
}
}
@@ -559,7 +567,6 @@ void cFlatBaseRender::MessageSet(eMessageType Type, const char *Text) {
messagePixmap->DrawText(cPoint((osdWidth - textWidth) / 2, marginItem), Text, Theme.Color(clrMessageFont), Theme.Color(clrMessageBg), font);
}
-
int top = osdHeight - Config.MessageOffset - messageHeight - Config.decorBorderMessageSize;
DecorBorderDraw(Config.decorBorderMessageSize, top, osdWidth - Config.decorBorderMessageSize*2, messageHeight, Config.decorBorderMessageSize, Config.decorBorderMessageType, Config.decorBorderMessageFg, Config.decorBorderMessageBg, BorderMessage);
}