MCPcopy Create free account
hub / github.com/dannagle/PacketSender / themePanelButton

Method themePanelButton

src/panelgenerator.cpp:369–399  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

367}
368
369void PanelGenerator::themePanelButton(QPushButton *button)
370{
371
372 // TODO: make this font resize based on window size.
373
374 int id = QFontDatabase::addApplicationFont("://OpenSans-Regular.ttf");
375 QString family = QFontDatabase::applicationFontFamilies(id).at(0);
376 QFont opensans(family);
377
378 auto label = new QLabel(button->text(),button);
379 button->setText("");
380 label->setWordWrap(true);
381 auto layout = new QHBoxLayout(button);
382
383 label->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
384 button->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
385 label->setFont(opensans);
386
387 label->setAutoFillBackground(true);
388 if(PanelGenerator::darkMode) {
389 label->setStyleSheet("QLabel { font-size: 20pt; color: white; background-color: transparent;} QLabel::hover { color: #BC810C; } ");
390 } else {
391 label->setStyleSheet("QLabel { font-size: 20pt; color: black; background-color: transparent;} QLabel::hover { color: #BC810C; } ");
392 }
393 label->setCursor(Qt::PointingHandCursor);
394 button->setCursor(Qt::PointingHandCursor);
395 button->update();
396 label->update();
397 layout->addWidget(label,0,Qt::AlignCenter);
398
399}
400
401
402void PanelGenerator::renderEditMode(bool last /* = false */)

Callers

nothing calls this directly

Calls 1

setTextMethod · 0.80

Tested by

no test coverage detected