mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-30 17:01:15 +02:00
CComponentsForm: fix unnecessary try for scroll
This avoids unnecessary flicker effects, because no paint is required, if page count = 1 and also ensures, that this page is defined as current page.
This commit is contained in:
@@ -622,9 +622,14 @@ CComponentsItem* CComponentsForm::getSelectedItemObject()
|
|||||||
|
|
||||||
void CComponentsForm::ScrollPage(int direction, bool do_paint)
|
void CComponentsForm::ScrollPage(int direction, bool do_paint)
|
||||||
{
|
{
|
||||||
|
if (getPageCount() == 1){
|
||||||
|
cur_page = 0;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
OnBeforeScrollPage();
|
OnBeforeScrollPage();
|
||||||
|
|
||||||
int target_page_id = (int)getPageCount() - 1;
|
int target_page_id = (int)page_count - 1;
|
||||||
int target_page = (int)cur_page;
|
int target_page = (int)cur_page;
|
||||||
|
|
||||||
if (direction == SCROLL_P_DOWN)
|
if (direction == SCROLL_P_DOWN)
|
||||||
|
Reference in New Issue
Block a user