diff options
-rw-r--r-- | HISTORY | 2 | ||||
-rw-r--r-- | config.c | 2 | ||||
-rw-r--r-- | config.h | 1 | ||||
-rw-r--r-- | displaymenu.c | 10 | ||||
-rw-r--r-- | displaymenuview.c | 145 | ||||
-rw-r--r-- | displaymenuview.h | 2 | ||||
-rw-r--r-- | displaytracks.c | 2 | ||||
-rw-r--r-- | imageloader.c | 4 | ||||
-rw-r--r-- | imageloader.h | 2 | ||||
-rw-r--r-- | menudetailview.c | 15 | ||||
-rw-r--r-- | menudetailview.h | 4 | ||||
-rw-r--r-- | menuitem.c | 39 | ||||
-rw-r--r-- | menuitem.h | 3 | ||||
-rw-r--r-- | po/de_DE.po | 11 | ||||
-rw-r--r-- | setup.c | 4 | ||||
-rw-r--r-- | setup.h | 1 |
16 files changed, 161 insertions, 86 deletions
@@ -143,3 +143,5 @@ Version 0.0.7: - Fixed a bug that Setup option narrowRecordingMenu was not stored - Fixed displaying remotetimers in main menu - Usage of menu icons in main and setup menu configurable +- "nOpacity mirrored": narrow menus can be adjusted on the right side via + plugin setup @@ -53,6 +53,7 @@ cNopacityConfig::cNopacityConfig() { volumeBorderBottom = 10; fontVolume = 0; //DisplayMenu + menuAdjustLeft = 1; scalePicture = 1; roundedCorners = 0; cornerRadius = 12; @@ -239,6 +240,7 @@ bool cNopacityConfig::SetupParse(const char *Name, const char *Value) { else if (strcmp(Name, "menuInfoTextDelay") == 0) menuInfoTextDelay = atoi(Value); else if (strcmp(Name, "menuInfoScrollDelay") == 0) menuInfoScrollDelay = atoi(Value); else if (strcmp(Name, "menuInfoScrollSpeed") == 0) menuInfoScrollSpeed = atoi(Value); + else if (strcmp(Name, "menuAdjustLeft") == 0) menuAdjustLeft = atoi(Value); else if (strcmp(Name, "scalePicture") == 0) scalePicture = atoi(Value); else if (strcmp(Name, "roundedCorners") == 0) roundedCorners = atoi(Value); else if (strcmp(Name, "cornerRadius") == 0) cornerRadius = atoi(Value); @@ -75,6 +75,7 @@ class cNopacityConfig { int volumeBorderBottom;
int fontVolume;
//DisplayMenu
+ int menuAdjustLeft;
int scalePicture;
int roundedCorners;
int cornerRadius;
diff --git a/displaymenu.c b/displaymenu.c index 59730e4..c184b58 100644 --- a/displaymenu.c +++ b/displaymenu.c @@ -373,7 +373,7 @@ bool cNopacityDisplayMenu::SetItemEvent(const cEvent *Event, int Index, bool Cur item->SetFontSmall(menuView->GetMenuItemFontSmall(mcSchedule)); item->SetFontEPGWindow(menuView->GetEPGWindowFont()); int spaceTop = menuView->GetMenuTop(currentNumItems, itemSize.Y()); - item->SetGeometry(Index, spaceTop, menuView->spaceMenu, itemSize.X(), itemSize.Y()); + item->SetGeometry(Index, spaceTop, menuView->GetMenuItemLeft(itemSize.X()), itemSize.X(), itemSize.Y(), menuView->spaceMenu); item->SetTextWindow(menuView->GetDescriptionTextWindowSize(mcSchedule)); item->SetCurrent(Current); item->SetBackgrounds(handleBackgrounds); @@ -410,7 +410,7 @@ bool cNopacityDisplayMenu::SetItemTimer(const cTimer *Timer, int Index, bool Cur item->SetFont(menuView->GetMenuItemFont(mcTimer)); item->SetFontSmall(menuView->GetMenuItemFontSmall(mcTimer)); int spaceTop = menuView->GetMenuTop(currentNumItems, itemSize.Y()); - item->SetGeometry(Index, spaceTop, menuView->spaceMenu, itemSize.X(), itemSize.Y()); + item->SetGeometry(Index, spaceTop, menuView->GetMenuItemLeft(itemSize.X()), itemSize.X(), itemSize.Y(), menuView->spaceMenu); item->SetCurrent(Current); item->SetBackgrounds(handleBackgrounds); item->CreateText(); @@ -446,7 +446,7 @@ bool cNopacityDisplayMenu::SetItemChannel(const cChannel *Channel, int Index, bo item->SetFont(menuView->GetMenuItemFont(mcChannel)); item->SetFontSmall(menuView->GetMenuItemFontSmall(mcChannel)); int spaceTop = menuView->GetMenuTop(currentNumItems, itemSize.Y()); - item->SetGeometry(Index, spaceTop, menuView->spaceMenu, itemSize.X(), itemSize.Y()); + item->SetGeometry(Index, spaceTop, menuView->GetMenuItemLeft(itemSize.X()), itemSize.X(), itemSize.Y(), menuView->spaceMenu); item->SetCurrent(Current); item->SetBackgrounds(handleBackgrounds); item->CreateText(); @@ -487,7 +487,7 @@ bool cNopacityDisplayMenu::SetItemRecording(const cRecording *Recording, int Ind item->SetFontSmall(menuView->GetMenuItemFontSmall(mcRecording)); item->SetFontEPGWindow(menuView->GetEPGWindowFont()); int spaceTop = menuView->GetMenuTop(currentNumItems, itemSize.Y()); - item->SetGeometry(Index, spaceTop, menuView->spaceMenu, itemSize.X(), itemSize.Y()); + item->SetGeometry(Index, spaceTop, menuView->GetMenuItemLeft(itemSize.X()), itemSize.X(), itemSize.Y(), menuView->spaceMenu); item->SetTextWindow(menuView->GetDescriptionTextWindowSize(mcRecording)); item->SetCurrent(Current); item->SetBackgrounds(handleBackgrounds); @@ -541,7 +541,7 @@ void cNopacityDisplayMenu::SetItem(const char *Text, int Index, bool Current, bo item->SetFont(menuView->GetMenuItemFont(mcUnknown)); } int spaceTop = menuView->GetMenuTop(currentNumItems, itemSize.Y()); - item->SetGeometry(Index, spaceTop, menuView->spaceMenu, itemSize.X(), itemSize.Y()); + item->SetGeometry(Index, spaceTop, menuView->GetMenuItemLeft(itemSize.X()), itemSize.X(), itemSize.Y(), menuView->spaceMenu); item->SetCurrent(Current); item->SetBackgrounds(handleBackgrounds); item->SetTabs(strItems, tabItems, MaxTabs); diff --git a/displaymenuview.c b/displaymenuview.c index c31c780..3c856ec 100644 --- a/displaymenuview.c +++ b/displaymenuview.c @@ -63,6 +63,11 @@ void cNopacityDisplayMenuView::SetGeometry(void) { contentWidthTimers = osdWidth * config.menuWidthTimers / 100; contentWidthRecordings = osdWidth * config.menuWidthRecordings / 100; contentWidthFull = osdWidth - widthScrollbar - spaceMenu; + contentWidthMinimum = Minimum(contentWidthMain, + contentWidthSchedules, + contentWidthChannels, + contentWidthTimers, + contentWidthRecordings); menuItemWidthDefault = contentWidthFull - 4 * spaceMenu; menuItemWidthMain = contentWidthMain - 4*spaceMenu; menuItemWidthSchedule = contentWidthSchedules - 4*spaceMenu; @@ -84,12 +89,12 @@ void cNopacityDisplayMenuView::SetGeometry(void) { } void cNopacityDisplayMenuView::SetDescriptionTextWindowSize(void) { - int xSchedules = 2 * spaceMenu + contentWidthSchedules + widthScrollbar; - int xRecordings = 2 * spaceMenu + contentWidthRecordings + widthScrollbar; + int xSchedules = (config.menuAdjustLeft) ? (2 * spaceMenu + contentWidthSchedules + widthScrollbar) : (spaceMenu); + int xRecordings = (config.menuAdjustLeft) ? (2 * spaceMenu + contentWidthRecordings + widthScrollbar) : (spaceMenu); int height = config.menuHeightInfoWindow * (contentHeight - 2*spaceMenu) / 100; int y = headerHeight + (contentHeight - height - spaceMenu); - int widthSchedules = osdWidth - xSchedules - spaceMenu; - int widthRecordings = osdWidth - xRecordings - spaceMenu; + int widthSchedules = (config.menuAdjustLeft) ? (osdWidth - xSchedules - spaceMenu) : (osdWidth - contentWidthSchedules - widthScrollbar - 2 * spaceMenu); + int widthRecordings = (config.menuAdjustLeft) ? (osdWidth - xRecordings - spaceMenu) : (osdWidth - contentWidthRecordings - widthScrollbar - 2 * spaceMenu); textWindowSizeSchedules = cRect(xSchedules,y,widthSchedules,height); textWindowSizeRecordings = cRect(xRecordings,y,widthRecordings,height); } @@ -149,23 +154,23 @@ int cNopacityDisplayMenuView::GetContentWidth(eMenuCategory menuCat) { void cNopacityDisplayMenuView::CreatePixmaps(void) { pixmapHeader = osd->CreatePixmap(1, cRect(0, 0, osdWidth, headerHeight)); - pixmapHeaderLogo = osd->CreatePixmap(-1, cRect(0, 0, config.menuHeaderLogoWidth, config.menuHeaderLogoHeight)); - pixmapHeaderLabel = osd->CreatePixmap(2, cRect(0, 0, osdWidth - dateWidth, headerHeight)); - pixmapDate = osd->CreatePixmap(2, cRect(osdWidth - dateWidth, 0, dateWidth, headerHeight)); + int dateX = (config.menuAdjustLeft) ? (osdWidth - dateWidth) : 0; + pixmapDate = osd->CreatePixmap(2, cRect(dateX, 0, dateWidth, headerHeight)); + int logoX = (config.menuAdjustLeft) ? 0 : (osdWidth - config.menuHeaderLogoWidth); + pixmapHeaderLogo = osd->CreatePixmap(-1, cRect(logoX, 0, config.menuHeaderLogoWidth, config.menuHeaderLogoHeight)); + int labelX = (config.menuAdjustLeft) ? 0 : dateWidth; + pixmapHeaderLabel = osd->CreatePixmap(2, cRect(labelX, 0, osdWidth - dateWidth, headerHeight)); pixmapFooter = osd->CreatePixmap(1, cRect(0, osdHeight-footerHeight, osdWidth, footerHeight)); - int drawPortWidth = osdWidth + contentWidthFull - - Minimum(contentWidthMain, - contentWidthSchedules, - contentWidthChannels, - contentWidthTimers, - contentWidthRecordings); + int drawPortWidth = osdWidth + contentWidthFull - contentWidthMinimum; pixmapContent = osd->CreatePixmap(1, cRect(0, headerHeight, osdWidth, contentHeight), cRect(0, 0, drawPortWidth, contentHeight)); - pixmapScrollbar = osd->CreatePixmap(2, cRect(contentWidthMain, 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 - 8, headerHeight + spaceMenu + 2, diskUsageWidth - 4, diskUsageHeight - 4)); - pixmapDiskUsageLabel = osd->CreatePixmap(4, cRect(osdWidth - diskUsageWidth - 8, headerHeight + spaceMenu + 2, diskUsageWidth - 4, diskUsageHeight - 4)); - + int diskUsageX = (config.menuAdjustLeft) ? (osdWidth - diskUsageWidth - 10) : 10; + pixmapDiskUsage = osd->CreatePixmap(2, cRect(diskUsageX, headerHeight + spaceMenu, diskUsageWidth, diskUsageHeight)); + pixmapDiskUsageIcon = osd->CreatePixmap(3, cRect(diskUsageX + 2, headerHeight + spaceMenu + 2, diskUsageWidth - 4, diskUsageHeight - 4)); + pixmapDiskUsageLabel = osd->CreatePixmap(4, cRect(diskUsageX + 2, headerHeight + spaceMenu + 2, diskUsageWidth - 4, diskUsageHeight - 4)); + int scrollbarX = (config.menuAdjustLeft) ? contentWidthMain : (osdWidth - contentWidthMain); + pixmapScrollbar = osd->CreatePixmap(2, cRect(scrollbarX, headerHeight + spaceMenu, widthScrollbar, contentHeight - 2 * spaceMenu)); + pixmapHeaderLogo->Fill(clrTransparent); pixmapHeaderLabel->Fill(clrTransparent); pixmapDiskUsage->Fill(clrTransparent); @@ -327,6 +332,13 @@ int cNopacityDisplayMenuView::GetMenuTop(int numItems, int itemHeight) { return headerHeight + (contentHeight - numItems*(itemHeight + spaceMenu))/2; } +int cNopacityDisplayMenuView::GetMenuItemLeft(int itemWidth) { + int menuLeft = spaceMenu; + if (!config.menuAdjustLeft) + menuLeft = osdWidth - itemWidth - spaceMenu; + return menuLeft; +} + void cNopacityDisplayMenuView::SetAvrgFontWidth(void) { avrgFontWidth = fontMenuitemDefault->Width("x")+3; } @@ -409,56 +421,86 @@ void cNopacityDisplayMenuView::CreateBackgroundImages(int *handleBackgrounds, in void cNopacityDisplayMenuView::DrawBorderDecoration() { cImageLoader imgLoader; - imgLoader.DrawBackground(Theme.Color(clrMenuHeaderBlend), Theme.Color(clrMenuHeader), osdWidth, headerHeight); + bool mirrorHeader = (config.menuAdjustLeft) ? false : true; + imgLoader.DrawBackground(Theme.Color(clrMenuHeaderBlend), Theme.Color(clrMenuHeader), osdWidth, headerHeight, mirrorHeader); pixmapHeader->DrawImage(cPoint(0,0), imgLoader.GetImage()); pixmapFooter->Fill(Theme.Color(clrMenuBack)); int borderWidth = 2; int radius = 10; - int minContentWidth = Minimum(contentWidthMain, - contentWidthSchedules, - contentWidthChannels, - contentWidthTimers, - contentWidthRecordings); + pixmapContent->Fill(clrTransparent); - pixmapContent->DrawRectangle(cRect(0, 0, contentWidthFull-radius, contentHeight), Theme.Color(clrMenuBack)); - pixmapContent->DrawRectangle(cRect(contentWidthFull, 0, osdWidth - minContentWidth, borderWidth), Theme.Color(clrMenuBorder)); - pixmapContent->DrawRectangle(cRect(contentWidthFull, contentHeight - borderWidth, osdWidth - minContentWidth, borderWidth), Theme.Color(clrMenuBorder)); - pixmapContent->DrawRectangle(cRect(contentWidthFull - radius, 0, radius, radius), Theme.Color(clrMenuBack)); - pixmapContent->DrawEllipse(cRect(contentWidthFull - radius, 0, radius, radius), Theme.Color(clrMenuBorder),2); - pixmapContent->DrawEllipse(cRect(contentWidthFull - radius + borderWidth, borderWidth, radius-borderWidth, radius-borderWidth), clrTransparent, 2); - pixmapContent->DrawRectangle(cRect(contentWidthFull-radius, radius, borderWidth, contentHeight - 2*radius), Theme.Color(clrMenuBorder)); - pixmapContent->DrawRectangle(cRect(contentWidthFull - radius, contentHeight - radius, radius, radius), Theme.Color(clrMenuBack)); - pixmapContent->DrawEllipse(cRect(contentWidthFull - radius, contentHeight - radius, radius, radius), Theme.Color(clrMenuBorder),3); - pixmapContent->DrawEllipse(cRect(contentWidthFull - radius + borderWidth, contentHeight - radius, radius-borderWidth, radius-borderWidth), clrTransparent, 3); + if (config.menuAdjustLeft) { + //Background + pixmapContent->DrawRectangle(cRect(0, 0, contentWidthFull - radius, contentHeight), Theme.Color(clrMenuBack)); + //Upper and lower Corner Square + pixmapContent->DrawRectangle(cRect(contentWidthFull - radius, 0, radius, radius), Theme.Color(clrMenuBack)); + pixmapContent->DrawRectangle(cRect(contentWidthFull - radius, contentHeight - radius, radius, radius), Theme.Color(clrMenuBack)); + //Upper line + pixmapContent->DrawRectangle(cRect(contentWidthFull, 0, osdWidth - contentWidthMinimum, borderWidth), Theme.Color(clrMenuBorder)); + //Lower Line + pixmapContent->DrawRectangle(cRect(contentWidthFull, contentHeight - borderWidth, osdWidth - contentWidthMinimum, borderWidth), Theme.Color(clrMenuBorder)); + //Vertical line + pixmapContent->DrawRectangle(cRect(contentWidthFull-radius, radius, borderWidth, contentHeight - 2*radius), Theme.Color(clrMenuBorder)); + //Upper Ellipse + pixmapContent->DrawEllipse(cRect(contentWidthFull - radius, 0, radius, radius), Theme.Color(clrMenuBorder),2); + pixmapContent->DrawEllipse(cRect(contentWidthFull - radius + borderWidth, borderWidth, radius-borderWidth, radius-borderWidth), clrTransparent, 2); + //Lower Ellipse + pixmapContent->DrawEllipse(cRect(contentWidthFull - radius, contentHeight - radius, radius, radius), Theme.Color(clrMenuBorder),3); + pixmapContent->DrawEllipse(cRect(contentWidthFull - radius + borderWidth, contentHeight - radius, radius-borderWidth, radius-borderWidth), clrTransparent, 3); + } else { + //Background + pixmapContent->DrawRectangle(cRect(osdWidth - contentWidthMinimum + radius, 0, contentWidthFull - radius, contentHeight), Theme.Color(clrMenuBack)); + //Upper and lower Corner Square + pixmapContent->DrawRectangle(cRect(osdWidth - contentWidthMinimum, 0, radius, radius), Theme.Color(clrMenuBack)); + pixmapContent->DrawRectangle(cRect(osdWidth - contentWidthMinimum, contentHeight - radius, radius, radius), Theme.Color(clrMenuBack)); + //Upper line + pixmapContent->DrawRectangle(cRect(0, 0, osdWidth - contentWidthMinimum, borderWidth), Theme.Color(clrMenuBorder)); + //Lower Line + pixmapContent->DrawRectangle(cRect(0, contentHeight - borderWidth, osdWidth - contentWidthMinimum, borderWidth), Theme.Color(clrMenuBorder)); + //Vertical line + pixmapContent->DrawRectangle(cRect(osdWidth - contentWidthMinimum + radius - borderWidth, radius, borderWidth, contentHeight - 2*radius), Theme.Color(clrMenuBorder)); + //Upper Ellipse + pixmapContent->DrawEllipse(cRect(osdWidth - contentWidthMinimum, 0, radius, radius), Theme.Color(clrMenuBorder),1); + pixmapContent->DrawEllipse(cRect(osdWidth - contentWidthMinimum, borderWidth, radius-borderWidth, radius-borderWidth), clrTransparent, 1); + //Lower Ellipse + pixmapContent->DrawEllipse(cRect(osdWidth - contentWidthMinimum, contentHeight - radius, radius, radius), Theme.Color(clrMenuBorder),4); + pixmapContent->DrawEllipse(cRect(osdWidth - contentWidthMinimum, contentHeight - radius, radius-borderWidth, radius-borderWidth), clrTransparent, 4); + } } void cNopacityDisplayMenuView::AdjustContentBackground(eMenuCategory menuCat, eMenuCategory menuCatLast, cRect & vidWin) { int contentWidth = GetContentWidth(menuCat); int contentWidthLast = GetContentWidth(menuCatLast); - if (contentWidth != contentWidthLast) { + int drawportX; + if ((contentWidth != contentWidthLast)||(menuCatLast == mcUndefined)) { if (contentWidth == contentWidthFull) { - pixmapContent->SetDrawPortPoint(cPoint(0, 0)); + drawportX = (config.menuAdjustLeft)?0:(contentWidthMinimum - contentWidthFull); + pixmapContent->SetDrawPortPoint(cPoint(drawportX, 0)); if (config.scalePicture) { // ask output device to restore full size vidWin = cDevice::PrimaryDevice()->CanScaleVideo(cRect::Null); } } else { - pixmapContent->SetDrawPortPoint(cPoint(contentWidth - contentWidthFull, 0)); + drawportX = (config.menuAdjustLeft)?(contentWidth - contentWidthFull):(contentWidthMinimum - contentWidth); + pixmapContent->SetDrawPortPoint(cPoint(drawportX, 0)); if (config.scalePicture) { // ask output device to scale down + int windowX = (config.menuAdjustLeft)?(osdLeft + contentWidth + widthScrollbar + 2 * spaceMenu) + :(osdLeft + 2 * spaceMenu); cRect availableRect( - osdLeft + contentWidth + widthScrollbar + 2 * spaceMenu, + windowX, osdTop + headerHeight, contentWidthFull - osdLeft - contentWidth - widthScrollbar - 4 * spaceMenu, - contentHeight);// - osdTop - headerHeight); + contentHeight); vidWin = cDevice::PrimaryDevice()->CanScaleVideo(availableRect); } } } osd->DestroyPixmap(pixmapScrollbar); - pixmapScrollbar = osd->CreatePixmap(2, cRect(contentWidth , headerHeight + spaceMenu, widthScrollbar, osdHeight - headerHeight - footerHeight - 2*spaceMenu)); + int scrollbarX = (config.menuAdjustLeft)?(contentWidth):(osdWidth - contentWidth - widthScrollbar); + pixmapScrollbar = osd->CreatePixmap(2, cRect(scrollbarX , headerHeight + spaceMenu, widthScrollbar, osdHeight - headerHeight - footerHeight - 2*spaceMenu)); pixmapScrollbar->Fill(clrTransparent); } @@ -507,7 +549,8 @@ int cNopacityDisplayMenuView::DrawHeaderIcon(eMenuCategory menuCat) { int left = 0; if (drawIcon) { - pixmapHeaderIcon = osd->CreatePixmap(2, cRect(0, 0, config.headerIconHeight, config.headerIconHeight)); + int iconX = (config.menuAdjustLeft) ? 0 : (osdWidth - config.headerIconHeight); + pixmapHeaderIcon = osd->CreatePixmap(2, cRect(iconX, 0, config.headerIconHeight, config.headerIconHeight)); pixmapHeaderIcon->Fill(clrTransparent); cImageLoader imgLoader; if (imgLoader.LoadIcon(*icon, config.headerIconHeight)) { @@ -520,7 +563,8 @@ int cNopacityDisplayMenuView::DrawHeaderIcon(eMenuCategory menuCat) { int cNopacityDisplayMenuView::ShowHeaderIconChannelLogo(const char *Title) { int left = 0; - pixmapHeaderIcon = osd->CreatePixmap(2, cRect(0, 0, config.menuItemLogoWidth, config.menuItemLogoHeight)); + int iconX = (config.menuAdjustLeft) ? 0 : (osdWidth - config.menuItemLogoWidth); + pixmapHeaderIcon = osd->CreatePixmap(2, cRect(iconX, 0, config.menuItemLogoWidth, config.menuItemLogoHeight)); pixmapHeaderIcon->Fill(clrTransparent); std::string channel = Title; if (channel.length() == 0) @@ -547,8 +591,9 @@ void cNopacityDisplayMenuView::DestroyHeaderIcon(void) { void cNopacityDisplayMenuView::DrawHeaderLabel(int left, cString label) { pixmapHeaderLabel->Fill(clrTransparent); - pixmapHeaderLabel->DrawText(cPoint(left, ((headerHeight - 10) - fontHeader->Height()) / 2), *label, Theme.Color(clrMenuFontHeader), clrTransparent, fontHeader); - + int labelW = fontHeader->Width(label); + int labelX = (config.menuAdjustLeft) ? (left) : (osdWidth - dateWidth - labelW - left - 2*spaceMenu); + pixmapHeaderLabel->DrawText(cPoint(labelX, ((headerHeight - 10) - fontHeader->Height()) / 2), *label, Theme.Color(clrMenuFontHeader), clrTransparent, fontHeader); } void cNopacityDisplayMenuView::DrawDate(bool initial) { @@ -556,7 +601,8 @@ void cNopacityDisplayMenuView::DrawDate(bool initial) { if (initial || strcmp(date, lastDate)) { pixmapDate->Fill(clrTransparent); int dateW = fontDate->Width(date); - pixmapDate->DrawText(cPoint(dateWidth - dateW - 2*spaceMenu, (headerHeight - fontDate->Height()) / 2), date, Theme.Color(clrMenuFontDate), clrTransparent, fontDate); + int dateX = (config.menuAdjustLeft) ? (dateWidth - dateW - 2*spaceMenu) : (spaceMenu); + pixmapDate->DrawText(cPoint(dateX, (headerHeight - fontDate->Height()) / 2), date, Theme.Color(clrMenuFontDate), clrTransparent, fontDate); lastDate = date; } } @@ -654,7 +700,8 @@ cNopacityTimer *cNopacityDisplayMenuView::DrawTimerConflict(int numConflicts, in t->SetGeometry(timersWidth, y); t->CreateConflictText(); t->CalculateHeight(spaceMenu); - t->CreatePixmaps(osdWidth - timersWidth - 10); + int timerX = (config.menuAdjustLeft) ? (osdWidth - timersWidth - 10) : 10; + t->CreatePixmaps(timerX); t->Render(); return t; } @@ -665,7 +712,8 @@ cNopacityTimer *cNopacityDisplayMenuView::DrawTimer(const cTimer *Timer, int y) t->CreateDate(); t->CreateShowName(); t->CalculateHeight(spaceMenu); - t->CreatePixmaps(osdWidth - timersWidth - 10); + int timerX = (config.menuAdjustLeft) ? (osdWidth - timersWidth - 10) : 10; + t->CreatePixmaps(timerX); t->Render(); return t; } @@ -720,6 +768,7 @@ void cNopacityDisplayMenuView::ClearMessage(void) { } void cNopacityDisplayMenuView::SetDetailViewSize(eDetailViewType detailViewType, cNopacityMenuDetailView *detailView) { + int x = (config.menuAdjustLeft) ? 0 : osdWidth - contentWidthFull + 2*spaceMenu; int width = 0; int height = 0; int top = 0; @@ -742,5 +791,5 @@ void cNopacityDisplayMenuView::SetDetailViewSize(eDetailViewType detailViewType, width = contentWidthFull - 2*spaceMenu; height = contentHeight; top = headerHeight; - detailView->SetGeometry(width, height, top, contentBorder, detailHeaderHeight); + detailView->SetGeometry(x, width, height, top, contentBorder, detailHeaderHeight); } diff --git a/displaymenuview.h b/displaymenuview.h index 6dfc962..f090f4f 100644 --- a/displaymenuview.h +++ b/displaymenuview.h @@ -50,6 +50,7 @@ class cNopacityDisplayMenuView { int contentWidthChannels; int contentWidthTimers; int contentWidthRecordings; + int contentWidthMinimum; int menuItemWidthDefault, menuItemHeightDefault; int menuItemWidthMain, menuItemHeightMain; int menuItemWidthSchedule, menuItemHeightSchedule; @@ -79,6 +80,7 @@ class cNopacityDisplayMenuView { void GetMenuItemSize(eMenuCategory menuCat, cPoint *itemSize); int GetMaxItems(eMenuCategory menuCat); int GetMenuTop(int numItems, int itemHeight); + int GetMenuItemLeft(int itemWidth); void SetAvrgFontWidth(void); int mytabs[cSkinDisplayMenu::MaxTabs]; void SetTabs(int Tab1, int Tab2 = 0, int Tab3 = 0, int Tab4 = 0, int Tab5 = 0); diff --git a/displaytracks.c b/displaytracks.c index 37a55b5..5eb9b4c 100644 --- a/displaytracks.c +++ b/displaytracks.c @@ -127,7 +127,7 @@ void cNopacityDisplayTracks::SetItem(const char *Text, int Index, bool Current) item = new cNopacityTrackMenuItem(osd, Text); item->SetCurrent(Current); item->SetFont(font); - item->SetGeometry(Index, menuItemHeight+5, 2, menuItemWidth, menuItemHeight); + item->SetGeometry(Index, menuItemHeight+5, 2, menuItemWidth, menuItemHeight, 5); item->CreatePixmap(); item->SetBackgrounds(handleBackgrounds); menuItems.Add(item); diff --git a/imageloader.c b/imageloader.c index 188100b..bfc4ce5 100644 --- a/imageloader.c +++ b/imageloader.c @@ -159,7 +159,7 @@ bool cImageLoader::LoadAdditionalRecordingImage(cString path, cString name) { return false; } -void cImageLoader::DrawBackground(tColor back, tColor blend, int width, int height) { +void cImageLoader::DrawBackground(tColor back, tColor blend, int width, int height, bool mirror) { Color Back = Argb2Color(back); Color Blend = Argb2Color(blend); Image tmp(Geometry(width, height), Blend); @@ -167,6 +167,8 @@ void cImageLoader::DrawBackground(tColor back, tColor blend, int width, int heig tmp.sparseColor(MatteChannel, BarycentricColorInterpolate, 9, arguments); Image tmp2(Geometry(width, height), Back); tmp.composite(tmp2, 0, 0, OverlayCompositeOp); + if (mirror) + tmp.flop(); buffer = tmp; } diff --git a/imageloader.h b/imageloader.h index 0b3f13b..a5a0b5f 100644 --- a/imageloader.h +++ b/imageloader.h @@ -21,7 +21,7 @@ public: bool LoadAdditionalEPGImage(cString name); bool LoadRecordingImage(cString Path); bool LoadAdditionalRecordingImage(cString path, cString name); - void DrawBackground(tColor back, tColor blend, int width, int height); + void DrawBackground(tColor back, tColor blend, int width, int height, bool mirror = false); void DrawBackground2(tColor back, tColor blend, int width, int height); private: Image buffer; diff --git a/menudetailview.c b/menudetailview.c index 6c07b4b..f2131e1 100644 --- a/menudetailview.c +++ b/menudetailview.c @@ -18,7 +18,8 @@ cNopacityMenuDetailView::~cNopacityMenuDetailView(void) { delete fontHeaderLarge; } -void cNopacityMenuDetailView::SetGeometry(int width, int height, int top, int contentBorder, int headerHeight) { +void cNopacityMenuDetailView::SetGeometry(int x, int width, int height, int top, int contentBorder, int headerHeight) { + this->x = x; this->width = width; this->height = height; this->top = top; @@ -103,10 +104,10 @@ cNopacityMenuDetailEventView::~cNopacityMenuDetailEventView(void) { } void cNopacityMenuDetailEventView::CreatePixmaps(void) { - pixmapHeader = osd->CreatePixmap(3, cRect(0, top, width, headerHeight)); - pixmapContent = osd->CreatePixmap(3, cRect(0, top + headerHeight, width, contentHeight), + pixmapHeader = osd->CreatePixmap(3, cRect(x, top, width, headerHeight)); + pixmapContent = osd->CreatePixmap(3, cRect(x, top + headerHeight, width, contentHeight), cRect(0, 0, width, contentDrawPortHeight)); - pixmapLogo = osd->CreatePixmap(4, cRect(0 + border, top + max((headerHeight-config.logoHeight)/2,1), config.detailViewLogoWidth, config.detailViewLogoHeight)); + pixmapLogo = osd->CreatePixmap(4, cRect(x + border, top + max((headerHeight-config.logoHeight)/2,1), config.detailViewLogoWidth, config.detailViewLogoHeight)); pixmapHeader->Fill(clrTransparent); pixmapHeader->DrawRectangle(cRect(0, headerHeight - 2, width, 2), Theme.Color(clrMenuBorder)); @@ -309,8 +310,8 @@ cNopacityMenuDetailRecordingView::~cNopacityMenuDetailRecordingView(void) { } void cNopacityMenuDetailRecordingView::CreatePixmaps(void) { - pixmapHeader = osd->CreatePixmap(3, cRect(0, top, width, headerHeight)); - pixmapContent = osd->CreatePixmap(3, cRect(0, top + headerHeight, width, contentHeight), + pixmapHeader = osd->CreatePixmap(3, cRect(x, top, width, headerHeight)); + pixmapContent = osd->CreatePixmap(3, cRect(x, top + headerHeight, width, contentHeight), cRect(0, 0, width, contentDrawPortHeight)); pixmapHeader->Fill(clrTransparent); @@ -614,7 +615,7 @@ void cNopacityMenuDetailTextView::SetContentHeight(void) { } void cNopacityMenuDetailTextView::CreatePixmaps(void) { - pixmapContent = osd->CreatePixmap(3, cRect(0, top + headerHeight, width, contentHeight), + pixmapContent = osd->CreatePixmap(3, cRect(x, top + headerHeight, width, contentHeight), cRect(0, 0, width, contentDrawPortHeight)); pixmapContent->Fill(clrTransparent); diff --git a/menudetailview.h b/menudetailview.h index 76d4e8f..9fae59e 100644 --- a/menudetailview.h +++ b/menudetailview.h @@ -5,7 +5,7 @@ class cNopacityMenuDetailView { protected: cOsd *osd; bool hasScrollbar; - int width, height, top; + int x, width, height, top; int headerHeight; int contentHeight; int contentDrawPortHeight; @@ -19,7 +19,7 @@ protected: public: cNopacityMenuDetailView(cOsd *osd); virtual ~cNopacityMenuDetailView(void); - void SetGeometry(int width, int height, int top, int contentBorder, int headerHeight); + void SetGeometry(int x, int width, int height, int top, int contentBorder, int headerHeight); virtual void SetFonts(void) = 0; bool Scrollable(void) {return hasScrollbar;} double ScrollbarSize(void); @@ -45,25 +45,26 @@ void cNopacityMenuItem::SetCurrent(bool cur) { current = cur; } -void cNopacityMenuItem::SetGeometry(int index, int top, int left, int width, int height) { +void cNopacityMenuItem::SetGeometry(int index, int top, int left, int width, int height, int spaceMenu) { this->index = index; this->top = top; this->left = left; this->width = width; this->height = height; + this->spaceMenu = spaceMenu; } void cNopacityMenuItem::CreatePixmap() { - pixmap = osd->CreatePixmap(3, cRect(left, top + index * (height + left), width, height)); + pixmap = osd->CreatePixmap(3, cRect(left, top + index * (height + spaceMenu), width, height)); } void cNopacityMenuItem::CreatePixmapIcon(void) { - pixmapIcon = osd->CreatePixmap(5, cRect(left, top + index * (height + left), width, height)); + pixmapIcon = osd->CreatePixmap(5, cRect(left, top + index * (height + spaceMenu), width, height)); pixmapIcon->Fill(clrTransparent); } void cNopacityMenuItem::CreatePixmapTextScroller(int totalWidth) { - pixmapTextScroller = osd->CreatePixmap(4, cRect(left, top + index * (height + left), width, height), cRect(0, 0, totalWidth+10, height)); + pixmapTextScroller = osd->CreatePixmap(4, cRect(left, top + index * (height + spaceMenu), width, height), cRect(0, 0, totalWidth+10, height)); pixmapTextScroller->Fill(clrTransparent); } @@ -90,7 +91,7 @@ void cNopacityMenuItem::DrawDelimiter(const char *del, const char *icon, int han if (!drawn) { if (imgLoader.LoadIcon(icon, config.iconHeight)) { if (pixmapIcon == NULL) { - pixmapIcon = osd->CreatePixmap(5, cRect(left, top + index * (height + left), config.menuItemLogoWidth, config.menuItemLogoWidth)); + pixmapIcon = osd->CreatePixmap(5, cRect(left, top + index * (height + spaceMenu), config.menuItemLogoWidth, config.menuItemLogoWidth)); pixmapIcon->Fill(clrTransparent); } pixmapIcon->DrawImage(cPoint(1, (height - config.iconHeight) / 2), imgLoader.GetImage()); @@ -219,7 +220,7 @@ void cNopacityMainMenuItem::CreatePixmapTextScroller(int totalWidth) { if (config.useMenuIcons) pixmapWidth -= config.iconHeight; int drawPortWidth = totalWidth + 10; - pixmapTextScroller = osd->CreatePixmap(4, cRect(pixmapLeft, top + index * (height + left), pixmapWidth, height), cRect(0, 0, drawPortWidth, height)); + pixmapTextScroller = osd->CreatePixmap(4, cRect(pixmapLeft, top + index * (height + spaceMenu), pixmapWidth, height), cRect(0, 0, drawPortWidth, height)); pixmapTextScroller->Fill(clrTransparent); } @@ -260,7 +261,7 @@ void cNopacityMainMenuItem::CreateText() { } int cNopacityMainMenuItem::CheckScrollable(bool hasIcon) { - int spaceLeft = left; + int spaceLeft = spaceMenu; if (hasIcon) spaceLeft += config.iconHeight; int totalTextWidth = width - spaceLeft; @@ -356,7 +357,7 @@ void cNopacityScheduleMenuItem::CreatePixmapTextScroller(int totalWidth) { pixmapLeft += config.menuItemLogoWidth + 5; pixmapWidth = pixmapWidth - config.menuItemLogoWidth - 5; } - pixmapTextScroller = osd->CreatePixmap(4, cRect(pixmapLeft, top + index * (height + left), pixmapWidth, height), cRect(0, 0, drawPortWidth, height)); + pixmapTextScroller = osd->CreatePixmap(4, cRect(pixmapLeft, top + index * (height + spaceMenu), pixmapWidth, height), cRect(0, 0, drawPortWidth, height)); pixmapTextScroller->Fill(clrTransparent); } @@ -379,7 +380,7 @@ void cNopacityScheduleMenuItem::CreateText() { } int cNopacityScheduleMenuItem::CheckScrollable(bool hasIcon) { - int spaceLeft = left; + int spaceLeft = spaceMenu; if (hasIcon) spaceLeft += config.menuItemLogoWidth; int totalTextWidth = width - spaceLeft; @@ -535,7 +536,7 @@ void cNopacityChannelMenuItem::CreatePixmapTextScroller(int totalWidth) { int pixmapLeft = left + config.menuItemLogoWidth + 10; int pixmapWidth = width - config.menuItemLogoWidth - 10; int drawPortWidth = totalWidth + 10; - pixmapTextScroller = osd->CreatePixmap(4, cRect(pixmapLeft, top + index * (height + left), pixmapWidth, height), cRect(0, 0, drawPortWidth, height)); + pixmapTextScroller = osd->CreatePixmap(4, cRect(pixmapLeft, top + index * (height + spaceMenu), pixmapWidth, height), cRect(0, 0, drawPortWidth, height)); pixmapTextScroller->Fill(clrTransparent); } @@ -550,7 +551,7 @@ void cNopacityChannelMenuItem::CreateText() { } int cNopacityChannelMenuItem::CheckScrollable(bool hasIcon) { - int spaceLeft = left; + int spaceLeft = spaceMenu; if (hasIcon) spaceLeft += config.menuItemLogoWidth; int totalTextWidth = width - spaceLeft; @@ -637,7 +638,7 @@ void cNopacityTimerMenuItem::CreatePixmapTextScroller(int totalWidth) { int pixmapLeft = left + config.menuItemLogoWidth + 10; int pixmapWidth = width - config.menuItemLogoWidth - 10; int drawPortWidth = totalWidth + 10; - pixmapTextScroller = osd->CreatePixmap(4, cRect(pixmapLeft, top + index * (height + left), pixmapWidth, height), cRect(0, 0, drawPortWidth, height)); + pixmapTextScroller = osd->CreatePixmap(4, cRect(pixmapLeft, top + index * (height + spaceMenu), pixmapWidth, height), cRect(0, 0, drawPortWidth, height)); pixmapTextScroller->Fill(clrTransparent); } @@ -670,7 +671,7 @@ std::string cNopacityTimerMenuItem::CreateDate(void) { } int cNopacityTimerMenuItem::CheckScrollable(bool hasIcon) { - int spaceLeft = left; + int spaceLeft = spaceMenu; if (hasIcon) spaceLeft += config.menuItemLogoWidth; int totalTextWidth = width - spaceLeft; @@ -793,7 +794,7 @@ void cNopacityRecordingMenuItem::CreatePixmapTextScroller(int totalWidth) { pixmapWidth = width - 10; } - pixmapTextScroller = osd->CreatePixmap(4, cRect(pixmapLeft, top + index * (height + left), pixmapWidth, height), cRect(0, 0, drawPortWidth, height)); + pixmapTextScroller = osd->CreatePixmap(4, cRect(pixmapLeft, top + index * (height + spaceMenu), pixmapWidth, height), cRect(0, 0, drawPortWidth, height)); pixmapTextScroller->Fill(clrTransparent); } @@ -825,7 +826,7 @@ int cNopacityRecordingMenuItem::CheckScrollable(bool hasIcon) { } int cNopacityRecordingMenuItem::CheckScrollableRecording(void) { - int spaceLeft = left; + int spaceLeft = spaceMenu; int iconWidth = 0; if (Recording->IsNew()) iconWidth += font->Height() + 10; @@ -842,7 +843,7 @@ int cNopacityRecordingMenuItem::CheckScrollableRecording(void) { } int cNopacityRecordingMenuItem::CheckScrollableFolder(void) { - int spaceLeft = left + config.menuRecFolderSize; + int spaceLeft = spaceMenu + config.menuRecFolderSize; int totalTextWidth = width - spaceLeft; strRecNameFull = strRecName.c_str(); if (font->Width(strRecName.c_str()) > (width - spaceLeft)) { @@ -1030,13 +1031,13 @@ cNopacityDefaultMenuItem::~cNopacityDefaultMenuItem(void) { void cNopacityDefaultMenuItem::SetTextFull(void) { tColor clrFont = (current)?Theme.Color(clrMenuFontMenuItemHigh):Theme.Color(clrMenuFontMenuItem); pixmapTextScroller->Fill(clrTransparent); - pixmapTextScroller->DrawText(cPoint(0, (height - font->Height()) / 2), strEntryFull.c_str(), clrFont, clrTransparent, font); + pixmapTextScroller->DrawText(cPoint(5, (height - font->Height()) / 2), strEntryFull.c_str(), clrFont, clrTransparent, font); } void cNopacityDefaultMenuItem::SetTextShort(void) { tColor clrFont = (current)?Theme.Color(clrMenuFontMenuItemHigh):Theme.Color(clrMenuFontMenuItem); pixmapTextScroller->Fill(clrTransparent); - pixmapTextScroller->DrawText(cPoint(0, (height - font->Height()) / 2), strEntry.c_str(), clrFont, clrTransparent, font); + pixmapTextScroller->DrawText(cPoint(5, (height - font->Height()) / 2), strEntry.c_str(), clrFont, clrTransparent, font); } int cNopacityDefaultMenuItem::CheckScrollable(bool hasIcon) { @@ -1061,7 +1062,7 @@ int cNopacityDefaultMenuItem::CheckScrollable(bool hasIcon) { break; } if (scrollable) { - pixmapTextScroller = osd->CreatePixmap(4, cRect(left + tabWidth[scrollCol], top + index * (height + left), tabWidth[scrollCol+numTabs], height), cRect(0, 0, colTextWidth+10, height)); + pixmapTextScroller = osd->CreatePixmap(4, cRect(left + tabWidth[scrollCol], top + index * (height + spaceMenu), tabWidth[scrollCol+numTabs], height), cRect(0, 0, colTextWidth+10, height)); pixmapTextScroller->Fill(clrTransparent); } return 0; @@ -19,6 +19,7 @@ protected: cFont *fontEPGWindow; int width, height; int top, left; + int spaceMenu; int textLeft; int index; cString *itemTabs; @@ -39,7 +40,7 @@ public: void CreatePixmap(); void CreatePixmapIcon(void); virtual void CreatePixmapTextScroller(int totalWidth); - void SetGeometry(int index, int top, int left, int width, int height); + void SetGeometry(int index, int top, int left, int width, int height, int spaceMenu); void SetFont(cFont *font) {this->font = font;} void SetFontSmall(cFont *fontSmall) {this->fontSmall = fontSmall;} void SetFontEPGWindow(cFont *font) {this->fontEPGWindow = font;} diff --git a/po/de_DE.po b/po/de_DE.po index 3111bef..4f96357 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-02-26 17:20+0100\n" +"POT-Creation-Date: 2013-02-27 16:55+0100\n" "PO-Revision-Date: 2012-11-11 17:49+0200\n" "Last-Translator: louis\n" "Language-Team: \n" @@ -83,6 +83,12 @@ msgstr "Audio Spuren" msgid "Messages" msgstr "Nachrichten" +msgid "right" +msgstr "rechts" + +msgid "left" +msgstr "links" + msgid "never" msgstr "nie" @@ -107,6 +113,9 @@ msgstr "schnell" msgid "Number of Default Menu Entries per Page" msgstr "Anzahl der Default-Menüelemente pro Seite" +msgid "Adjustment of narrow menus" +msgstr "Ausrichtung der schmalen Menüs" + msgid "Use narrow main menu" msgstr "Schmales Hauptmenü verwenden" @@ -98,6 +98,7 @@ void cNopacitySetup::Store(void) { SetupStore("volumeHeight", config.volumeHeight); SetupStore("volumeBorderBottom", config.volumeBorderBottom); SetupStore("fontVolume", config.fontVolume); + SetupStore("menuAdjustLeft", config.menuAdjustLeft); SetupStore("scalePicture", config.scalePicture); SetupStore("roundedCorners", config.roundedCorners); SetupStore("cornerRadius", config.cornerRadius); @@ -204,6 +205,8 @@ eOSState cMenuSetupSubMenu::ProcessKey(eKeys Key) { //-----MenuDisplay Common Settings ------------------------------------------------------------------------------------------------------------- cNopacitySetupMenuDisplay::cNopacitySetupMenuDisplay(cNopacityConfig* data) : cMenuSetupSubMenu(tr("VDR Menu: Common Settings"), data) { + adjustLeft[0] = tr("right"); + adjustLeft[1] = tr("left"); useSubtitleRerunTexts[0] = tr("never"); useSubtitleRerunTexts[1] = tr("if exists"); useSubtitleRerunTexts[2] = tr("always"); @@ -218,6 +221,7 @@ void cNopacitySetupMenuDisplay::Set(void) { int currentItem = Current(); Clear(); Add(new cMenuEditIntItem(tr("Number of Default Menu Entries per Page"), &tmpNopacityConfig->numDefaultMenuItems, 10, 40)); + Add(new cMenuEditStraItem(tr("Adjustment of narrow menus"), &tmpNopacityConfig->menuAdjustLeft, 2, adjustLeft)); Add(new cMenuEditBoolItem(tr("Use narrow main menu"), &tmpNopacityConfig->narrowMainMenu)); Add(new cMenuEditBoolItem(tr("Use narrow schedules menu"), &tmpNopacityConfig->narrowScheduleMenu)); Add(new cMenuEditBoolItem(tr("Use narrow channel menu"), &tmpNopacityConfig->narrowChannelMenu)); @@ -28,6 +28,7 @@ class cMenuSetupSubMenu : public cOsdMenu { class cNopacitySetupMenuDisplay : public cMenuSetupSubMenu { protected: + const char *adjustLeft[2]; const char *useSubtitleRerunTexts[3]; const char *scrollSpeed[4]; void Set(void); |