diff --git a/src/widgets/capture/capturewidget.cpp b/src/widgets/capture/capturewidget.cpp index d67f182f..1dd9db40 100644 --- a/src/widgets/capture/capturewidget.cpp +++ b/src/widgets/capture/capturewidget.cpp @@ -794,7 +794,7 @@ void CaptureWidget::moveSelection(QPoint p) void CaptureWidget::updateThickness(int thickness) { - m_context.thickness = qBound(1, thickness, 100); + m_context.thickness = qBound(1, thickness, maxDrawThickness); QPoint topLeft = QGuiAppCurrentScreen().currentScreen()->geometry().topLeft(); @@ -1290,7 +1290,7 @@ void CaptureWidget::removeToolObject(int index) void CaptureWidget::setDrawThickness(const int& t) { - m_context.thickness = qBound(1, t, 100); + m_context.thickness = qBound(1, t, maxDrawThickness); // save draw thickness for text and other tool separately if (m_activeButton) { if (m_activeButton->tool() && diff --git a/src/widgets/panel/sidepanelwidget.cpp b/src/widgets/panel/sidepanelwidget.cpp index 017b2c6f..cbd7d7d3 100644 --- a/src/widgets/panel/sidepanelwidget.cpp +++ b/src/widgets/panel/sidepanelwidget.cpp @@ -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); } diff --git a/src/widgets/panel/sidepanelwidget.h b/src/widgets/panel/sidepanelwidget.h index b8f00f51..c783b8dc 100644 --- a/src/widgets/panel/sidepanelwidget.h +++ b/src/widgets/panel/sidepanelwidget.h @@ -14,6 +14,8 @@ class ColorGrabWidget; class QColorPickingEventFilter; class QSlider; +constexpr int maxDrawThickness = 50; + class SidePanelWidget : public QWidget { Q_OBJECT