| 201 | } |
| 202 | |
| 203 | void SessionItemWidgetPrivate::initConnection() |
| 204 | { |
| 205 | connect(headerLine, &ArrowHeaderLine::expandChanged, this, [this] { |
| 206 | q->setExpand(!q->expand()); |
| 207 | }); |
| 208 | connect(boxWidget, &DVBoxWidget::sizeChanged, this, [this] { |
| 209 | if (expand) { |
| 210 | int endHeight = 0; |
| 211 | endHeight = boxWidget->height(); |
| 212 | |
| 213 | animation->setStartValue(contentLoader->height()); |
| 214 | animation->setEndValue(endHeight); |
| 215 | animation->stop(); |
| 216 | animation->start(); |
| 217 | } |
| 218 | }); |
| 219 | connect(animation, &QPropertyAnimation::valueChanged, this, [this] { |
| 220 | q->setFixedHeight(q->sizeHint().height()); |
| 221 | }); |
| 222 | connect(headerLine, &ArrowHeaderLine::itemClicked, this, &SessionItemWidgetPrivate::openSession); |
| 223 | connect(cloneBtn, &DIconButton::clicked, this, &SessionItemWidgetPrivate::cloneSession); |
| 224 | connect(renameBtn, &DIconButton::clicked, this, &SessionItemWidgetPrivate::renameSession); |
| 225 | connect(removeBtn, &DIconButton::clicked, this, &SessionItemWidgetPrivate::removeSession); |
| 226 | } |
| 227 | |
| 228 | QWidget *SessionItemWidgetPrivate::createContent() |
| 229 | { |