Reduce max thickness (#1940)

The thickness slider is fairly small, so it's difficult to make small
adjustments. The max value of the thickness slider is currently 100, which
is actually pretty huge.

Since most common use cases involve smaller pixel values (closer to the
0-10 range, I suspect), reduce the maximum slider value to 25, allowing for
easier fine grained control of the drawing thickness.

Although fine grained control is already possible via the scroll wheel,
this change improves the overall usability of the tool, especially for new
users who many not know that thickness can be adjusted with the scroll
wheel (or for users who don't have a scroll wheel).
This commit is contained in:
Mitchel Humpherys
2021-10-06 17:50:54 -07:00
committed by GitHub
parent 0b777c4558
commit c2ea8b6f61
3 changed files with 6 additions and 4 deletions

View File

@@ -32,7 +32,7 @@ SidePanelWidget::SidePanelWidget(QPixmap* p, QWidget* parent)
QFormLayout* colorForm = new QFormLayout();
m_thicknessSlider = new QSlider(Qt::Horizontal);
m_thicknessSlider->setRange(1, 100);
m_thicknessSlider->setRange(1, maxDrawThickness);
m_thicknessSlider->setValue(m_thickness);
m_colorLabel = new QLabel();
m_colorLabel->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
@@ -105,7 +105,7 @@ void SidePanelWidget::updateColorNoWheel(const QColor& c)
void SidePanelWidget::updateThickness(const int& t)
{
m_thickness = qBound(0, t, 100);
m_thickness = qBound(0, t, maxDrawThickness);
m_thicknessSlider->setValue(m_thickness);
}