diff --git a/src/config/visualseditor.cpp b/src/config/visualseditor.cpp index 6e702955e8..ee47ab8efe 100644 --- a/src/config/visualseditor.cpp +++ b/src/config/visualseditor.cpp @@ -22,6 +22,7 @@ #include "src/utils/confighandler.h" #include #include +#include #include VisualsEditor::VisualsEditor(QWidget* parent) @@ -70,6 +71,30 @@ VisualsEditor::initOpacitySlider() m_opacitySlider->setMapedValue(0, opacity, 255); } +void +VisualsEditor::initPinBorderEditor() +{ + QLabel* label = new QLabel(tr("Pin border width:")); + label->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); + + m_pinBorderWidthSpinBox = new QSpinBox(); + m_pinBorderWidthSpinBox->setRange(0, 20); + m_pinBorderWidthSpinBox->setSizePolicy(QSizePolicy::Fixed, + QSizePolicy::Fixed); + m_pinBorderWidthSpinBox->setValue(ConfigHandler().pinBorderWidthValue()); + connect(m_pinBorderWidthSpinBox, + QOverload::of(&QSpinBox::valueChanged), + this, + [](int val) { ConfigHandler().setPinBorderWidth(val); }); + + QHBoxLayout* localLayout = new QHBoxLayout(); + localLayout->addWidget(label); + localLayout->addWidget(m_pinBorderWidthSpinBox); + localLayout->addItem( + new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum)); + m_layout->addLayout(localLayout); +} + void VisualsEditor::saveOpacity() { @@ -85,6 +110,8 @@ VisualsEditor::initWidgets() initOpacitySlider(); + initPinBorderEditor(); + auto boxButtons = new QGroupBox(); boxButtons->setTitle(tr("Button Selection")); auto listLayout = new QVBoxLayout(boxButtons);