diff options
-rw-r--r-- | HISTORY | 3 | ||||
-rw-r--r-- | baserender.c | 40 | ||||
-rw-r--r-- | baserender.h | 3 | ||||
-rw-r--r-- | config.c | 4 | ||||
-rw-r--r-- | config.h | 2 | ||||
-rw-r--r-- | po/de_DE.po | 5 | ||||
-rw-r--r-- | setup.c | 3 |
7 files changed, 40 insertions, 20 deletions
@@ -4,6 +4,9 @@ VDR Plugin 'skinflatplus' Revision History 2013-XX-XX: Version 0.0.2 - [fix] marker position - [fix] borders displaced +- [fix] menu has full width if no scrollbar is needed +- [update] TopBar title align right +- [add] add free minutes in disk usage 2013-23-09: Version 0.0.1 difference to skinflat diff --git a/baserender.c b/baserender.c index f945abb5..ca2aa0b2 100644 --- a/baserender.c +++ b/baserender.c @@ -84,10 +84,16 @@ void cFlatBaseRender::CreateOsd(int left, int top, int width, int height) { } void cFlatBaseRender::TopBarCreate(void) { - if( fontHeight > fontSmlHeight*2 ) - topBarHeight = fontHeight; + int fs = int(round(cOsd::OsdHeight() * Config.TopBarFontSize)); + topBarFont = cFont::CreateFont(Setup.FontOsd, fs); + topBarFontSml = cFont::CreateFont(Setup.FontOsd, fs / 2); + topBarFontHeight = topBarFont->Height(); + topBarFontSmlHeight = topBarFontSml->Height(); + + if( topBarFontHeight > topBarFontSmlHeight*2 ) + topBarHeight = topBarFontHeight; else - topBarHeight = fontSmlHeight * 2; + topBarHeight = topBarFontSmlHeight * 2; topBarPixmap = osd->CreatePixmap(1, cRect(Config.decorBorderTopBarSize, Config.decorBorderTopBarSize, osdWidth - Config.decorBorderTopBarSize*2, topBarHeight)); topBarExtraIconPixmap = osd->CreatePixmap(2, cRect(Config.decorBorderTopBarSize, Config.decorBorderTopBarSize, osdWidth - Config.decorBorderTopBarSize*2, topBarHeight)); @@ -124,24 +130,24 @@ void cFlatBaseRender::TopBarUpdate(void) { topBarUpdateTitle = false; topBarLastDate = curDate; - int fontTop = (topBarHeight - fontHeight) / 2; - int fontSmlTop = (topBarHeight - fontSmlHeight*2) / 2; + int fontTop = (topBarHeight - topBarFontHeight) / 2; + int fontSmlTop = (topBarHeight - topBarFontSmlHeight*2) / 2; topBarPixmap->Fill(Theme.Color(clrTopBarBg)); - topBarPixmap->DrawText(cPoint(marginItem*2, fontTop), topBarTitle, Theme.Color(clrTopBarFont), Theme.Color(clrTopBarBg), font); + topBarPixmap->DrawText(cPoint(marginItem*2, fontTop), topBarTitle, Theme.Color(clrTopBarFont), Theme.Color(clrTopBarBg), topBarFont); - int extra1Width = fontSml->Width(tobBarTitleExtra1); - int extra2Width = fontSml->Width(tobBarTitleExtra2); + int extra1Width = topBarFontSml->Width(tobBarTitleExtra1); + int extra2Width = topBarFontSml->Width(tobBarTitleExtra2); int extraMaxWidth = max(extra1Width, extra2Width); int extraLeft = TopBarWidth/2 - extraMaxWidth/2; - topBarPixmap->DrawText(cPoint(extraLeft, fontSmlTop), tobBarTitleExtra1, Theme.Color(clrTopBarDateFont), Theme.Color(clrTopBarBg), fontSml, extraMaxWidth, 0, taRight); - topBarPixmap->DrawText(cPoint(extraLeft, fontSmlTop + fontSmlHeight), tobBarTitleExtra2, Theme.Color(clrTopBarDateFont), Theme.Color(clrTopBarBg), fontSml, extraMaxWidth, 0, taRight); + topBarPixmap->DrawText(cPoint(extraLeft, fontSmlTop), tobBarTitleExtra1, Theme.Color(clrTopBarDateFont), Theme.Color(clrTopBarBg), topBarFontSml, extraMaxWidth, 0, taRight); + topBarPixmap->DrawText(cPoint(extraLeft, fontSmlTop + topBarFontSmlHeight), tobBarTitleExtra2, Theme.Color(clrTopBarDateFont), Theme.Color(clrTopBarBg), topBarFontSml, extraMaxWidth, 0, taRight); topBarExtraIconPixmap->Fill(clrTransparent); if( topBarExtraIconSet ) { int extraIconLeft = extraLeft + extraMaxWidth + marginItem; - if (imgLoader.LoadIcon(*topBarExtraIcon)) { + if (imgLoader.LoadIcon(*topBarExtraIcon, topBarHeight)) { int iconTop = topBarHeight / 2 - imgLoader.Height()/2; topBarExtraIconPixmap->DrawImage(cPoint(extraIconLeft, iconTop), imgLoader.GetImage()); } @@ -152,19 +158,19 @@ void cFlatBaseRender::TopBarUpdate(void) { cString time = TimeString(t); cString time2 = cString::sprintf("%s %s", *time, tr("clock")); - int timeWidth = font->Width(*time2) + marginItem*2; - topBarPixmap->DrawText(cPoint(TopBarWidth - timeWidth, fontTop), time2, Theme.Color(clrTopBarTimeFont), Theme.Color(clrTopBarBg), font); + int timeWidth = topBarFont->Width(*time2) + marginItem*2; + topBarPixmap->DrawText(cPoint(TopBarWidth - timeWidth, fontTop), time2, Theme.Color(clrTopBarTimeFont), Theme.Color(clrTopBarBg), topBarFont); cString weekday = WeekDayNameFull(t); - int weekdayWidth = fontSml->Width(*weekday); + int weekdayWidth = topBarFontSml->Width(*weekday); cString date = ShortDateString(t); - int dateWidth = fontSml->Width(*date); + int dateWidth = topBarFontSml->Width(*date); int fullWidth = max(weekdayWidth, dateWidth); - topBarPixmap->DrawText(cPoint(TopBarWidth - timeWidth - fullWidth - marginItem*2, fontSmlTop), weekday, Theme.Color(clrTopBarDateFont), Theme.Color(clrTopBarBg), fontSml, fullWidth, 0, taRight); - topBarPixmap->DrawText(cPoint(TopBarWidth - timeWidth - fullWidth - marginItem*2, fontSmlTop + fontSmlHeight), date, Theme.Color(clrTopBarDateFont), Theme.Color(clrTopBarBg), fontSml, fullWidth, 0, taRight); + topBarPixmap->DrawText(cPoint(TopBarWidth - timeWidth - fullWidth - marginItem*2, fontSmlTop), weekday, Theme.Color(clrTopBarDateFont), Theme.Color(clrTopBarBg), topBarFontSml, fullWidth, 0, taRight); + topBarPixmap->DrawText(cPoint(TopBarWidth - timeWidth - fullWidth - marginItem*2, fontSmlTop + topBarFontSmlHeight), date, Theme.Color(clrTopBarDateFont), Theme.Color(clrTopBarBg), topBarFontSml, fullWidth, 0, taRight); DecorBorderDraw(Config.decorBorderTopBarSize, Config.decorBorderTopBarSize, osdWidth - Config.decorBorderTopBarSize*2, topBarHeight, Config.decorBorderTopBarSize, Config.decorBorderTopBarType, Config.decorBorderTopBarFg, Config.decorBorderTopBarBg); } diff --git a/baserender.h b/baserender.h index 15aa2a88..65d8f197 100644 --- a/baserender.h +++ b/baserender.h @@ -34,6 +34,9 @@ class cFlatBaseRender // TopBar cPixmap *topBarPixmap; cPixmap *topBarExtraIconPixmap; + cFont *topBarFont, *topBarFontSml; + int topBarFontHeight, topBarFontSmlHeight; + cString topBarTitle; cString tobBarTitleExtra1, tobBarTitleExtra2; cString topBarExtraIcon; @@ -14,7 +14,8 @@ cFlatConfig::cFlatConfig(void) { MenuItemPadding = 5; marginOsdVer = 5; marginOsdHor = 5; - + TopBarFontSize = 0.05; + decorBorderChannelByTheme = 1; decorBorderChannelTypeUser = 0; decorBorderChannelSizeUser = 0; @@ -135,6 +136,7 @@ bool cFlatConfig::SetupParse(const char *Name, const char *Value) { else if (strcmp(Name, "MenuItemPadding") == 0) MenuItemPadding = atoi(Value); else if (strcmp(Name, "marginOsdVer") == 0) marginOsdVer = atoi(Value); else if (strcmp(Name, "marginOsdHor") == 0) marginOsdHor = atoi(Value); + else if (strcmp(Name, "TopBarFontSize") == 0) TopBarFontSize = atod(Value); else return false; return true; } @@ -150,4 +150,6 @@ class cFlatConfig int MenuItemPadding; int marginOsdVer, marginOsdHor; + + double TopBarFontSize; }; diff --git a/po/de_DE.po b/po/de_DE.po index b8cd81e4..d8eaa54d 100644 --- a/po/de_DE.po +++ b/po/de_DE.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: vdr-skinflat 0.0.1\n" "Report-Msgid-Bugs-To: <see README>\n" -"POT-Creation-Date: 2013-09-23 10:56+0200\n" +"POT-Creation-Date: 2013-11-16 12:51+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: LANGUAGE <LL@li.org>\n" @@ -108,6 +108,9 @@ msgstr "OSD vertikaler Rand" msgid "OSD horizontal margin" msgstr "OSD horizontaler Rand" +msgid "TopBar font size" +msgstr "" + msgid "TopBar border by theme?" msgstr "TopBar Rand vom Theme?" @@ -131,7 +131,7 @@ void cFlatSetup::Store(void) { SetupStore("MenuItemPadding", Config.MenuItemPadding); SetupStore("marginOsdVer", Config.marginOsdVer); SetupStore("marginOsdHor", Config.marginOsdHor); - + SetupStore("TopBarFontSize", dtoa(Config.TopBarFontSize)); Config.Init(); } @@ -162,6 +162,7 @@ void cFlatSetupGeneral::Setup(void) { Add(new cMenuEditBoolItem(tr("Show Diskusage stats"), &SetupConfig->DiskUsageShow)); Add(new cMenuEditIntItem(tr("OSD vertical margin"), &SetupConfig->marginOsdVer)); Add(new cMenuEditIntItem(tr("OSD horizontal margin"), &SetupConfig->marginOsdHor)); + Add(new cMenuEditPrcItem(tr("TopBar font size"), &SetupConfig->TopBarFontSize, 0.01, 0.2, 1)); Add(new cMenuEditBoolItem(tr("TopBar border by theme?"), &SetupConfig->decorBorderTopBarByTheme)); if( SetupConfig->decorBorderTopBarByTheme ) { |