From b7cb4ed18a2a2b0e084cc5f032b11dd0c350f3a3 Mon Sep 17 00:00:00 2001 From: Jeremy Hu Date: Sat, 19 Oct 2019 12:38:59 +0930 Subject: [PATCH] Add mini buttons to set rotation degrees --- src/floatnumberwidget.cpp | 2 +- src/partwidget.cpp | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/src/floatnumberwidget.cpp b/src/floatnumberwidget.cpp index 584ba761..0988fdde 100644 --- a/src/floatnumberwidget.cpp +++ b/src/floatnumberwidget.cpp @@ -9,7 +9,7 @@ FloatNumberWidget::FloatNumberWidget(QWidget *parent, bool singleLine) : { m_slider = new QSlider(Qt::Horizontal, this); m_slider->setRange(0, 100); - m_slider->setFixedWidth(120); + m_slider->setFixedWidth(240); m_label = new QLabel(this); m_label->setAlignment(Qt::AlignLeft); diff --git a/src/partwidget.cpp b/src/partwidget.cpp index cd8a9e2c..7432402c 100644 --- a/src/partwidget.cpp +++ b/src/partwidget.cpp @@ -462,9 +462,27 @@ void PartWidget::showCutRotationSettingPopup(const QPoint &pos) emit groupOperationAdded(); }); + QPushButton *rotationMinus5Button = new QPushButton(QChar(fa::rotateleft)); + initToolButton(rotationMinus5Button); + + connect(rotationMinus5Button, &QPushButton::clicked, [=]() { + rotationWidget->setValue(-0.5); + emit groupOperationAdded(); + }); + + QPushButton *rotation5Button = new QPushButton(QChar(fa::rotateright)); + initToolButton(rotation5Button); + + connect(rotation5Button, &QPushButton::clicked, [=]() { + rotationWidget->setValue(0.5); + emit groupOperationAdded(); + }); + QHBoxLayout *rotationLayout = new QHBoxLayout; rotationLayout->addWidget(rotationEraser); rotationLayout->addWidget(rotationWidget); + rotationLayout->addWidget(rotationMinus5Button); + rotationLayout->addWidget(rotation5Button); FloatNumberWidget *hollowThicknessWidget = new FloatNumberWidget; hollowThicknessWidget->setItemName(tr("Hollow"));