diff options
author | kamel5 <vdr.kamel5 (at) gmx (dot) net> | 2022-06-06 15:28:20 +0200 |
---|---|---|
committer | kamel5 <vdr.kamel5 (at) gmx (dot) net> | 2022-06-09 13:46:58 +0200 |
commit | 1990be25d8adb1e0630307d46729db90154ac323 (patch) | |
tree | 496493cb0800443ed3604d7bd58d19a816317410 | |
parent | d00bbd3cdd6b4b93ba723feb5cc8ca10c13c57d9 (diff) | |
download | skin-nopacity-1990be25d8adb1e0630307d46729db90154ac323.tar.gz skin-nopacity-1990be25d8adb1e0630307d46729db90154ac323.tar.bz2 |
Moves various variables into the Geomanager to reuse it later
-rw-r--r-- | displaychannelview.c | 30 | ||||
-rw-r--r-- | displayreplay.c | 9 | ||||
-rw-r--r-- | geometrymanager.c | 29 | ||||
-rw-r--r-- | geometrymanager.h | 7 |
4 files changed, 39 insertions, 36 deletions
diff --git a/displaychannelview.c b/displaychannelview.c index 9f20953..52bda78 100644 --- a/displaychannelview.c +++ b/displaychannelview.c @@ -12,8 +12,8 @@ cNopacityDisplayChannelView::cNopacityDisplayChannelView(cOsd *osd) { this->osd = osd; lastDate = ""; isRadioChannel = false; - statusIconBorder = 5; - statusIconSize = geoManager->channelFooterHeight - 2 * statusIconBorder; + statusIconBorder = geoManager->channelStatusIconBorder; + statusIconSize = geoManager->channelStatusIconSize; signalWidth = 0; signalHeight = 0; signalX = 0; @@ -113,39 +113,28 @@ void cNopacityDisplayChannelView::CreatePixmaps(void) { geoManager->channelContentWidth, geoManager->channelEpgInfoHeight) ); - int statusIconsWidth = 8 * statusIconSize + 6 * statusIconBorder; - int statusIconX = geoManager->channelX - + geoManager->channelWidth - - statusIconsWidth - - 3*statusIconBorder; - if (config.GetValue("logoPosition") == lpRight) - statusIconX -= geoManager->channelLogoWidthTotal; - pixmapStatusIcons = osd->CreatePixmap(3, - cRect(statusIconX, + cRect(geoManager->channelStatusIconX, geoManager->channelTop + geoManager->channelHeaderHeight + geoManager->channelProgressBarHeight + geoManager->channelEpgInfoHeight, - statusIconsWidth, + geoManager->channelStatusIconsWidth, geoManager->channelFooterHeight) ); pixmapStatusIconsBackground = osd->CreatePixmap(2, - cRect(statusIconX - 2*statusIconBorder, + cRect(geoManager->channelStatusIconX - 2 * statusIconBorder, geoManager->channelTop + geoManager->channelHeaderHeight + geoManager->channelProgressBarHeight + geoManager->channelEpgInfoHeight + 1, - statusIconsWidth + 3*statusIconBorder, + geoManager->channelStatusIconsWidth + 3 * geoManager->channelStatusIconBorder, geoManager->channelFooterHeight - 2) ); - int sourceInfoX = geoManager->channelX + geoManager->channelContentX + 10; - if (config.GetValue("displaySignalStrength")) - sourceInfoX +=geoManager->channelWidth * 0.2; pixmapSourceInfo = osd->CreatePixmap(2, - cRect(sourceInfoX, + cRect(geoManager->channelSourceInfoX, geoManager->channelTop + geoManager->channelHeaderHeight + geoManager->channelProgressBarHeight + geoManager->channelEpgInfoHeight, - statusIconX - sourceInfoX, + geoManager->channelStatusIconX - geoManager->channelSourceInfoX, geoManager->channelFooterHeight) ); @@ -790,8 +779,7 @@ void cNopacityDisplayChannelView::DrawVolume(void) { volumeBox->SetVolume(volume, MAXVOLUME, volume ? false : true); lastVolumeTime = time(NULL); lastVolume = volume; - } - else { + } else { if (volumeBox && (time(NULL) - lastVolumeTime > 2)) DELETENULL(volumeBox); } diff --git a/displayreplay.c b/displayreplay.c index 8baa897..40e278f 100644 --- a/displayreplay.c +++ b/displayreplay.c @@ -55,14 +55,7 @@ cNopacityDisplayReplay::~cNopacityDisplayReplay() { } void cNopacityDisplayReplay::createOSD(void) { - int top = geoManager->osdTop - + geoManager->osdHeight - - geoManager->replayHeight - - config.GetValue("replayBorderBottom"); - osd = CreateOsd(geoManager->osdLeft + config.GetValue("replayBorderVertical"), - top, - geoManager->replayWidth, - geoManager->replayHeight); + osd = CreateOsd(geoManager->replayOsdLeft, geoManager->replayOsdTop, geoManager->replayWidth, geoManager->replayHeight); } void cNopacityDisplayReplay::CreatePixmaps(void) { diff --git a/geometrymanager.c b/geometrymanager.c index e8a3361..91c8459 100644 --- a/geometrymanager.c +++ b/geometrymanager.c @@ -155,16 +155,24 @@ void cGeometryManager::SetGeometry(void) { break; } + channelStatusIconBorder = 5; + channelStatusIconSize = channelFooterHeight - 2 * channelStatusIconBorder; + channelStatusIconsWidth = 8 * channelStatusIconSize + 6 * channelStatusIconBorder; + channelStatusIconX = channelX + channelWidth - channelStatusIconsWidth - 3 * channelStatusIconBorder; + channelSourceInfoX = channelX + 10; + switch (config.GetValue("logoPosition")) { case lpLeft: channelContentX = channelLogoWidthTotal; channelContentWidth = channelWidth - channelLogoWidthTotal; + channelSourceInfoX += channelContentX; break; case lpRight: channelContentX = 0; channelContentWidth = channelWidth - channelLogoWidthTotal; channelLogoX = channelContentWidth + (channelLogoWidthTotal - channelLogoWidth) / 2; channelLogoBgX = channelContentWidth + (channelLogoWidthTotal - channelLogoBgWidth) / 2; + channelStatusIconX -= channelLogoWidthTotal; break; case lpNone: channelContentX = 0; @@ -172,6 +180,9 @@ void cGeometryManager::SetGeometry(void) { break; } + if (config.GetValue("displaySignalStrength")) + channelSourceInfoX += channelWidth * 0.2; + channelChannelNameWidth = channelContentWidth * 70 / 100; channelDateWidth = channelContentWidth - channelChannelNameWidth; channelProgressBarHeight = channelHeight * 0.1; @@ -180,18 +191,22 @@ void cGeometryManager::SetGeometry(void) { channelFooterY = channelTop + channelHeaderHeight + channelContentHeight; // DisplayReplay Sizes - replayHeight = osdHeight * config.GetValue("replayHeight") / 100; - replayWidth = osdWidth - 2 * config.GetValue("replayBorderVertical"); + replayOsdHeight = osdHeight * config.GetValue("replayHeight") / 100; + replayOsdWidth = osdWidth - 2 * config.GetValue("replayBorderVertical"); + replayOsdTop = osdTop + osdHeight - replayOsdHeight - config.GetValue("replayBorderBottom"); + replayOsdLeft = osdLeft + config.GetValue("replayBorderVertical"), + replayWidth = replayOsdWidth; + replayHeight = replayOsdHeight; replayHeaderHeight = replayHeight * 0.2; - if (replayHeaderHeight%2 != 0) + if (replayHeaderHeight % 2 != 0) replayHeaderHeight++; replayFooterHeight = replayHeaderHeight; replayResolutionSize = replayHeaderHeight - 10; - replayResolutionX = replayWidth - replayResolutionSize*3 - replayHeaderHeight/2; + replayResolutionX = replayWidth - replayResolutionSize * 3 - replayHeaderHeight / 2; replayResolutionY = replayHeight - replayFooterHeight; replayInfo2Height = replayHeaderHeight; replayProgressBarHeight = 0.1 * replayHeight; - if (replayProgressBarHeight%2 != 0) + if (replayProgressBarHeight % 2 != 0) replayProgressBarHeight++; replayCurrentHeight = replayProgressBarHeight + config.GetValue("fontReplay"); replayControlsHeight = replayHeight - replayHeaderHeight - replayInfo2Height - replayFooterHeight - replayProgressBarHeight; @@ -222,9 +237,9 @@ void cGeometryManager::SetGeometry(void) { // DisplayVolume Sizes volumeWidth = osdWidth * config.GetValue("volumeWidth") / 100; volumeHeight = osdHeight * config.GetValue("volumeHeight") / 100; - volumeLabelHeight = volumeHeight/3; + volumeLabelHeight = volumeHeight / 3; volumeProgressBarWidth = 0.9 * volumeWidth; volumeProgressBarHeight = 0.3 * volumeHeight; - if (volumeProgressBarHeight%2 != 0) + if (volumeProgressBarHeight % 2 != 0) volumeProgressBarHeight++; } diff --git a/geometrymanager.h b/geometrymanager.h index bdf7b49..a8ce169 100644 --- a/geometrymanager.h +++ b/geometrymanager.h @@ -76,7 +76,14 @@ class cGeometryManager { int channelProgressBarHeight; int channelEpgInfoHeight; int channelEpgInfoLineHeight; + int channelStatusIconBorder; + int channelStatusIconSize; + int channelStatusIconsWidth; + int channelStatusIconX; + int channelSourceInfoX; //DisplayReplay Sizes + int replayOsdLeft, replayOsdTop; + int replayOsdWidth, replayOsdHeight; int replayWidth; int replayHeight; int replayHeaderHeight; |