summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--HISTORY2
-rw-r--r--baserender.c12
-rw-r--r--baserender.h4
-rw-r--r--config.c3
-rw-r--r--config.h1
-rw-r--r--displaymenu.c27
-rw-r--r--po/de_DE.po5
-rw-r--r--setup.c2
8 files changed, 46 insertions, 10 deletions
diff --git a/HISTORY b/HISTORY
index c49ea1ba..cc5e93dd 100644
--- a/HISTORY
+++ b/HISTORY
@@ -9,6 +9,8 @@ VDR Plugin 'skinflatplus' Revision History
- [add] add free minutes in disk usage
- [add] add topbar font size option
- [add] add message bottom offset option
+- [add] add menu items symbols for rec, timer, etc. Lent code from skin elchi (thank you!)
+- [add] add option menu content full size background
2013-23-09: Version 0.0.1
difference to skinflat
diff --git a/baserender.c b/baserender.c
index 01a69556..4db52d62 100644
--- a/baserender.c
+++ b/baserender.c
@@ -298,6 +298,7 @@ void cFlatBaseRender::ContentSet(const char *Text, bool FixedFont, tColor ColorF
contentColorBg = ColorBg;
int contentWrapperHeight = (contentWrapper.Lines()+1) * fontHeight;
+ contentTextHeight = (contentWrapper.Lines()) * fontHeight + marginItem;
if( contentFixedFont )
contentWrapperHeight = (contentWrapper.Lines()+1) * fontFixedHeight;
@@ -315,7 +316,12 @@ void cFlatBaseRender::ContentSet(const char *Text, bool FixedFont, tColor ColorF
contentPixmap = osd->CreatePixmap(2, cRect(contentLeft, contentTop, contentWidth, contentHeight),
cRect(0, 0, contentWidth, contentDrawPortHeight));
- contentPixmap->Fill(contentColorBg);
+ if( Config.MenuContentFullSize || contentHasScrollbar ) {
+ contentPixmap->Fill(contentColorBg);
+ } else {
+ contentPixmap->Fill(clrTransparent);
+ contentPixmap->DrawRectangle(cRect(0, 0, contentWidth, contentTextHeight), contentColorBg);
+ }
contentDraw();
contentShown = true;
@@ -346,6 +352,10 @@ int cFlatBaseRender::ContentGetHeight(void) {
return contentHeight;
}
+int cFlatBaseRender::ContentGetTextHeight(void) {
+ return contentTextHeight;
+}
+
double cFlatBaseRender::ScrollbarSize(void) {
return (double)contentHeight / (double)contentDrawPortHeight;
}
diff --git a/baserender.h b/baserender.h
index df0a91ea..d50bd24c 100644
--- a/baserender.h
+++ b/baserender.h
@@ -71,7 +71,8 @@ class cFlatBaseRender
// Mehrzeiliger Content mit Scrollbalken
cPixmap *contentPixmap;
int contentLeft, contentTop, contentHeight, contentWidth;
- int contentDrawPortHeight; // gesamthöhe des Textes
+ int contentDrawPortHeight; // gesamthöhe des Textes
+ int contentTextHeight;
bool contentHasScrollbar;
bool contentShown;
bool contentFixedFont;
@@ -142,6 +143,7 @@ class cFlatBaseRender
int ContentScrollOffset(void);
int ContentVisibleLines(void);
int ContentGetHeight(void);
+ int ContentGetTextHeight(void);
bool ContentScroll(bool Up, bool Page);
void ContentClear(void);
diff --git a/config.c b/config.c
index fe751191..947c5b67 100644
--- a/config.c
+++ b/config.c
@@ -11,6 +11,8 @@ cFlatConfig::cFlatConfig(void) {
DiskUsageShow = true;
+ MenuContentFullSize = true;
+
MenuItemPadding = 5;
marginOsdVer = 5;
marginOsdHor = 5;
@@ -139,6 +141,7 @@ bool cFlatConfig::SetupParse(const char *Name, const char *Value) {
else if (strcmp(Name, "marginOsdHor") == 0) marginOsdHor = atoi(Value);
else if (strcmp(Name, "MessageOffset") == 0) MessageOffset = atoi(Value);
else if (strcmp(Name, "TopBarFontSize") == 0) TopBarFontSize = atod(Value);
+ else if (strcmp(Name, "MenuContentFullSize") == 0) MenuContentFullSize = atoi(Value);
else return false;
return true;
}
diff --git a/config.h b/config.h
index 7580a407..9b4dd375 100644
--- a/config.h
+++ b/config.h
@@ -152,5 +152,6 @@ class cFlatConfig
int marginOsdVer, marginOsdHor;
int MessageOffset;
+ int MenuContentFullSize;
double TopBarFontSize;
};
diff --git a/displaymenu.c b/displaymenu.c
index 0af751f0..5ab91f2e 100644
--- a/displaymenu.c
+++ b/displaymenu.c
@@ -521,8 +521,12 @@ void cFlatDisplayMenu::SetEvent(const cEvent *Event) {
if( ContentScrollable() )
DrawScrollbar(ContentScrollTotal(), ContentScrollOffset(), ContentVisibleLines(), contentTop - scrollBarTop, ContentGetHeight(), ContentScrollOffset() > 0, ContentScrollOffset() + ContentVisibleLines() < ContentScrollTotal());
- DecorBorderDraw(cLeft, cTop, cWidth, ContentGetHeight(), Config.decorBorderMenuContentSize, Config.decorBorderMenuContentType,
- Config.decorBorderMenuContentFg, Config.decorBorderMenuContentBg);
+ if( Config.MenuContentFullSize || ContentScrollable() )
+ DecorBorderDraw(cLeft, cTop, cWidth, ContentGetHeight(), Config.decorBorderMenuContentSize, Config.decorBorderMenuContentType,
+ Config.decorBorderMenuContentFg, Config.decorBorderMenuContentBg);
+ else
+ DecorBorderDraw(cLeft, cTop, cWidth, ContentGetTextHeight(), Config.decorBorderMenuContentSize, Config.decorBorderMenuContentType,
+ Config.decorBorderMenuContentFg, Config.decorBorderMenuContentBg);
}
void cFlatDisplayMenu::SetRecording(const cRecording *Recording) {
@@ -589,9 +593,14 @@ void cFlatDisplayMenu::SetRecording(const cRecording *Recording) {
RecordingBorder.ColorBg = Config.decorBorderMenuContentBg;
RecordingBorder.From = BorderMenuRecord;
- DecorBorderDraw(RecordingBorder.Left, RecordingBorder.Top, RecordingBorder.Width, RecordingBorder.Height,
- RecordingBorder.Size, RecordingBorder.Type,
- RecordingBorder.ColorFg, RecordingBorder.ColorBg, RecordingBorder.From);
+ if( Config.MenuContentFullSize || ContentScrollable() )
+ DecorBorderDraw(RecordingBorder.Left, RecordingBorder.Top, RecordingBorder.Width, RecordingBorder.Height,
+ RecordingBorder.Size, RecordingBorder.Type,
+ RecordingBorder.ColorFg, RecordingBorder.ColorBg, RecordingBorder.From);
+ else
+ DecorBorderDraw(RecordingBorder.Left, RecordingBorder.Top, RecordingBorder.Width, ContentGetTextHeight(),
+ RecordingBorder.Size, RecordingBorder.Type,
+ RecordingBorder.ColorFg, RecordingBorder.ColorBg, RecordingBorder.From);
}
void cFlatDisplayMenu::SetText(const char *Text, bool FixedFont) {
@@ -622,8 +631,12 @@ void cFlatDisplayMenu::SetText(const char *Text, bool FixedFont) {
if( ContentScrollable() )
DrawScrollbar(ContentScrollTotal(), ContentScrollOffset(), ContentVisibleLines(), contentTop - scrollBarTop, ContentGetHeight(), ContentScrollOffset() > 0, ContentScrollOffset() + ContentVisibleLines() < ContentScrollTotal());
- DecorBorderDraw(Left, Top, Width, ContentGetHeight(), Config.decorBorderMenuContentSize, Config.decorBorderMenuContentType,
- Config.decorBorderMenuContentFg, Config.decorBorderMenuContentBg);
+ if( Config.MenuContentFullSize || ContentScrollable() )
+ DecorBorderDraw(cLeft, cTop, cWidth, ContentGetHeight(), Config.decorBorderMenuContentSize, Config.decorBorderMenuContentType,
+ Config.decorBorderMenuContentFg, Config.decorBorderMenuContentBg);
+ else
+ DecorBorderDraw(cLeft, cTop, cWidth, ContentGetTextHeight(), Config.decorBorderMenuContentSize, Config.decorBorderMenuContentType,
+ Config.decorBorderMenuContentFg, Config.decorBorderMenuContentBg);
}
int cFlatDisplayMenu::GetTextAreaWidth(void) const {
diff --git a/po/de_DE.po b/po/de_DE.po
index 4656a1df..c8a89333 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-11-16 14:19+0100\n"
+"POT-Creation-Date: 2013-11-16 23:29+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"
@@ -177,6 +177,9 @@ msgstr "Signal Progress Größe"
msgid "Menuitem padding"
msgstr "Menüitem Abstand"
+msgid "Menu content fullsize background"
+msgstr "Menü Content voller Hintergrund"
+
msgid "Menuitem border by theme?"
msgstr "Menüitem Rand vom Theme?"
diff --git a/setup.c b/setup.c
index cfa7b72c..ece4c02b 100644
--- a/setup.c
+++ b/setup.c
@@ -133,6 +133,7 @@ void cFlatSetup::Store(void) {
SetupStore("marginOsdHor", Config.marginOsdHor);
SetupStore("TopBarFontSize", dtoa(Config.TopBarFontSize));
SetupStore("MessageOffset", Config.MessageOffset);
+ SetupStore("MenuContentFullSize", Config.MenuContentFullSize);
Config.Init();
}
@@ -315,6 +316,7 @@ void cFlatSetupMenu::Setup(void) {
Clear();
Add(new cMenuEditIntItem(tr("Menuitem padding"), &SetupConfig->MenuItemPadding));
+ Add(new cMenuEditBoolItem(tr("Menu content fullsize background"), &SetupConfig->MenuContentFullSize));
Add(new cMenuEditBoolItem(tr("Menuitem border by theme?"), &SetupConfig->decorBorderMenuItemByTheme));
if( SetupConfig->decorBorderMenuItemByTheme ) {