| 20 | using namespace dpfservice; |
| 21 | |
| 22 | ArrowHeaderLine::ArrowHeaderLine(QWidget *parent) |
| 23 | : QWidget(parent) |
| 24 | { |
| 25 | QHBoxLayout *mainLayout = new QHBoxLayout(this); |
| 26 | mainLayout->setContentsMargins(10, 0, 10, 0); |
| 27 | mainLayout->setSpacing(0); |
| 28 | |
| 29 | DLabel *iconLabel = new DLabel(this); |
| 30 | iconLabel->setPixmap(QIcon::fromTheme("uc_session").pixmap({ 20, 20 })); |
| 31 | arrowButton = new DToolButton(this); |
| 32 | arrowButton->setIcon(DStyle::standardIcon(style(), DStyle::SP_ReduceElement)); |
| 33 | arrowButton->setIconSize({ 12, 12 }); |
| 34 | arrowButton->setFixedSize(24, 24); |
| 35 | titleLabel = new DLabel(this); |
| 36 | titleLabel->installEventFilter(this); |
| 37 | titleLabel->setCursor(Qt::PointingHandCursor); |
| 38 | titleLabel->setTextFormat(Qt::PlainText); |
| 39 | DFontSizeManager::instance()->bind(titleLabel, DFontSizeManager::T5, QFont::Medium); |
| 40 | |
| 41 | connect(arrowButton, &DToolButton::clicked, this, &ArrowHeaderLine::expandChanged); |
| 42 | mainLayout->addWidget(iconLabel); |
| 43 | mainLayout->addSpacing(10); |
| 44 | mainLayout->addWidget(titleLabel, 1); |
| 45 | mainLayout->addWidget(arrowButton); |
| 46 | setFixedHeight(40); |
| 47 | setExpand(false); |
| 48 | } |
| 49 | |
| 50 | void ArrowHeaderLine::setExpand(bool value) |
| 51 | { |