summaryrefslogtreecommitdiff
path: root/browserGrid.cpp
diff options
context:
space:
mode:
authorchriszero <zerov83@gmail.com>2015-07-10 20:41:12 +0200
committerchriszero <zerov83@gmail.com>2015-07-10 20:41:12 +0200
commit43d3acbfcc8fbabdc8ca10ac6594f69a82783ec3 (patch)
tree26b8397c150e152684076013ac60738bad2ef20a /browserGrid.cpp
parentc1220af84ad4586dc0ba8ae8d76d42c16084369c (diff)
downloadvdr-plugin-plex-43d3acbfcc8fbabdc8ca10ac6594f69a82783ec3.tar.gz
vdr-plugin-plex-43d3acbfcc8fbabdc8ca10ac6594f69a82783ec3.tar.bz2
Viewelement <scrollbar/> for all grids.
Diffstat (limited to 'browserGrid.cpp')
-rw-r--r--browserGrid.cpp24
1 files changed, 13 insertions, 11 deletions
diff --git a/browserGrid.cpp b/browserGrid.cpp
index 9a947e8..f9bb026 100644
--- a/browserGrid.cpp
+++ b/browserGrid.cpp
@@ -61,6 +61,7 @@ void cBrowserGrid::Flush()
cMutexLock MutexLock(&cPlexSdOsd::RedrawMutex);
m_pGrid->Display();
+ m_pScrollbar->Display();
m_pRootView->Display();
}
@@ -256,6 +257,7 @@ void cBrowserGrid::DrawGrid()
m_pHeader->Display();
DrawInfopane();
DrawFooter();
+ DrawScrollbar();
}
void cBrowserGrid::DrawBackground()
@@ -360,25 +362,25 @@ void cBrowserGrid::DrawFooter()
void cBrowserGrid::DrawScrollbar()
{
- /*
+
if (m_vElements.size() == 0)
return;
- int scrollBarHeight = (double)m_rows / (double)m_vElements.size() * 1000;
-
- // in welcher Zeile sind wir?
+
int currentRow = SelectedObject()->AbsolutePosition / m_columns;
+ int totalRows = m_vElements.size() / m_columns;
+
+ int scrollBarHeight = 100.0 / totalRows * m_rows;
- int offset = (double)startPos / (double)m_vElements.size() * 1000;
+ int offset = 100.0 / totalRows * currentRow;
+ if(offset >= 100 - scrollBarHeight) {
+ offset = 100.0 - scrollBarHeight;
+ }
m_pScrollbar->Clear();
m_pScrollbar->ClearTokens();
-
- int y = (100 - GetHeight())/2;
-
- m_pScrollbar->AddIntToken("posy", y);
- m_pScrollbar->AddIntToken("totalheight", menuHeight);
+
m_pScrollbar->AddIntToken("height", scrollBarHeight);
m_pScrollbar->AddIntToken("offset", offset);
- m_pScrollbar->Display();*/
+ m_pScrollbar->Display();
}
void cBrowserGrid::NextTab()