Skip to content

Commit

Permalink
Allows color form elements to wrap, sets minimum width to thickness s… (
Browse files Browse the repository at this point in the history
#2068)

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

* Uses named constant variable for slider width
  • Loading branch information
claytron5000 authored Nov 15, 2021
1 parent 58e37b0 commit f25d58b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/widgets/panel/sidepanelwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
1 change: 1 addition & 0 deletions src/widgets/panel/sidepanelwidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ class QColorPickingEventFilter;
class QSlider;

constexpr int maxToolSize = 50;
constexpr int minSliderWidth = 100;

class SidePanelWidget : public QWidget
{
Expand Down

0 comments on commit f25d58b

Please sign in to comment.