Brush maximum size to a custom setting

0.6.3
Nelsson Huotari 7 years ago
parent 17e01ca336
commit c2cddc91e4

@ -242,6 +242,8 @@ void CSMPrefs::State::declare()
addValues (landeditOutsideCell);
declareEnum ("outside-visible-landedit", "Handling land edit outside of visible cells", showAndLandEdit).
addValues (landeditOutsideVisibleCell);
declareInt ("texturebrush-maximumsize", "Maximum texture brush size", 50).
setMin (1);
declareCategory ("Key Bindings");

@ -21,7 +21,9 @@
#include <QSizePolicy>
#include "scenetool.hpp"
#include "../../model/doc/document.hpp"
#include "../../model/prefs/state.hpp"
#include "../../model/world/data.hpp"
#include "../../model/world/idtable.hpp"
#include "../../model/world/landtexture.hpp"
@ -33,11 +35,11 @@ CSVWidget::BrushSizeControls::BrushSizeControls(const QString &title, QWidget *p
mBrushSizeSlider = new QSlider(Qt::Horizontal);
mBrushSizeSlider->setTickPosition(QSlider::TicksBothSides);
mBrushSizeSlider->setTickInterval(10);
mBrushSizeSlider->setRange(1, 50);
mBrushSizeSlider->setRange(1, CSMPrefs::get()["3D Scene Editing"]["texturebrush-maximumsize"].toInt());
mBrushSizeSlider->setSingleStep(1);
mBrushSizeSpinBox = new QSpinBox;
mBrushSizeSpinBox->setRange(1, 50);
mBrushSizeSpinBox->setRange(1, CSMPrefs::get()["3D Scene Editing"]["texturebrush-maximumsize"].toInt());
mBrushSizeSpinBox->setSingleStep(1);
mLayoutSliderSize = new QHBoxLayout;
@ -273,6 +275,8 @@ void CSVWidget::SceneToolTextureBrush::clicked (const QModelIndex& index)
void CSVWidget::SceneToolTextureBrush::activate ()
{
QPoint position = QCursor::pos();
mTextureBrushWindow->mSizeSliders->mBrushSizeSlider->setRange(1, CSMPrefs::get()["3D Scene Editing"]["texturebrush-maximumsize"].toInt());
mTextureBrushWindow->mSizeSliders->mBrushSizeSpinBox->setRange(1, CSMPrefs::get()["3D Scene Editing"]["texturebrush-maximumsize"].toInt());
mTextureBrushWindow->move (position);
mTextureBrushWindow->show();
}

@ -30,9 +30,9 @@ namespace CSVWidget
public:
BrushSizeControls(const QString &title, QWidget *parent);
QSlider *mBrushSizeSlider;
QSpinBox *mBrushSizeSpinBox;
private:
QSpinBox *mBrushSizeSpinBox;
QHBoxLayout *mLayoutSliderSize;
};

Loading…
Cancel
Save