mirror of
https://github.com/YACReader/yacreader
synced 2025-07-21 14:34:42 -04:00
maquetado goToFlow
This commit is contained in:
@ -1178,13 +1178,23 @@ void PictureFlow::showNext()
|
||||
d->animator->target = qMin(center + 2, slideCount()-1);
|
||||
}
|
||||
|
||||
void PictureFlow::showSlide(int index)
|
||||
void PictureFlow::showSlide(unsigned int index)
|
||||
{
|
||||
index = qMax(index, 0);
|
||||
index = qMin(slideCount()-1, index);
|
||||
index = qMax<unsigned int>(index, 0);
|
||||
index = qMin<unsigned int>(slideCount()-1, index);
|
||||
if(index == d->state->centerSlide.slideIndex)
|
||||
return;
|
||||
|
||||
int distance = centerIndex()-index;
|
||||
|
||||
if(abs(distance)>10)
|
||||
{
|
||||
if(distance<0)
|
||||
setCenterIndex(centerIndex()+(-distance)-10);
|
||||
else
|
||||
setCenterIndex(centerIndex()-distance+10);
|
||||
}
|
||||
|
||||
d->animator->start(index);
|
||||
}
|
||||
|
||||
|
@ -166,7 +166,7 @@ public slots:
|
||||
/*!
|
||||
Go to specified slide using animation effect.
|
||||
*/
|
||||
void showSlide(int index);
|
||||
void showSlide(unsigned int index);
|
||||
|
||||
/*!
|
||||
Rerender the widget. Normally this function will be automatically invoked
|
||||
|
@ -884,7 +884,7 @@ void YACReaderFlowGL::clear()
|
||||
reset();
|
||||
}
|
||||
|
||||
void YACReaderFlowGL::setCenterIndex(int index)
|
||||
void YACReaderFlowGL::setCenterIndex(unsigned int index)
|
||||
{
|
||||
setCurrentIndex(index);
|
||||
}
|
||||
|
@ -253,7 +253,7 @@ public:
|
||||
void unmarkSlide(int index);
|
||||
void setSlideSize(QSize size);
|
||||
void clear();
|
||||
void setCenterIndex(int index);
|
||||
void setCenterIndex(unsigned int index);
|
||||
void showSlide(int index);
|
||||
int centerIndex();
|
||||
void updateMarks();
|
||||
|
Reference in New Issue
Block a user