| 17 | { |
| 18 | |
| 19 | AppMenuItem::AppMenuItem(const QString& name, int idx, const QString& icon, QWidget* parent) : QWidget(parent) { |
| 20 | name_ = name; |
| 21 | idx_ = idx; |
| 22 | |
| 23 | auto inner_layout = new QHBoxLayout(); |
| 24 | inner_layout->setSpacing(0); |
| 25 | inner_layout->setContentsMargins(0,0,0,0); |
| 26 | icon_ = new QLabel(this); |
| 27 | icon_->setFixedSize(QSize(20, 20)); |
| 28 | icon_->setStyleSheet(std::format("background-image: url({});", icon.toStdString()).c_str()); |
| 29 | text_ = new QLabel(this); |
| 30 | text_->setText(name); |
| 31 | text_->setStyleSheet("color:#FFFFFF;font-weight:bold;"); |
| 32 | |
| 33 | inner_layout->addSpacing(18); |
| 34 | inner_layout->addWidget(icon_); |
| 35 | inner_layout->addSpacing(10); |
| 36 | inner_layout->addWidget(text_); |
| 37 | |
| 38 | inner_layout->addStretch(); |
| 39 | |
| 40 | setLayout(inner_layout); |
| 41 | } |
| 42 | |
| 43 | AppMenuItem::~AppMenuItem() { |
| 44 |
nothing calls this directly
no outgoing calls
no test coverage detected