summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--HISTORY1
-rw-r--r--config.c1
-rw-r--r--displaymenuview.c37
-rw-r--r--geometrymanager.c6
-rw-r--r--geometrymanager.h1
-rw-r--r--imagecache.c9
-rw-r--r--po/ca_ES.po8
-rw-r--r--po/de_DE.po8
-rw-r--r--po/it_IT.po8
-rw-r--r--po/sk_SK.po8
-rw-r--r--setup.c1
11 files changed, 54 insertions, 34 deletions
diff --git a/HISTORY b/HISTORY
index e0f869e..4b0f687 100644
--- a/HISTORY
+++ b/HISTORY
@@ -343,3 +343,4 @@ Version 0.1.4
schedules menu also sets the number of menu items in channels and
timers menu.
- improved display of text progress bar in wide menus
+- changed header icons to scale automatically
diff --git a/config.c b/config.c
index 816102c..6503d38 100644
--- a/config.c
+++ b/config.c
@@ -97,7 +97,6 @@ void cNopacityConfig::LoadDefaults(void) {
conf.insert(std::pair<std::string, int>("numMainMenuItems", 10));
conf.insert(std::pair<std::string, int>("numSchedulesMenuItems", 10));
conf.insert(std::pair<std::string, int>("numRecordingsMenuItems", 10));
- conf.insert(std::pair<std::string, int>("headerIconHeight", 80));
conf.insert(std::pair<std::string, int>("menuHeaderLogoWidth", 160));
conf.insert(std::pair<std::string, int>("menuHeaderLogoHeight", 70));
conf.insert(std::pair<std::string, int>("timersLogoWidth", 90));
diff --git a/displaymenuview.c b/displaymenuview.c
index 4189ce2..429d35c 100644
--- a/displaymenuview.c
+++ b/displaymenuview.c
@@ -140,8 +140,8 @@ void cNopacityDisplayMenuView::CreatePixmaps(void) {
pixmapHeaderForeground = osd->CreatePixmap(3, cRect(0, 0, geoManager->osdWidth, geoManager->menuHeaderHeight));
int dateX = (config.GetValue("menuAdjustLeft")) ? (geoManager->osdWidth - geoManager->menuDateWidth) : 0;
pixmapDate = osd->CreatePixmap(2, cRect(dateX, 0, geoManager->menuDateWidth, geoManager->menuHeaderHeight));
- int logoX = (config.GetValue("menuAdjustLeft")) ? 0 : (geoManager->osdWidth - config.GetValue("menuHeaderLogoWidth"));
- pixmapHeaderLogo = osd->CreatePixmap(-1, cRect(logoX, 0, config.GetValue("menuHeaderLogoWidth"), config.GetValue("menuHeaderLogoHeight")));
+ int logoX = (config.GetValue("menuAdjustLeft")) ? 0 : (geoManager->osdWidth - geoManager->menuHeaderVDRLogoWidth);
+ pixmapHeaderLogo = osd->CreatePixmap(-1, cRect(logoX, 2, geoManager->menuHeaderVDRLogoWidth, geoManager->menuHeaderHeight - 4));
int labelX = (config.GetValue("menuAdjustLeft")) ? 0 : geoManager->menuDateWidth;
pixmapHeaderLabel = osd->CreatePixmap(2, cRect(labelX, 0, geoManager->osdWidth - geoManager->menuDateWidth, geoManager->menuHeaderHeight));
pixmapFooter = osd->CreatePixmap(2, cRect(0, geoManager->osdHeight - geoManager->menuFooterHeight, geoManager->osdWidth, geoManager->menuFooterHeight));
@@ -404,7 +404,7 @@ int cNopacityDisplayMenuView::ShowHeaderLogo(bool show) {
} else {
pixmapHeaderLogo->SetLayer(-1);
}
- return config.GetValue("menuHeaderLogoWidth") + geoManager->menuSpace;
+ return geoManager->menuHeaderVDRLogoWidth + geoManager->menuSpace;
}
int cNopacityDisplayMenuView::DrawHeaderIcon(eMenuCategory menuCat) {
@@ -436,13 +436,14 @@ int cNopacityDisplayMenuView::DrawHeaderIcon(eMenuCategory menuCat) {
int left = 0;
if (drawIcon) {
- int iconX = (config.GetValue("menuAdjustLeft")) ? 0 : (geoManager->osdWidth - config.GetValue("headerIconHeight"));
- pixmapHeaderIcon = osd->CreatePixmap(2, cRect(iconX, 0, config.GetValue("headerIconHeight"), config.GetValue("headerIconHeight")));
+ int iconSize = geoManager->menuHeaderHeight - 4;
+ int iconX = (config.GetValue("menuAdjustLeft")) ? 0 : (geoManager->osdWidth - geoManager->menuHeaderHeight);
+ pixmapHeaderIcon = osd->CreatePixmap(2, cRect(iconX, 2, iconSize, iconSize));
pixmapHeaderIcon->Fill(clrTransparent);
cImage *imgIcon = imgCache->GetSkinIcon(*icon);
if (imgIcon) {
pixmapHeaderIcon->DrawImage(cPoint(0,0), *imgIcon);
- left = config.GetValue("headerIconHeight") + geoManager->menuSpace;
+ left = geoManager->menuHeaderHeight + geoManager->menuSpace;
}
}
return left;
@@ -450,8 +451,14 @@ int cNopacityDisplayMenuView::DrawHeaderIcon(eMenuCategory menuCat) {
int cNopacityDisplayMenuView::ShowHeaderIconChannelLogo(const char *Title) {
int left = 0;
- int iconX = (config.GetValue("menuAdjustLeft")) ? 0 : (geoManager->osdWidth - geoManager->menuLogoWidth);
- pixmapHeaderIcon = osd->CreatePixmap(2, cRect(iconX, 0, geoManager->menuLogoWidth, geoManager->menuLogoHeight));
+ int logoHeight = geoManager->menuHeaderHeight - 4;
+ cSize logoSize = ScaleToFit(1000,
+ logoHeight,
+ config.GetValue("logoWidth"),
+ config.GetValue("logoHeight"));
+ int logoWidth = logoSize.Width();
+ int iconX = (config.GetValue("menuAdjustLeft")) ? 0 : (geoManager->osdWidth - logoWidth);
+ pixmapHeaderIcon = osd->CreatePixmap(2, cRect(iconX, 2, logoWidth, logoHeight));
pixmapHeaderIcon->Fill(clrTransparent);
std::string channel = Title;
if (channel.length() == 0)
@@ -462,9 +469,9 @@ int cNopacityDisplayMenuView::ShowHeaderIconChannelLogo(const char *Title) {
channel.erase(0, remove.length());
} catch (...) {}
cImageLoader imgLoader;
- if (imgLoader.LoadLogo(channel.c_str(), geoManager->menuLogoWidth, geoManager->menuLogoHeight)) {
+ if (imgLoader.LoadLogo(channel.c_str(), logoWidth, logoHeight)) {
pixmapHeaderIcon->DrawImage(cPoint(0, 0), imgLoader.GetImage());
- left = geoManager->menuLogoWidth + geoManager->menuSpace;
+ left = logoWidth + geoManager->menuSpace;
}
return left;
}
@@ -479,8 +486,14 @@ void cNopacityDisplayMenuView::DestroyHeaderIcon(void) {
void cNopacityDisplayMenuView::DrawHeaderLabel(int left, cString label) {
pixmapHeaderLabel->Fill(clrTransparent);
int labelW = fontManager->menuHeader->Width(label);
- int labelX = (config.GetValue("menuAdjustLeft")) ? (left) : (geoManager->osdWidth - geoManager->menuDateWidth - labelW - left - 2*geoManager->menuSpace);
- pixmapHeaderLabel->DrawText(cPoint(labelX, ((geoManager->menuHeaderHeight - 10) - fontManager->menuHeader->Height()) / 2), *label, Theme.Color(clrMenuFontHeader), clrTransparent, fontManager->menuHeader);
+ int labelX = (config.GetValue("menuAdjustLeft")) ? (left)
+ : (geoManager->osdWidth - geoManager->menuDateWidth - labelW - left - 2*geoManager->menuSpace);
+ int labelY = (geoManager->menuHeaderHeight - fontManager->menuHeader->Height())/2;
+ pixmapHeaderLabel->DrawText(cPoint(labelX, labelY),
+ *label,
+ Theme.Color(clrMenuFontHeader),
+ clrTransparent,
+ fontManager->menuHeader);
}
void cNopacityDisplayMenuView::DrawDate(bool initial) {
diff --git a/geometrymanager.c b/geometrymanager.c
index 20009b7..220551e 100644
--- a/geometrymanager.c
+++ b/geometrymanager.c
@@ -83,6 +83,12 @@ void cGeometryManager::SetDisplayMenuSizes() {
menuLogoWidth = logoSize.Width();
menuLogoHeight = logoSize.Height();
+ cSize logoSizeVDRHeader = ScaleToFit(1000,
+ menuHeaderHeight - 4,
+ config.GetValue("menuHeaderLogoWidth"),
+ config.GetValue("menuHeaderLogoHeight"));
+ menuHeaderVDRLogoWidth = logoSizeVDRHeader.Width();
+
menuButtonsBorder = menuFooterHeight / 6;
menuButtonWidth = (osdWidth / 4) - 2 * menuButtonsBorder;
menuButtonHeight = menuFooterHeight - 3 * menuButtonsBorder;
diff --git a/geometrymanager.h b/geometrymanager.h
index fb23a00..91cd5cc 100644
--- a/geometrymanager.h
+++ b/geometrymanager.h
@@ -53,6 +53,7 @@ class cGeometryManager {
int menuMainMenuIconSize;
int menuLogoWidth;
int menuLogoHeight;
+ int menuHeaderVDRLogoWidth;
int menuButtonsBorder;
int menuButtonWidth;
int menuButtonHeight;
diff --git a/imagecache.c b/imagecache.c
index 111cf20..2e6e0cb 100644
--- a/imagecache.c
+++ b/imagecache.c
@@ -243,6 +243,7 @@ std::vector<std::pair<std::string, cPoint> > cImageCache::GetMenuIcons(void) {
for (int i=0; i<mainMenuIcons.size(); i++) {
menuIcons.push_back(std::pair<std::string, cPoint>(mainMenuIcons[i], cPoint(mainMenuIconSize, mainMenuIconSize)));
}
+
//Plugin Icons
for (int i = 0; ; i++) {
cPlugin *p = cPluginManager::GetPlugin(i);
@@ -260,8 +261,8 @@ std::vector<std::pair<std::string, sImgProperties> > cImageCache::GetSkinIcons(v
std::vector<std::pair<std::string, sImgProperties> > skinIcons;
//VDR Logo
sImgProperties props;
- props.width = config.GetValue("menuHeaderLogoWidth");
- props.height = config.GetValue("menuHeaderLogoWidth");
+ props.width = geoManager->menuHeaderVDRLogoWidth;
+ props.height = geoManager->menuHeaderHeight;
props.preserveAspect = true;
skinIcons.push_back(std::pair<std::string, sImgProperties>("skinIcons/vdrlogo", props));
//DiskUsage
@@ -281,8 +282,8 @@ std::vector<std::pair<std::string, sImgProperties> > cImageCache::GetSkinIcons(v
menuHeaderIcons.push_back("menuIcons/Recordings");
menuHeaderIcons.push_back("menuIcons/Setup");
menuHeaderIcons.push_back("menuIcons/Commands");
- props.width = config.GetValue("headerIconHeight");
- props.height = config.GetValue("headerIconHeight");
+ props.width = geoManager->menuHeaderHeight-2;
+ props.height = geoManager->menuHeaderHeight-2;
props.preserveAspect = true;
for (int i=0; i<menuHeaderIcons.size(); i++) {
skinIcons.push_back(std::pair<std::string, sImgProperties>(menuHeaderIcons[i], props));
diff --git a/po/ca_ES.po b/po/ca_ES.po
index d1e9867..472be8c 100644
--- a/po/ca_ES.po
+++ b/po/ca_ES.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-11-02 17:41+0100\n"
+"POT-Creation-Date: 2013-11-03 14:03+0100\n"
"PO-Revision-Date: 2013-03-19 22:56+0100\n"
"Last-Translator: Gabychan <gbonich@gmail.com>\n"
"Language-Team: \n"
@@ -158,9 +158,6 @@ msgstr "Ajust de la mida de video a la finestra del menú"
msgid "Header Height (Percent of OSD Height)"
msgstr "Alçada de la capçalera (% Alçada OSD)"
-msgid "Header Icon Size (Square Header Menu Icons)"
-msgstr "Mida icona capçalera (Icones del Quadre)"
-
msgid "Footer Height (Percent of OSD Height)"
msgstr "Alçada del peu de pàgina (% Alçada OSD)"
@@ -557,6 +554,9 @@ msgstr "conflicte"
msgid "conflicts"
msgstr "conflictes"
+#~ msgid "Header Icon Size (Square Header Menu Icons)"
+#~ msgstr "Mida icona capçalera (Icones del Quadre)"
+
#~ msgid "Folder Icon Size"
#~ msgstr "Mida Carpeta Icones"
diff --git a/po/de_DE.po b/po/de_DE.po
index 6cbaea9..c925eee 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-11-02 17:41+0100\n"
+"POT-Creation-Date: 2013-11-03 14:03+0100\n"
"PO-Revision-Date: 2012-11-11 17:49+0200\n"
"Last-Translator: louis\n"
"Language-Team: \n"
@@ -155,9 +155,6 @@ msgstr "TV-Bildgröße in Menüfenster einpassen"
msgid "Header Height (Percent of OSD Height)"
msgstr "Header Höhe (in % der OSD Höhe)"
-msgid "Header Icon Size (Square Header Menu Icons)"
-msgstr "Größe der quadratischen Headericons"
-
msgid "Footer Height (Percent of OSD Height)"
msgstr "Footer Höhe (in % der OSD Höhe)"
@@ -554,6 +551,9 @@ msgstr "Konflikt"
msgid "conflicts"
msgstr "Konflikte"
+#~ msgid "Header Icon Size (Square Header Menu Icons)"
+#~ msgstr "Größe der quadratischen Headericons"
+
#~ msgid "Folder Icon Size"
#~ msgstr "Order Icon Größe"
diff --git a/po/it_IT.po b/po/it_IT.po
index afd1feb..215dc06 100644
--- a/po/it_IT.po
+++ b/po/it_IT.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-11-02 17:41+0100\n"
+"POT-Creation-Date: 2013-11-03 14:03+0100\n"
"PO-Revision-Date: 2013-03-19 22:56+0100\n"
"Last-Translator: Diego Pierotto <vdr-italian@tiscali.it>\n"
"Language-Team: \n"
@@ -158,9 +158,6 @@ msgstr "Scala dimensione video nel menu finestra"
msgid "Header Height (Percent of OSD Height)"
msgstr "Altezza intestazione (% altezza OSD)"
-msgid "Header Icon Size (Square Header Menu Icons)"
-msgstr "Dim. icona intestazione (icone menu intestazione quadrato)"
-
msgid "Footer Height (Percent of OSD Height)"
msgstr "Altezza piè pagina (% altezza OSD)"
@@ -557,6 +554,9 @@ msgstr "conflitto"
msgid "conflicts"
msgstr "conflitti"
+#~ msgid "Header Icon Size (Square Header Menu Icons)"
+#~ msgstr "Dim. icona intestazione (icone menu intestazione quadrato)"
+
#~ msgid "Folder Icon Size"
#~ msgstr "Dim. icona cartella"
diff --git a/po/sk_SK.po b/po/sk_SK.po
index a9f6601..2c4df1b 100644
--- a/po/sk_SK.po
+++ b/po/sk_SK.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: vdr-skinnopacity\n"
"Report-Msgid-Bugs-To: <see README>\n"
-"POT-Creation-Date: 2013-11-02 17:41+0100\n"
+"POT-Creation-Date: 2013-11-03 14:03+0100\n"
"PO-Revision-Date: 2013-09-16 19:34+0100\n"
"Last-Translator: Milan Hrala <hrala.milan@gmail.com>\n"
"Language-Team: \n"
@@ -155,9 +155,6 @@ msgstr "Zmeni» veµkos» videa, aby sa zmestil do okna ponuky"
msgid "Header Height (Percent of OSD Height)"
msgstr "Vý¹ka hlavièky (percento z èasti OSD vý¹ky)"
-msgid "Header Icon Size (Square Header Menu Icons)"
-msgstr "Veµkos» ikony hlavièky (ikona hlavièky do ¹tvorca)"
-
msgid "Footer Height (Percent of OSD Height)"
msgstr "Vý¹ka zápätia (percento z èasti OSD vý¹ky)"
@@ -554,6 +551,9 @@ msgstr "konflikt"
msgid "conflicts"
msgstr "konflikty"
+#~ msgid "Header Icon Size (Square Header Menu Icons)"
+#~ msgstr "Veµkos» ikony hlavièky (ikona hlavièky do ¹tvorca)"
+
#~ msgid "Folder Icon Size"
#~ msgstr "Veµkos» ikony prieèinku"
diff --git a/setup.c b/setup.c
index 0173492..827304e 100644
--- a/setup.c
+++ b/setup.c
@@ -147,7 +147,6 @@ void cNopacitySetupMenuDisplay::Set(void) {
Add(new cMenuEditStraItem(tr("Adjustment of narrow menus"), tmpConf->GetValueRef("menuAdjustLeft"), 2, adjustLeft));
Add(new cMenuEditStraItem(tr("Scale Video size to fit into menu window"), tmpConf->GetValueRef("scalePicture"), 3, scalePic));
Add(new cMenuEditIntItem(tr("Header Height (Percent of OSD Height)"), tmpConf->GetValueRef("headerHeight"), 5, 30));
- Add(new cMenuEditIntItem(tr("Header Icon Size (Square Header Menu Icons)"), tmpConf->GetValueRef("headerIconHeight"), 30, 200));
Add(new cMenuEditIntItem(tr("Footer Height (Percent of OSD Height)"), tmpConf->GetValueRef("footerHeight"), 5, 30));
Add(new cMenuEditBoolItem(tr("Rounded Corners for menu items and buttons"), tmpConf->GetValueRef("roundedCorners")));
if (tmpConf->GetValue("roundedCorners"))