summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--HISTORY2
-rw-r--r--baserender.c180
-rw-r--r--config.c2
-rw-r--r--config.h1
-rw-r--r--po/de_DE.po5
-rw-r--r--setup.c2
6 files changed, 103 insertions, 89 deletions
diff --git a/HISTORY b/HISTORY
index 9315602c..b7375e24 100644
--- a/HISTORY
+++ b/HISTORY
@@ -2,6 +2,7 @@ VDR Plugin 'skinflatplus' Revision History
---------------------------------------
2014-MM-DD: Version 0.4.0
+- [update] topbar position of text
- [add] Textscroller support
- text in displaychannel for epg-text and epgshort-text
- messages
@@ -10,6 +11,7 @@ VDR Plugin 'skinflatplus' Revision History
- menu item recording
- menu item event
- [add] new options in general settings for textscroller
+- [add] new option "diskusage short display" for only show percantage and free hours
2014-06-19: Version 0.3.1
- [fix] epg image position on channel info
diff --git a/baserender.c b/baserender.c
index 468f3f54..8cfee1ac 100644
--- a/baserender.c
+++ b/baserender.c
@@ -174,8 +174,15 @@ void cFlatBaseRender::TopBarEnableDiskUsage(void) {
int DiskUsage = cVideoDiskUsage::UsedPercent();
double FreeGB = cVideoDiskUsage::FreeMB() / 1024.0;
int FreeMinutes = cVideoDiskUsage::FreeMinutes();
- cString extra1 = cString::sprintf("%s: %d%%", tr("disk usage"), DiskUsage);
- cString extra2 = cString::sprintf("%s: %.1f GB ~ %02d:%02d", tr("free"), FreeGB, FreeMinutes / 60, FreeMinutes % 60);
+ cString extra1;
+ cString extra2;
+ if( Config.DiskUsageShort == false ) {
+ extra1 = cString::sprintf("%s: %d%%", tr("disk usage"), DiskUsage);
+ extra2 = cString::sprintf("%s: %.1f GB ~ %02d:%02d", tr("free"), FreeGB, FreeMinutes / 60, FreeMinutes % 60);
+ } else {
+ extra1 = cString::sprintf("%d%%", DiskUsage);
+ extra2 = cString::sprintf("%02d:%02d", FreeMinutes / 60, FreeMinutes % 60);
+ }
cString iconName("chart1");
if( DiskUsage > 14 )
@@ -199,6 +206,8 @@ void cFlatBaseRender::TopBarUpdate(void) {
cString curDate = DayDateTime();
int TopBarWidth = osdWidth - Config.decorBorderTopBarSize*2;
int MenuIconWidth = 0;
+ cImage *imgCon = NULL;
+ cImage *imgRec = NULL;
if ( strcmp(curDate, topBarLastDate) || topBarUpdateTitle ) {
topBarUpdateTitle = false;
@@ -211,6 +220,43 @@ void cFlatBaseRender::TopBarUpdate(void) {
topBarIconPixmap->Fill(clrTransparent);
topBarIconBGPixmap->Fill(clrTransparent);
+ int titleWitdh = topBarFont->Width(topBarTitle);
+
+ if( topBarMenuIconSet && Config.TopBarMenuIconShow ) {
+ int IconLeft = marginItem;
+ cImage *img = imgLoader.LoadIcon(*topBarMenuIcon, 999, topBarHeight - marginItem*2);
+ if( img ) {
+ int iconTop = (topBarHeight / 2 - img->Height()/2);
+ topBarIconPixmap->DrawImage(cPoint(IconLeft, iconTop), *img);
+ MenuIconWidth = img->Width()+marginItem*2;
+ }
+ }
+
+ if( topBarMenuLogoSet && Config.TopBarMenuIconShow ) {
+ topBarIconPixmap->Fill(clrTransparent);
+ int IconLeft = marginItem;
+ int imageBGHeight = topBarHeight - marginItem*2;
+ int imageBGWidth = imageBGHeight*1.34;
+ int iconTop = 0;
+
+ cImage *imgBG = imgLoader.LoadIcon("logo_background", imageBGWidth, imageBGHeight);
+ if( imgBG ) {
+ imageBGHeight = imgBG->Height();
+ imageBGWidth = imgBG->Width();
+ iconTop = (topBarHeight / 2 - imgBG->Height()/2);
+ topBarIconBGPixmap->DrawImage( cPoint(IconLeft, iconTop), *imgBG );
+ }
+
+ cImage *img = imgLoader.LoadLogo(*topBarMenuLogo, imageBGWidth - 4, imageBGHeight - 4);
+ if( img ) {
+ iconTop += (imageBGHeight - img->Height())/2;
+ IconLeft += (imageBGWidth - img->Width())/2;
+ topBarIconPixmap->DrawImage(cPoint(IconLeft, iconTop), *img);
+ }
+ MenuIconWidth = imageBGWidth+marginItem*2;
+ }
+ int titleLeft = MenuIconWidth + marginItem*2;
+
time_t t;
time(&t);
@@ -231,7 +277,8 @@ void cFlatBaseRender::TopBarUpdate(void) {
topBarPixmap->DrawText(cPoint(Right, fontSmlTop), weekday, Theme.Color(clrTopBarDateFont), Theme.Color(clrTopBarBg), topBarFontSml, max(weekdayWidth, dateWidth), 0, taRight);
topBarPixmap->DrawText(cPoint(Right, fontSmlTop + topBarFontSmlHeight), date, Theme.Color(clrTopBarDateFont), Theme.Color(clrTopBarBg), topBarFontSml, max(weekdayWidth, dateWidth), 0, taRight);
- int numConflicts = 0, ConW = 0;
+ int middleWidth = 0;
+ int numConflicts = 0;
if( Config.TopBarRecConflictsShow ) {
cPlugin *p = cPluginManager::GetPlugin("epgsearch");
if (p) {
@@ -248,46 +295,19 @@ void cFlatBaseRender::TopBarUpdate(void) {
}
}
if( numConflicts ) {
- cImage *imgCon = NULL;
if( numConflicts < Config.TopBarRecConflictsHigh )
imgCon = imgLoader.LoadIcon("topbar_timerconflict_low", topBarFontHeight - marginItem*2, topBarFontHeight - marginItem*2);
else
imgCon = imgLoader.LoadIcon("topbar_timerconflict_high", topBarFontHeight - marginItem*2, topBarFontHeight - marginItem*2);
if( imgCon ) {
- ConW = imgCon->Width();
cString Con = cString::sprintf("%d", numConflicts);
- ConW += topBarFontSml->Width(*Con);
- Right -= ConW + marginItem;
-
- int iconTop = (topBarFontHeight - imgCon->Height()) / 2;
- topBarIconPixmap->DrawImage( cPoint(Right, iconTop), *imgCon );
- ConW = imgCon->Width();
-
- cString ConNum = cString::sprintf("%d", numConflicts);
- if( numConflicts < Config.TopBarRecConflictsHigh )
- topBarPixmap->DrawText(cPoint(Right + imgCon->Width(), fontSmlTop), ConNum, Theme.Color(clrTopBarConflictLowFg), Theme.Color(clrTopBarConflictLowBg), topBarFontSml);
- else
- topBarPixmap->DrawText(cPoint(Right + imgCon->Width(), fontSmlTop), ConNum, Theme.Color(clrTopBarConflictHighFg), Theme.Color(clrTopBarConflictHighBg), topBarFontSml);
+ Right -= imgCon->Width() + topBarFontSml->Width(*Con) + marginItem;
+ middleWidth += imgCon->Width() + topBarFontSml->Width(*Con) + marginItem;
}
}
}
- if( numConflicts == 0 ) {
- cImage *imgCon = NULL;
- if( numConflicts < Config.TopBarRecConflictsHigh )
- imgCon = imgLoader.LoadIcon("topbar_timerconflict_low", topBarFontHeight - marginItem*2, topBarFontHeight - marginItem*2);
- else
- imgCon = imgLoader.LoadIcon("topbar_timerconflict_high", topBarFontHeight - marginItem*2, topBarFontHeight - marginItem*2);
- if( imgCon ) {
- ConW = imgCon->Width();
- cString Con = cString::sprintf("%d", numConflicts);
- ConW += topBarFontSml->Width(*Con);
- Right -= ConW + marginItem;
- }
- }
-
- int RecW = 0;
int numRec = 0;
if( Config.TopBarRecordingShow ) {
// look for timers
@@ -297,88 +317,72 @@ void cFlatBaseRender::TopBarUpdate(void) {
}
}
if( numRec ) {
- cImage *imgRec = imgLoader.LoadIcon("topbar_timer", topBarFontHeight - marginItem*2, topBarFontHeight - marginItem*2);
+ imgRec = imgLoader.LoadIcon("topbar_timer", topBarFontHeight - marginItem*2, topBarFontHeight - marginItem*2);
if( imgRec ) {
- RecW = imgRec->Width();
-
cString Rec = cString::sprintf("%d", numRec);
- RecW += topBarFontSml->Width(*Rec);
- Right -= RecW + marginItem;
-
- int iconTop = (topBarFontHeight - imgRec->Height()) / 2;
- topBarIconPixmap->DrawImage( cPoint(Right, iconTop), *imgRec );
- RecW = imgRec->Width() + marginItem;
-
- cString RecNum = cString::sprintf("%d", numRec);
- topBarPixmap->DrawText(cPoint(Right + imgRec->Width(), fontSmlTop), RecNum, Theme.Color(clrTopBarRecordingActiveFg), Theme.Color(clrTopBarRecordingActiveBg), topBarFontSml);
+ Right -= imgRec->Width() + topBarFontSml->Width(*Rec) + marginItem;
+ middleWidth += imgRec->Width() + topBarFontSml->Width(*Rec) + marginItem;
}
}
}
- if( numRec == 0 ) {
- cImage *imgRec = imgLoader.LoadIcon("topbar_timer", topBarFontHeight - marginItem*2, topBarFontHeight - marginItem*2);
- if( imgRec ) {
- RecW = imgRec->Width();
-
- cString Rec = cString::sprintf("%d", numRec);
- RecW += topBarFontSml->Width(*Rec);
- Right -= RecW + marginItem;
- }
- }
-
-
- int extra1Width = topBarFontSml->Width(tobBarTitleExtra1);
- int extra2Width = topBarFontSml->Width(tobBarTitleExtra2);
- int extraMaxWidth = max(extra1Width, extra2Width);
if( topBarExtraIconSet ) {
cImage *img = imgLoader.LoadIcon(*topBarExtraIcon, 999, topBarHeight);
if( img ) {
- int iconTop = 0;
Right -= img->Width() + marginItem;
- topBarIconPixmap->DrawImage(cPoint(Right, iconTop), *img);
+ middleWidth += img->Width() + marginItem;
}
}
+ int extra1Width = topBarFontSml->Width(tobBarTitleExtra1);
+ int extra2Width = topBarFontSml->Width(tobBarTitleExtra2);
+ int extraMaxWidth = max(extra1Width, extra2Width);
+ middleWidth += extraMaxWidth;
Right -= extraMaxWidth + marginItem;
+ if( (titleLeft + titleWitdh) < (TopBarWidth/2 - middleWidth/2) )
+ Right = TopBarWidth/2 - middleWidth/2;
+ else if( (titleLeft + titleWitdh) < Right )
+ Right = titleLeft + titleWitdh + marginItem;
+
+ int titleMaxWidth = Right - titleLeft - marginItem;
+
topBarPixmap->DrawText(cPoint(Right, fontSmlTop), tobBarTitleExtra1, Theme.Color(clrTopBarDateFont), Theme.Color(clrTopBarBg), topBarFontSml, extraMaxWidth, 0, taRight);
topBarPixmap->DrawText(cPoint(Right, fontSmlTop + topBarFontSmlHeight), tobBarTitleExtra2, Theme.Color(clrTopBarDateFont), Theme.Color(clrTopBarBg), topBarFontSml, extraMaxWidth, 0, taRight);
+ Right += extraMaxWidth + marginItem;
- if( topBarMenuIconSet && Config.TopBarMenuIconShow ) {
- int IconLeft = marginItem;
- cImage *img = imgLoader.LoadIcon(*topBarMenuIcon, 999, topBarHeight - marginItem*2);
+ if( topBarExtraIconSet ) {
+ cImage *img = imgLoader.LoadIcon(*topBarExtraIcon, 999, topBarHeight);
if( img ) {
- int iconTop = (topBarHeight / 2 - img->Height()/2);
- topBarIconPixmap->DrawImage(cPoint(IconLeft, iconTop), *img);
- MenuIconWidth = img->Width()+marginItem*2;
+ int iconTop = 0;
+ topBarIconPixmap->DrawImage(cPoint(Right, iconTop), *img);
+ Right += img->Width() + marginItem;
}
}
- if( topBarMenuLogoSet && Config.TopBarMenuIconShow ) {
- topBarIconPixmap->Fill(clrTransparent);
- int IconLeft = marginItem;
- int imageBGHeight = topBarHeight - marginItem*2;
- int imageBGWidth = imageBGHeight*1.34;
- int iconTop = 0;
+ if( numRec && imgRec ) {
+ int iconTop = (topBarFontHeight - imgRec->Height()) / 2;
+ topBarIconPixmap->DrawImage( cPoint(Right, iconTop), *imgRec );
+ Right += imgRec->Width();
+ cString RecNum = cString::sprintf("%d", numRec);
+ topBarPixmap->DrawText(cPoint(Right, fontSmlTop), RecNum, Theme.Color(clrTopBarRecordingActiveFg), Theme.Color(clrTopBarRecordingActiveBg), topBarFontSml);
+ Right += topBarFontSml->Width(*RecNum) + marginItem;
+ }
- cImage *imgBG = imgLoader.LoadIcon("logo_background", imageBGWidth, imageBGHeight);
- if( imgBG ) {
- imageBGHeight = imgBG->Height();
- imageBGWidth = imgBG->Width();
- iconTop = (topBarHeight / 2 - imgBG->Height()/2);
- topBarIconBGPixmap->DrawImage( cPoint(IconLeft, iconTop), *imgBG );
- }
+ if( numConflicts && imgCon ) {
+ int iconTop = (topBarFontHeight - imgCon->Height()) / 2;
+ topBarIconPixmap->DrawImage( cPoint(Right, iconTop), *imgCon );
+ Right += imgCon->Width();
- cImage *img = imgLoader.LoadLogo(*topBarMenuLogo, imageBGWidth - 4, imageBGHeight - 4);
- if( img ) {
- iconTop += (imageBGHeight - img->Height())/2;
- IconLeft += (imageBGWidth - img->Width())/2;
- topBarIconPixmap->DrawImage(cPoint(IconLeft, iconTop), *img);
- }
- MenuIconWidth = imageBGWidth+marginItem*2;
+ cString ConNum = cString::sprintf("%d", numConflicts);
+ if( numConflicts < Config.TopBarRecConflictsHigh )
+ topBarPixmap->DrawText(cPoint(Right, fontSmlTop), ConNum, Theme.Color(clrTopBarConflictLowFg), Theme.Color(clrTopBarConflictLowBg), topBarFontSml);
+ else
+ topBarPixmap->DrawText(cPoint(Right, fontSmlTop), ConNum, Theme.Color(clrTopBarConflictHighFg), Theme.Color(clrTopBarConflictHighBg), topBarFontSml);
+ Right += topBarFontSml->Width(*ConNum) + marginItem;
}
- topBarPixmap->DrawText(cPoint(MenuIconWidth + marginItem*2, fontTop), topBarTitle, Theme.Color(clrTopBarFont), Theme.Color(clrTopBarBg), topBarFont, Right - MenuIconWidth - marginItem*4);
+ 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);
}
diff --git a/config.c b/config.c
index 2fef7cee..696a16c6 100644
--- a/config.c
+++ b/config.c
@@ -16,6 +16,7 @@ cFlatConfig::cFlatConfig(void) {
SignalQualityUseColors = false;
DiskUsageShow = true;
+ DiskUsageShort = false;
MenuContentFullSize = true;
@@ -235,6 +236,7 @@ bool cFlatConfig::SetupParse(const char *Name, const char *Value) {
else if (strcmp(Name, "ScrollerStep") == 0) ScrollerStep = atoi(Value);
else if (strcmp(Name, "ScrollerDelay") == 0) ScrollerDelay = atoi(Value);
else if (strcmp(Name, "ScrollerType") == 0) ScrollerType = atoi(Value);
+ else if (strcmp(Name, "DiskUsageShort") == 0) DiskUsageShort = atoi(Value);
else return false;
diff --git a/config.h b/config.h
index 302ed4d7..8a448f94 100644
--- a/config.h
+++ b/config.h
@@ -163,6 +163,7 @@ class cFlatConfig
int SignalQualityShow;
int SignalQualityUseColors;
int DiskUsageShow;
+ int DiskUsageShort;
int MenuItemPadding;
int marginOsdVer, marginOsdHor;
diff --git a/po/de_DE.po b/po/de_DE.po
index ee5cc5ea..25e5094e 100644
--- a/po/de_DE.po
+++ b/po/de_DE.po
@@ -6,7 +6,7 @@ msgid ""
msgstr ""
"Project-Id-Version: vdr-skinflat 0.3.1\n"
"Report-Msgid-Bugs-To: <see README>\n"
-"POT-Creation-Date: 2014-06-23 21:52+0200\n"
+"POT-Creation-Date: 2014-07-07 23:24+0200\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"
@@ -264,6 +264,9 @@ msgstr "Zeige TopBar menu Icons"
msgid "Show Diskusage stats"
msgstr "Zeige HDD Verbrauch"
+msgid "Diskusage short display"
+msgstr "HDD Verbrauch kurze Anzeige"
+
msgid "OSD vertical margin"
msgstr "OSD vertikaler Rand"
diff --git a/setup.c b/setup.c
index fdd44d0d..1b56d5c4 100644
--- a/setup.c
+++ b/setup.c
@@ -232,6 +232,7 @@ void cFlatSetup::Store(void) {
SetupStore("ScrollerStep", Config.ScrollerStep);
SetupStore("ScrollerDelay", Config.ScrollerDelay);
SetupStore("ScrollerType", Config.ScrollerType);
+ SetupStore("DiskUsageShort", Config.DiskUsageShort);
Config.Init();
}
@@ -272,6 +273,7 @@ void cFlatSetupGeneral::Setup(void) {
Add(new cMenuEditBoolItem(tr("Show empty color-buttons"), &SetupConfig->ButtonsShowEmpty));
Add(new cMenuEditBoolItem(tr("Show TopBar menu icons"), &SetupConfig->TopBarMenuIconShow));
Add(new cMenuEditStraItem(tr("Show Diskusage stats"), &SetupConfig->DiskUsageShow, DiskUsages.Size(), &DiskUsages[0]));
+ Add(new cMenuEditBoolItem(tr("Diskusage short display"), &SetupConfig->DiskUsageShort));
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));