| 27 | } |
| 28 | |
| 29 | void ScrollAreaCustom::paintEvent(QPaintEvent *event){ |
| 30 | container->resize(this->width(), container->height()); |
| 31 | if(container->height() > this->height() && container->y() < this->height() - container->height() && curSpd == 0 && bounce->state() == QAbstractAnimation::Stopped) |
| 32 | container->move(container->x(), this->height() - container->height()); |
| 33 | if(container->height() <= this->height()){ |
| 34 | container->move(container->x(), 0); |
| 35 | indicator->hide(); |
| 36 | } |
| 37 | else{ |
| 38 | indicator->show(); |
| 39 | } |
| 40 | indicator->resize(indicator->width(), (int)((double)this->height() * this->height() / (double)container->height())); |
| 41 | indicator->move(this->width() - indicator->width() - 3, -container->y() * this->height() / container->height()); |
| 42 | } |
| 43 | |
| 44 | void ScrollAreaCustom::mousePressEvent(QMouseEvent *event){ |
| 45 | if(container->height() > this->height()){ |