Add mini buttons to set rotation degrees

master
Jeremy Hu 2019-10-19 12:38:59 +09:30
parent dd371387a4
commit b7cb4ed18a
2 changed files with 19 additions and 1 deletions

View File

@ -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);

View File

@ -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"));