You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
998 B
37 lines
998 B
#include "controls.hpp"
|
|
|
|
QFrame *horizontal_line(QWidget *parent) {
|
|
QFrame *line = new QFrame(parent);
|
|
line->setFrameShape(QFrame::StyledPanel);
|
|
line->setStyleSheet(R"(
|
|
margin-left: 40px;
|
|
margin-right: 40px;
|
|
border-width: 1px;
|
|
border-bottom-style: solid;
|
|
border-color: gray;
|
|
)");
|
|
line->setFixedHeight(2);
|
|
return line;
|
|
}
|
|
|
|
AbstractControl::AbstractControl(const QString &title, const QString &desc, const QString &icon) : QFrame() {
|
|
hlayout = new QHBoxLayout;
|
|
hlayout->setMargin(0);
|
|
hlayout->setSpacing(50);
|
|
|
|
// left icon
|
|
if (!icon.isEmpty()) {
|
|
QPixmap pix(icon);
|
|
QLabel *icon = new QLabel();
|
|
icon->setPixmap(pix.scaledToWidth(80, Qt::SmoothTransformation));
|
|
icon->setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed));
|
|
hlayout->addWidget(icon);
|
|
}
|
|
|
|
// title
|
|
title_label = new QLabel(title);
|
|
title_label->setStyleSheet("font-size: 50px; font-weight: 400;");
|
|
hlayout->addWidget(title_label);
|
|
|
|
setLayout(hlayout);
|
|
}
|
|
|