summaryrefslogtreecommitdiff
path: root/baserender.c
diff options
context:
space:
mode:
Diffstat (limited to 'baserender.c')
-rw-r--r--baserender.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/baserender.c b/baserender.c
index de05ee41..a622f309 100644
--- a/baserender.c
+++ b/baserender.c
@@ -22,7 +22,10 @@ cFlatBaseRender::cFlatBaseRender(void) {
topBarUpdateTitle = false;
topBarHeight = 0;
topBarExtraIconSet = false;
+ topBarMenuIcon = "";
topBarMenuIconSet = false;
+ topBarMenuIconRight = "";
+ topBarMenuIconRightSet = false;
topBarMenuLogo = "";
topBarMenuLogoSet = false;
@@ -140,6 +143,8 @@ void cFlatBaseRender::TopBarSetTitle(cString title) {
tobBarTitleExtra2 = "";
topBarExtraIcon = "";
topBarMenuIcon = "";
+ topBarMenuIconRight = "";
+ topBarMenuIconRightSet = false;
topBarUpdateTitle = true;
topBarExtraIconSet = false;
topBarMenuIconSet = false;
@@ -171,6 +176,14 @@ void cFlatBaseRender::TopBarSetMenuIcon(cString icon) {
topBarUpdateTitle = true;
}
+void cFlatBaseRender::TopBarSetMenuIconRight(cString icon) {
+ if( !strcmp(*icon, "") )
+ return;
+ topBarMenuIconRight = icon;
+ topBarMenuIconRightSet = true;
+ topBarUpdateTitle = true;
+}
+
void cFlatBaseRender::TopBarSetMenuLogo(cString icon) {
if( !strcmp(*icon, "") )
return;
@@ -429,6 +442,16 @@ void cFlatBaseRender::TopBarUpdate(void) {
Right += topBarFontSml->Width(*ConNum) + marginItem;
}
+ if( topBarMenuIconRightSet ) {
+ cImage *img = imgLoader.LoadIcon(*topBarMenuIconRight, 999, topBarHeight - marginItem*2);
+ if( img ) {
+ titleMaxWidth -= img->Width()+marginItem*2;
+ int IconLeft = titleLeft + topBarFont->Width(topBarTitle) + marginItem;
+ int iconTop = (topBarHeight / 2 - img->Height()/2);
+ topBarIconPixmap->DrawImage(cPoint(IconLeft, iconTop), *img);
+ }
+ }
+
topBarPixmap->DrawText(cPoint(titleLeft, fontTop), topBarTitle, Theme.Color(clrTopBarFont), Theme.Color(clrTopBarBg), topBarFont, titleMaxWidth);
DecorBorderDraw(Config.decorBorderTopBarSize, Config.decorBorderTopBarSize, osdWidth - Config.decorBorderTopBarSize*2, topBarHeight, Config.decorBorderTopBarSize, Config.decorBorderTopBarType, Config.decorBorderTopBarFg, Config.decorBorderTopBarBg);