Browse Source

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
Clayton 3 years ago
parent
commit
f25d58b6db
2 changed files with 3 additions and 0 deletions
  1. 2 0
      src/widgets/panel/sidepanelwidget.cpp
  2. 1 0
      src/widgets/panel/sidepanelwidget.h

+ 2 - 0
src/widgets/panel/sidepanelwidget.cpp

@@ -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);

+ 1 - 0
src/widgets/panel/sidepanelwidget.h

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