diff options
author | Martin Schirrmacher <vdr.skinflatplus@schirrmacher.eu> | 2013-11-13 20:24:59 +0100 |
---|---|---|
committer | Martin Schirrmacher <vdr.skinflatplus@schirrmacher.eu> | 2013-11-13 20:24:59 +0100 |
commit | 4a855302f65dbc377126da73346103c7dac23b85 (patch) | |
tree | f99fea88d2e53d7c5e01af0714030776b1b98580 | |
parent | bbd0d760c774a7d0f503f905a15f5c59098303f4 (diff) | |
download | skin-flatplus-4a855302f65dbc377126da73346103c7dac23b85.tar.gz skin-flatplus-4a855302f65dbc377126da73346103c7dac23b85.tar.bz2 |
show menu scrollbar only if needed
-rw-r--r-- | displaymenu.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/displaymenu.c b/displaymenu.c index e31c83dd..0f62bac5 100644 --- a/displaymenu.c +++ b/displaymenu.c @@ -16,7 +16,7 @@ cFlatDisplayMenu::cFlatDisplayMenu(void) { buttonsHeight + Config.decorBorderButtonSize*2 + marginItem*3 ); scrollBarTop = topBarHeight + marginItem + Config.decorBorderTopBarSize*2; - menuWidth = osdWidth - scrollBarWidth; + menuWidth = osdWidth; // - scrollBarWidth; // scrollbar only if needed menuTop = topBarHeight + marginItem + Config.decorBorderTopBarSize*2 + Config.decorBorderMenuItemSize; menuPixmap = osd->CreatePixmap(1, cRect(0, menuTop, menuWidth, scrollBarHeight )); @@ -54,6 +54,9 @@ void cFlatDisplayMenu::SetMenuCategory(eMenuCategory MenuCategory) { } void cFlatDisplayMenu::DrawScrollbar(int Total, int Offset, int Shown, int Top, int Height, bool CanScrollUp, bool CanScrollDown) { + if (Total > 0 && Total > Shown) + menuPixmap->DrawRectangle(cRect(menuWidth - scrollBarWidth, 0, scrollBarWidth, scrollBarHeight), clrTransparent); + ScrollbarDraw(scrollbarPixmap, Config.MenuItemPadding, Top, Height, Total, Offset, Shown, CanScrollUp, CanScrollDown); } |