mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-31 17:31:11 +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.
Origin commit data
------------------
Commit: 23c708b787
Author: Thilo Graf <dbt@novatux.de>
Date: 2014-10-05 (Sun, 05 Oct 2014)
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