summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--HISTORY1
-rw-r--r--config.c4
-rw-r--r--config.h2
-rw-r--r--displaychannel.c2
-rw-r--r--displaymenuview.c26
-rw-r--r--displaymenuview.h1
-rw-r--r--icons/discpercent.pngbin0 -> 2996 bytes
-rw-r--r--imageloader.c9
-rw-r--r--imageloader.h2
-rw-r--r--po/de_DE.po19
-rw-r--r--setup.c8
11 files changed, 52 insertions, 22 deletions
diff --git a/HISTORY b/HISTORY
index f1981ab..c6198b2 100644
--- a/HISTORY
+++ b/HISTORY
@@ -113,3 +113,4 @@ Version 0.0.6
images have to be stored as EventID_number.jpg (as some external epg
plugins do). Whether additional images should be displayed in general is
configurable, just as the number of images to display.
+- Changed Disc Usage Info display, size individually configurable
diff --git a/config.c b/config.c
index 9dd5989..e815083 100644
--- a/config.c
+++ b/config.c
@@ -69,6 +69,7 @@ cNopacityConfig::cNopacityConfig() {
menuInfoScrollDelay = 5;
menuInfoScrollSpeed = 2;
menuWidthRightItems = 12;
+ menuSizeDiskUsage = 12;
showDiscUsage = 1;
showTimers = 1;
checkTimerConflict = 1;
@@ -101,6 +102,7 @@ cNopacityConfig::cNopacityConfig() {
fontMenuitemRecordingsSmall = 0;
fontMenuitemDefault = 0;
fontDiskUsage = 0;
+ fontDiskUsagePercent = 0;
fontTimersHead = 0;
fontTimers = 0;
fontButtons = 0;
@@ -228,6 +230,7 @@ bool cNopacityConfig::SetupParse(const char *Name, const char *Value) {
else if (strcmp(Name, "numAdditionalEPGPictures") == 0) numAdditionalEPGPictures = atoi(Value);
else if (strcmp(Name, "menuWidthNarrow") == 0) menuWidthNarrow = atoi(Value);
else if (strcmp(Name, "menuWidthRightItems") == 0) menuWidthRightItems = atoi(Value);
+ else if (strcmp(Name, "menuSizeDiskUsage") == 0) menuSizeDiskUsage = atoi(Value);
else if (strcmp(Name, "menuHeightInfoWindow") == 0) menuHeightInfoWindow = atoi(Value);
else if (strcmp(Name, "showDiscUsage") == 0) showDiscUsage = atoi(Value);
else if (strcmp(Name, "showTimers") == 0) showTimers = atoi(Value);
@@ -261,6 +264,7 @@ bool cNopacityConfig::SetupParse(const char *Name, const char *Value) {
else if (strcmp(Name, "fontMenuitemRecordingsSmall") == 0) fontMenuitemRecordingsSmall = atoi(Value);
else if (strcmp(Name, "fontMenuitemDefault") == 0) fontMenuitemDefault = atoi(Value);
else if (strcmp(Name, "fontDiskUsage") == 0) fontDiskUsage = atoi(Value);
+ else if (strcmp(Name, "fontDiskUsagePercent") == 0) fontDiskUsagePercent = atoi(Value);
else if (strcmp(Name, "fontTimersHead") == 0) fontTimersHead = atoi(Value);
else if (strcmp(Name, "fontTimers") == 0) fontTimers = atoi(Value);
else if (strcmp(Name, "fontButtons") == 0) fontButtons = atoi(Value);
diff --git a/config.h b/config.h
index 2568a5a..bb5ddf5 100644
--- a/config.h
+++ b/config.h
@@ -95,6 +95,7 @@ class cNopacityConfig {
int menuWidthNarrow;
int menuHeightInfoWindow;
int menuWidthRightItems;
+ int menuSizeDiskUsage;
int showDiscUsage;
int showTimers;
int checkTimerConflict;
@@ -127,6 +128,7 @@ class cNopacityConfig {
int fontMenuitemRecordingsSmall;
int fontMenuitemDefault;
int fontDiskUsage;
+ int fontDiskUsagePercent;
int fontTimersHead;
int fontTimers;
int fontButtons;
diff --git a/displaychannel.c b/displaychannel.c
index ea6a86a..4bd063d 100644
--- a/displaychannel.c
+++ b/displaychannel.c
@@ -277,7 +277,7 @@ void cNopacityDisplayChannel::DrawSignalMeter(void) {
cImageLoader imgLoader;
cString signalStrength = "STR";
cString signalQuality = "SNR";
- if (imgLoader.LoadIcon("signal", signalWidth, signalHeight)) {
+ if (imgLoader.LoadIcon("signal", signalWidth, signalHeight, false)) {
cImage imgSignal = imgLoader.GetImage();
signalWidth = imgSignal.Width();
signalHeight = imgSignal.Height();
diff --git a/displaymenuview.c b/displaymenuview.c
index f0e64a3..1717e97 100644
--- a/displaymenuview.c
+++ b/displaymenuview.c
@@ -31,6 +31,7 @@ cNopacityDisplayMenuView::~cNopacityDisplayMenuView(void) {
delete fontMenuitemRecordingsSmall;
delete fontMenuitemDefault;
delete fontDiskUsage;
+ delete fontDiskUsagePercent;
delete fontTimers;
delete fontTimersHead;
delete fontButtons;
@@ -62,7 +63,8 @@ void cNopacityDisplayMenuView::SetGeometry(void) {
menuItemHeightSchedule = config.menuItemLogoHeight + 2;
menuItemHeightDefault = contentHeight / config.numDefaultMenuItems - spaceMenu;
menuItemHeightRecordings = config.menuRecFolderSize + 2;
- diskUsageWidth = diskUsageHeight = timersWidth = osdWidth * config.menuWidthRightItems / 100;
+ diskUsageWidth = diskUsageHeight = osdWidth * config.menuSizeDiskUsage / 100;
+ timersWidth = osdWidth * config.menuWidthRightItems / 100;
buttonsBorder = 10;
buttonWidth = (osdWidth / 4) - 2 * buttonsBorder;
buttonHeight = footerHeight - 3 * buttonsBorder;
@@ -89,8 +91,9 @@ void cNopacityDisplayMenuView::CreatePixmaps(void) {
cRect(0, 0, osdWidth + contentWidthFull - contentWidthNarrow, contentHeight));
pixmapScrollbar = osd->CreatePixmap(2, cRect(contentWidthNarrow, headerHeight + spaceMenu, widthScrollbar, contentHeight - 2 * spaceMenu));
pixmapDiskUsage = osd->CreatePixmap(2, cRect(osdWidth - diskUsageWidth - 10, headerHeight + spaceMenu, diskUsageWidth, diskUsageHeight));
- pixmapDiskUsageIcon = osd->CreatePixmap(3, cRect((osdWidth - diskUsageWidth - 10) + (diskUsageWidth)/8, headerHeight, diskUsageWidth*3/4, diskUsageWidth*3/4));
- pixmapDiskUsageLabel = osd->CreatePixmap(3, cRect(osdWidth - diskUsageWidth - 10, headerHeight + spaceMenu, diskUsageWidth, diskUsageHeight));
+ pixmapDiskUsageIcon = osd->CreatePixmap(3, cRect(osdWidth - diskUsageWidth - 8, headerHeight + spaceMenu + 2, diskUsageWidth - 4, diskUsageHeight - 4));
+ pixmapDiskUsageLabel = osd->CreatePixmap(4, cRect(osdWidth - diskUsageWidth - 8, headerHeight + spaceMenu + 2, diskUsageWidth - 4, diskUsageHeight - 4));
+
pixmapHeaderLogo->Fill(clrTransparent);
pixmapHeaderLabel->Fill(clrTransparent);
pixmapDiskUsage->Fill(clrTransparent);
@@ -134,7 +137,8 @@ void cNopacityDisplayMenuView::CreateFonts(void) {
fontMenuitemRecordings = cFont::CreateFont(config.fontName, menuItemHeightRecordings / 2 - 14 + config.fontMenuitemRecordings);
fontMenuitemRecordingsSmall = cFont::CreateFont(config.fontName, menuItemHeightRecordings / 4 - 3 + config.fontMenuitemRecordingsSmall);
fontMenuitemDefault = cFont::CreateFont(config.fontName, menuItemHeightDefault * 2 / 3 + config.fontMenuitemDefault);
- fontDiskUsage = cFont::CreateFont(config.fontName, (diskUsageHeight/4)/2 - 2 + config.fontDiskUsage);
+ fontDiskUsage = cFont::CreateFont(config.fontName, diskUsageHeight/6 - 2 + config.fontDiskUsage);
+ fontDiskUsagePercent = cFont::CreateFont(config.fontName, diskUsageHeight/5 - 4 + config.fontDiskUsagePercent);
fontTimersHead = cFont::CreateFont(config.fontName, (contentHeight - 3*spaceMenu - diskUsageHeight) / 25 + config.fontTimersHead);
fontTimers = cFont::CreateFont(config.fontName, (contentHeight - 3*spaceMenu - diskUsageHeight) / 25 - 6 + config.fontTimers);
fontButtons = cFont::CreateFont(config.fontName, buttonHeight*0.8 + config.fontButtons);
@@ -456,13 +460,19 @@ void cNopacityDisplayMenuView::DrawDiskUsage(void) {
cImageLoader imgLoader;
if (imgLoader.LoadIcon("DiskUsage", iconWidth)) {
cImage icon = imgLoader.GetImage();
- pixmapDiskUsageIcon->DrawImage(cPoint(0,0), icon);
+ pixmapDiskUsageIcon->DrawImage(cPoint((diskUsageWidth - iconWidth)/2,0), icon);
+ }
+ if (imgLoader.LoadIcon("discpercent", diskUsageWidth - 4, diskUsageHeight/5, false)) {
+ cImage icon = imgLoader.GetImage();
+ pixmapDiskUsageIcon->DrawImage(cPoint(0,4*diskUsageHeight/5), icon);
}
pixmapDiskUsageLabel->Fill(clrTransparent);
- cString usage = cString::sprintf("%s: %d%%", tr("Disc"), DiskUsage);
+ cString usage = cString::sprintf("%d%%", DiskUsage);
cString rest = cString::sprintf("%02d:%02dh %s", cVideoDiskUsage::FreeMinutes() / 60, cVideoDiskUsage::FreeMinutes() % 60, tr("free"));
- pixmapDiskUsageLabel->DrawText(cPoint((diskUsageWidth - fontDiskUsage->Width(*usage))/2, diskUsageHeight - 2*fontDiskUsage->Height() - spaceMenu), *usage, Theme.Color(clrMenuFontDiscUsage), clrTransparent, fontDiskUsage);
- pixmapDiskUsageLabel->DrawText(cPoint((diskUsageWidth - fontDiskUsage->Width(*rest))/2, diskUsageHeight - fontDiskUsage->Height() - spaceMenu), *rest, Theme.Color(clrMenuFontDiscUsage), clrTransparent, fontDiskUsage);
+ pixmapDiskUsageLabel->DrawRectangle(cRect((diskUsageWidth - 4)*DiskUsage/100,4*diskUsageHeight/5, (diskUsageWidth - 4) - (diskUsageWidth - 4)*DiskUsage/100, diskUsageHeight/5), 0xDD000000);
+ pixmapDiskUsageLabel->DrawText(cPoint((diskUsageWidth - fontDiskUsagePercent->Width(*usage))/2, 4*diskUsageHeight/5), *usage, Theme.Color(clrMenuFontDiscUsage), clrTransparent, fontDiskUsagePercent);
+ pixmapDiskUsageLabel->DrawText(cPoint((diskUsageWidth - fontDiskUsage->Width(*rest))/2, (diskUsageHeight - fontDiskUsage->Height())/2), *rest, Theme.Color(clrMenuFontDiscUsage), clrTransparent, fontDiskUsage);
+
pixmapDiskUsage->SetLayer(2);
pixmapDiskUsageIcon->SetLayer(3);
pixmapDiskUsageLabel->SetLayer(4);
diff --git a/displaymenuview.h b/displaymenuview.h
index 1c903c7..9412449 100644
--- a/displaymenuview.h
+++ b/displaymenuview.h
@@ -31,6 +31,7 @@ class cNopacityDisplayMenuView {
cFont *fontMenuitemRecordingsSmall;
cFont *fontMenuitemDefault;
cFont *fontDiskUsage;
+ cFont *fontDiskUsagePercent;
cFont *fontTimers;
cFont *fontTimersHead;
cFont *fontButtons;
diff --git a/icons/discpercent.png b/icons/discpercent.png
new file mode 100644
index 0000000..1c219c5
--- /dev/null
+++ b/icons/discpercent.png
Binary files differ
diff --git a/imageloader.c b/imageloader.c
index 569d9fd..6a68b5b 100644
--- a/imageloader.c
+++ b/imageloader.c
@@ -57,7 +57,7 @@ bool cImageLoader::LoadIcon(const char *cIcon, int size) {
return true;
}
-bool cImageLoader::LoadIcon(const char *cIcon, int width, int height) {
+bool cImageLoader::LoadIcon(const char *cIcon, int width, int height, bool preserveAspect) {
try {
if ((width == 0)||(height==0))
return false;
@@ -78,7 +78,12 @@ bool cImageLoader::LoadIcon(const char *cIcon, int width, int height) {
}
if (!success)
return false;
- buffer.sample(Geometry(width, height));
+ if (preserveAspect) {
+ buffer.sample(Geometry(width, height));
+ } else {
+ cString geometry = cString::sprintf("%dx%d!", width, height);
+ buffer.scale(Geometry(*geometry));
+ }
return true;
}
catch (...) {
diff --git a/imageloader.h b/imageloader.h
index 488f798..31bc692 100644
--- a/imageloader.h
+++ b/imageloader.h
@@ -16,7 +16,7 @@ public:
cImage GetImage();
bool LoadLogo(const char *logo, int width, int height);
bool LoadIcon(const char *cIcon, int size);
- bool LoadIcon(const char *cIcon, int width, int height);
+ bool LoadIcon(const char *cIcon, int width, int height, bool preserveAspect = true);
bool LoadEPGImage(int eventID);
bool LoadAdditionalEPGImage(cString name);
bool LoadRecordingImage(cString Path);
diff --git a/po/de_DE.po b/po/de_DE.po
index 96cdd23..11cd06c 100644
--- a/po/de_DE.po
+++ b/po/de_DE.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: skinnopacity 0.0.1\n"
"Report-Msgid-Bugs-To: <see README>\n"
-"POT-Creation-Date: 2013-01-30 19:45+0100\n"
+"POT-Creation-Date: 2013-02-03 17:28+0100\n"
"PO-Revision-Date: 2012-11-11 17:49+0200\n"
"Last-Translator: louis\n"
"Language-Team: \n"
@@ -17,9 +17,6 @@ msgstr ""
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
-msgid "Disc"
-msgstr "Festplatte"
-
msgid "free"
msgstr "frei"
@@ -161,8 +158,11 @@ msgstr "Anzahl der zusätzlichen EPG Bilder"
msgid "Width of narrow Menu Bar (Percent of OSD Width)"
msgstr "Breite der schmalen Menüleiste (Proz. der OSD Breite)"
-msgid "Width of Disc Usage and Timers Display (Percent of OSD Width)"
-msgstr "Breite der Anzeige der Timer (Proz. der OSD Breite)"
+msgid "Size of Disc Usage (square, Percent of OSD Width)"
+msgstr "Größe des Festplattenstatus (quadratisch, Proz. der OSD Breite)"
+
+msgid "Width of Timers Display (Percent of OSD Width)"
+msgstr "Breite der Timeranzeige (Proz. der OSD Breite)"
msgid "Height of EPG Info Window (Percent of OSD Height)"
msgstr "Höhe des EPG Info Fensters (Proz. der OSD Höhe)"
@@ -248,8 +248,11 @@ msgstr "Schriftgröße anpassen - Aufzeichnungen Menübuttons klein"
msgid "Adjust Font Size - Default Menu Item"
msgstr "Schriftgröße anpassen - Default Menübuttons"
-msgid "Adjust Font Size - Disc Usage"
-msgstr "Schriftgröße anpassen - Festplattenstatus"
+msgid "Adjust Font Size - Disc Usage (free)"
+msgstr "Schriftgröße anpassen - Festplatte frei"
+
+msgid "Adjust Font Size - Disc Usage (percent)"
+msgstr "Schriftgröße anpassen - Festplatte Prozent"
msgid "Adjust Font Size - Timers Header"
msgstr "Schriftgröße anpassen - Timer Header"
diff --git a/setup.c b/setup.c
index 698bd07..9ef061d 100644
--- a/setup.c
+++ b/setup.c
@@ -109,6 +109,7 @@ void cNopacitySetup::Store(void) {
SetupStore("menuScrollSpeed", config.menuScrollSpeed);
SetupStore("menuWidthNarrow", config.menuWidthNarrow);
SetupStore("menuWidthRightItems", config.menuWidthRightItems);
+ SetupStore("menuSizeDiskUsage", config.menuSizeDiskUsage);
SetupStore("menuHeightInfoWindow", config.menuHeightInfoWindow);
SetupStore("menuEPGWindowFadeTime", config.menuEPGWindowFadeTime);
SetupStore("menuInfoTextDelay", config.menuInfoTextDelay);
@@ -146,6 +147,7 @@ void cNopacitySetup::Store(void) {
SetupStore("fontMenuitemRecordingsSmall", config.fontMenuitemRecordingsSmall);
SetupStore("fontMenuitemDefault", config.fontMenuitemDefault);
SetupStore("fontDiskUsage", config.fontDiskUsage);
+ SetupStore("fontDiskUsagePercent", config.fontDiskUsagePercent);
SetupStore("fontTimersHead", config.fontTimersHead);
SetupStore("fontTimers", config.fontTimers);
SetupStore("fontButtons", config.fontButtons);
@@ -230,7 +232,8 @@ void cNopacitySetupMenuDisplayGeometry::Set(void) {
int currentItem = Current();
Clear();
Add(new cMenuEditIntItem(tr("Width of narrow Menu Bar (Percent of OSD Width)"), &tmpNopacityConfig->menuWidthNarrow, 10, 100));
- Add(new cMenuEditIntItem(tr("Width of Disc Usage and Timers Display (Percent of OSD Width)"), &tmpNopacityConfig->menuWidthRightItems, 10, 100));
+ Add(new cMenuEditIntItem(tr("Size of Disc Usage (square, Percent of OSD Width)"), &tmpNopacityConfig->menuSizeDiskUsage, 2, 100));
+ Add(new cMenuEditIntItem(tr("Width of Timers Display (Percent of OSD Width)"), &tmpNopacityConfig->menuWidthRightItems, 5, 100));
Add(new cMenuEditIntItem(tr("Height of EPG Info Window (Percent of OSD Height)"), &tmpNopacityConfig->menuHeightInfoWindow, 10, 100));
Add(new cMenuEditIntItem(tr("Header Height (Percent of OSD Height)"), &tmpNopacityConfig->headerHeight, 0, 30));
Add(new cMenuEditIntItem(tr("Footer Height (Percent of OSD Height)"), &tmpNopacityConfig->footerHeight, 0, 30));
@@ -272,7 +275,8 @@ void cNopacitySetupMenuDisplayFonts::Set(void) {
Add(new cMenuEditIntItem(tr("Adjust Font Size - Recordings Menu Item"), &tmpNopacityConfig->fontMenuitemRecordings, -20, 20));
Add(new cMenuEditIntItem(tr("Adjust Font Size - Recordings Menu Item Small"), &tmpNopacityConfig->fontMenuitemRecordingsSmall, -20, 20));
Add(new cMenuEditIntItem(tr("Adjust Font Size - Default Menu Item"), &tmpNopacityConfig->fontMenuitemDefault, -20, 20));
- Add(new cMenuEditIntItem(tr("Adjust Font Size - Disc Usage"), &tmpNopacityConfig->fontDiskUsage, -20, 20));
+ Add(new cMenuEditIntItem(tr("Adjust Font Size - Disc Usage (free)"), &tmpNopacityConfig->fontDiskUsage, -20, 20));
+ Add(new cMenuEditIntItem(tr("Adjust Font Size - Disc Usage (percent)"), &tmpNopacityConfig->fontDiskUsagePercent, -20, 20));
Add(new cMenuEditIntItem(tr("Adjust Font Size - Timers Header"), &tmpNopacityConfig->fontTimersHead, -20, 20));
Add(new cMenuEditIntItem(tr("Adjust Font Size - Timers Title"), &tmpNopacityConfig->fontTimers, -20, 20));
Add(new cMenuEditIntItem(tr("Adjust Font Size - Color Buttons"), &tmpNopacityConfig->fontButtons, -20, 20));