22#include "preferencemanager.h"
24#include "ui_toolspage.h"
26ToolsPage::ToolsPage() : ui(new Ui::
ToolsPage)
31 connect(ui->rotationIncrementSlider, &
QSlider::valueChanged,
this, &ToolsPage::rotationIncrementChange);
35ToolsPage::~ToolsPage()
40void ToolsPage::updateValues()
42 ui->useQuickSizingBox->setChecked(mManager->isOn(SETTING::QUICK_SIZING));
43 ui->invertZoomDirectionBox->setChecked(mManager->isOn(SETTING::INVERT_DRAG_ZOOM_DIRECTION));
44 setRotationIncrement(mManager->getInt(SETTING::ROTATION_INCREMENT));
47void ToolsPage::quickSizingChange(
int b)
52void ToolsPage::invertZoomDirectionChange(
int b)
54 mManager->set(SETTING::INVERT_DRAG_ZOOM_DIRECTION, b !=
Qt::Unchecked);
57void ToolsPage::setRotationIncrement(
int angle)
59 int value = qSqrt((angle - 1) / 359.0) * 359;
60 ui->rotationIncrementSlider->setValue(value);
63void ToolsPage::rotationIncrementChange(
int value)
66 int angle = qPow(value / 359.0, 2) * 359 + 1;
68 while (360 % angle != 0) {
71 ui->rotationIncrementDisplay->setText(
tr(
"%1 degrees").arg(angle));
72 mManager->set(SETTING::ROTATION_INCREMENT, angle);
void valueChanged(int value)
void stateChanged(int state)
QString tr(const char *sourceText, const char *disambiguation, int n)