Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:frispete:vdr
vdr-plugin-skinenigmang
0016-Changed-how-a-event-s-category-is-displaye...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0016-Changed-how-a-event-s-category-is-displayed-now-appe.patch of Package vdr-plugin-skinenigmang
From 73b31166140d84bff88152ed99442ea24f3d6052 Mon Sep 17 00:00:00 2001 From: Andreas Mair <amair.sob@googlemail.com> Date: Thu, 14 Aug 2014 16:42:23 +0200 Subject: [PATCH 16/19] Changed how a event's category is displayed (now appended to an event's shorttext). --- 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); } -- 2.20.1
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor