From 9ea66c00664422f569d03034489e37db6d787bf3 Mon Sep 17 00:00:00 2001 From: Clayton Salem Date: Sat, 13 Nov 2021 12:50:19 -0500 Subject: [PATCH 1/2] Allows color form elements to wrap, sets minimum width to thickness slider. --- src/widgets/panel/sidepanelwidget.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/widgets/panel/sidepanelwidget.cpp b/src/widgets/panel/sidepanelwidget.cpp index eb1ced78a7..67c7e3f8be 100644 --- a/src/widgets/panel/sidepanelwidget.cpp +++ b/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(100); m_colorLabel = new QLabel(); m_colorLabel->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); colorForm->addRow(tr("Active tool size:"), m_toolSizeSlider); From 7b59c7fc0f442d24260b3dcea36d0c738ae4534e Mon Sep 17 00:00:00 2001 From: Clayton Salem Date: Mon, 15 Nov 2021 09:35:43 -0500 Subject: [PATCH 2/2] Uses named constant variable for slider width --- src/widgets/panel/sidepanelwidget.cpp | 2 +- src/widgets/panel/sidepanelwidget.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/widgets/panel/sidepanelwidget.cpp b/src/widgets/panel/sidepanelwidget.cpp index 67c7e3f8be..22ab0b2126 100644 --- a/src/widgets/panel/sidepanelwidget.cpp +++ b/src/widgets/panel/sidepanelwidget.cpp @@ -35,7 +35,7 @@ SidePanelWidget::SidePanelWidget(QPixmap* p, QWidget* parent) m_toolSizeSlider = new QSlider(Qt::Horizontal); m_toolSizeSlider->setRange(1, maxToolSize); m_toolSizeSlider->setValue(m_toolSize); - m_toolSizeSlider->setMinimumWidth(100); + m_toolSizeSlider->setMinimumWidth(minSliderWidth); m_colorLabel = new QLabel(); m_colorLabel->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); colorForm->addRow(tr("Active tool size:"), m_toolSizeSlider); diff --git a/src/widgets/panel/sidepanelwidget.h b/src/widgets/panel/sidepanelwidget.h index 76a6b5de13..98c9ff7532 100644 --- a/src/widgets/panel/sidepanelwidget.h +++ b/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 {