MCPcopy Create free account
hub / github.com/Codeya-IDE/deepin-ide / ArrowHeaderLine

Method ArrowHeaderLine

src/plugins/recent/mainframe/sessionitemwidget.cpp:22–48  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

20using namespace dpfservice;
21
22ArrowHeaderLine::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
50void ArrowHeaderLine::setExpand(bool value)
51{

Callers

nothing calls this directly

Calls 7

styleFunction · 0.85
connectFunction · 0.85
setFixedSizeMethod · 0.80
setCursorMethod · 0.80
setIconMethod · 0.45
bindMethod · 0.45
addWidgetMethod · 0.45

Tested by

no test coverage detected