[vdr-plugin-skinenigmang] 04/06: Imported Upstream version 0.1.2+git20150212
Tobias Grimm
tiber-guest at moszumanska.debian.org
Thu Feb 12 01:26:19 UTC 2015
This is an automated email from the git hooks/post-receive script.
tiber-guest pushed a commit to branch master
in repository vdr-plugin-skinenigmang.
commit 13b5a9627470dde3af74fad224e5ea6e5b741422
Author: etobi <git at e-tobi.net>
Date: Thu Feb 12 02:21:26 2015 +0100
Imported Upstream version 0.1.2+git20150212
---
enigma.c | 49 +++++++++++++++++++++++--------------------------
1 file changed, 23 insertions(+), 26 deletions(-)
diff --git a/enigma.c b/enigma.c
index e1a8811..89a2b61 100644
--- a/enigma.c
+++ b/enigma.c
@@ -304,7 +304,7 @@ private:
#endif //DISABLE_SIGNALINFO
cString GetChannelName(const cChannel *Channel);
cString GetChannelNumber(const cChannel *Channel, int Number);
- int FindCatTextAndLen(const cEvent* e, int& xTextWidth, std::string& cat);
+ int FindCatTextAndLen(const cEvent* e, std::string& cat);
public:
cSkinEnigmaDisplayChannel(bool WithInfo);
virtual ~ cSkinEnigmaDisplayChannel();
@@ -783,9 +783,8 @@ cString cSkinEnigmaDisplayChannel::GetChannelNumber(const cChannel *Channel, int
return buffer;
}
-int cSkinEnigmaDisplayChannel::FindCatTextAndLen(const cEvent* e, int& xTextWidth, std::string& cat)
+int cSkinEnigmaDisplayChannel::FindCatTextAndLen(const cEvent* e, std::string& cat)
{
- int xCatWidth = 0;
cat = ExtractAttribute(e->Description(), EVENT_CATEGORY);
std::string gen = ExtractAttribute(e->Description(), EVENT_GENRE);
if (!cat.empty() && !gen.empty())
@@ -809,15 +808,7 @@ int cSkinEnigmaDisplayChannel::FindCatTextAndLen(const cEvent* e, int& xTextWidt
}
#endif
- if (!cat.empty()) {
- if (pFontSubtitle->Width(e->ShortText()) > xTextWidth * .5)
- xCatWidth = std::min((int)(xTextWidth * .3), pFontLanguage->Width(cat.c_str()));
- else
- xCatWidth = std::min((int)(xTextWidth * .5), pFontLanguage->Width(cat.c_str()));
- xTextWidth -= xCatWidth;
- }
-
- return xCatWidth;
+ return 0;
}
@@ -958,18 +949,21 @@ void cSkinEnigmaDisplayChannel::SetEvents(const cEvent *Present,
Theme.Color(clrBackground));
}
+ std::string strShortText = e->ShortText() ? e->ShortText() : "";
if (EnigmaConfig.showCatGenCon) {
std::string cat;
- int xCatWidth = FindCatTextAndLen(e, xTextWidth, cat);
-
- // draw category
- idEvCat = TE_MARQUEE(osd, idEvCat, fScrollOther, xTextLeft + xTextWidth + SmallGap, yEventNowTop + lineHeightTitle, cat.c_str(),
- Theme.Color(clrMenuItemNotSelectableFg),
- Theme.Color(clrBackground), pFontSubtitle, nBPP, xCatWidth - SmallGap, pFontSubtitle->Height(), taRight);
+ if (FindCatTextAndLen(e, cat) == 0 && !cat.empty()) {
+ // append category to shorttext
+ if (strShortText.empty()) {
+ strShortText = "[" + cat + "]";
+ } else {
+ strShortText += " [" + cat + "]";
+ }
+ }
}
// draw shorttext
- idEvSubTitle = TE_MARQUEE(osd, idEvSubTitle, fScrollOther, xTextLeft, yEventNowTop + lineHeightTitle, e->ShortText(),
+ idEvSubTitle = TE_MARQUEE(osd, idEvSubTitle, fScrollOther, xTextLeft, yEventNowTop + lineHeightTitle, strShortText.c_str(),
Theme.Color(clrMenuItemNotSelectableFg),
Theme.Color(clrBackground), pFontSubtitle, nBPP, xTextWidth, pFontSubtitle->Height());
@@ -1022,18 +1016,21 @@ void cSkinEnigmaDisplayChannel::SetEvents(const cEvent *Present,
yEventNextTop + lineHeightTitle, bmTimer,
Theme.Color(clrSymbolTimerActive), Theme.Color(clrAltBackground));
+ std::string strShortText = e->ShortText() ? e->ShortText() : "";
if (EnigmaConfig.showCatGenCon) {
std::string cat;
- int xCatWidth = FindCatTextAndLen(e, xTextWidth, cat);
-
- // draw category
- osd->DrawText(xTextLeft + xTextWidth + SmallGap, yEventNextTop + lineHeightTitle, cat.c_str(),
- Theme.Color(clrMenuItemNotSelectableFg),
- Theme.Color(clrAltBackground), pFontSubtitle, xCatWidth - SmallGap, 0, taRight);
+ if (FindCatTextAndLen(e, cat) == 0 && !cat.empty()) {
+ // append category to shorttext
+ if (strShortText.empty()) {
+ strShortText = "[" + cat + "]";
+ } else {
+ strShortText += " [" + cat + "]";
+ }
+ }
}
// draw shorttext
- osd->DrawText(xTextLeft, yEventNextTop + lineHeightTitle, e->ShortText(),
+ osd->DrawText(xTextLeft, yEventNextTop + lineHeightTitle, strShortText.c_str(),
Theme.Color(clrMenuItemNotSelectableFg),
Theme.Color(clrAltBackground), pFontSubtitle, xTextWidth);
}
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-vdr-dvb/vdr-plugin-skinenigmang.git
More information about the pkg-vdr-dvb-changes
mailing list