Allows color form elements to wrap, sets minimum width to thickness s… (#2068)

* Allows color form elements to wrap, sets minimum width to thickness slider.

* Uses named constant variable for slider width
This commit is contained in:
Clayton
2021-11-15 12:40:14 -05:00
committed by GitHub
parent 58e37b092c
commit f25d58b6db
2 changed files with 3 additions and 0 deletions

View File

@@ -31,9 +31,11 @@ SidePanelWidget::SidePanelWidget(QPixmap* p, QWidget* parent)
}
QFormLayout* colorForm = new QFormLayout();
colorForm->setRowWrapPolicy(QFormLayout::WrapLongRows);
m_toolSizeSlider = new QSlider(Qt::Horizontal);
m_toolSizeSlider->setRange(1, maxToolSize);
m_toolSizeSlider->setValue(m_toolSize);
m_toolSizeSlider->setMinimumWidth(minSliderWidth);
m_colorLabel = new QLabel();
m_colorLabel->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
colorForm->addRow(tr("Active tool size:"), m_toolSizeSlider);

View File

@@ -15,6 +15,7 @@ class QColorPickingEventFilter;
class QSlider;
constexpr int maxToolSize = 50;
constexpr int minSliderWidth = 100;
class SidePanelWidget : public QWidget
{