Save pen and brush settings
This commit is contained in:
parent
2f247db776
commit
c3f1c6bfaf
@ -6,6 +6,7 @@
|
|||||||
#include <QGraphicsPixmapItem>
|
#include <QGraphicsPixmapItem>
|
||||||
#include <QGraphicsView>
|
#include <QGraphicsView>
|
||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
|
#include <settings.hpp>
|
||||||
|
|
||||||
CropEditor::CropEditor(QPixmap *image, QObject *parent) : QObject(parent)
|
CropEditor::CropEditor(QPixmap *image, QObject *parent) : QObject(parent)
|
||||||
{
|
{
|
||||||
|
@ -11,9 +11,15 @@
|
|||||||
#include <cropeditor/drawing/lineitem.hpp>
|
#include <cropeditor/drawing/lineitem.hpp>
|
||||||
#include <cropeditor/drawing/pathitem.hpp>
|
#include <cropeditor/drawing/pathitem.hpp>
|
||||||
#include <cropeditor/settings/brushpenselection.hpp>
|
#include <cropeditor/settings/brushpenselection.hpp>
|
||||||
|
#include <settings.hpp>
|
||||||
|
|
||||||
CropScene::CropScene(QObject *parent, QPixmap *pixmap) : QGraphicsScene(parent), prevButtons(Qt::NoButton)
|
CropScene::CropScene(QObject *parent, QPixmap *pixmap) : QGraphicsScene(parent), prevButtons(Qt::NoButton)
|
||||||
{
|
{
|
||||||
|
pen().setColor(settings::settings().value("penColor", pen().color()).value<QColor>());
|
||||||
|
pen().setCosmetic(settings::settings().value("penCosmetic", pen().isCosmetic()).toBool());
|
||||||
|
pen().setWidthF(settings::settings().value("penWidth", pen().widthF()).toFloat());
|
||||||
|
brush().setColor(settings::settings().value("brushColor", brush().color()).value<QColor>());
|
||||||
|
|
||||||
_pixmap = pixmap;
|
_pixmap = pixmap;
|
||||||
QTimer::singleShot(0, [&] {
|
QTimer::singleShot(0, [&] {
|
||||||
QPolygonF poly;
|
QPolygonF poly;
|
||||||
|
@ -7,6 +7,7 @@
|
|||||||
#include <QInputDialog>
|
#include <QInputDialog>
|
||||||
#include <QSlider>
|
#include <QSlider>
|
||||||
#include <cropeditor/cropview.hpp>
|
#include <cropeditor/cropview.hpp>
|
||||||
|
#include <settings.hpp>
|
||||||
|
|
||||||
BrushPenSelection::BrushPenSelection(CropScene *scene) : QDialog(), ui(new Ui::BrushPenSelection)
|
BrushPenSelection::BrushPenSelection(CropScene *scene) : QDialog(), ui(new Ui::BrushPenSelection)
|
||||||
{
|
{
|
||||||
@ -40,6 +41,10 @@ void BrushPenSelection::on_buttonBox_accepted()
|
|||||||
scene->pen().setCosmetic(ui->cosmetic->isChecked());
|
scene->pen().setCosmetic(ui->cosmetic->isChecked());
|
||||||
scene->pen().setWidthF(ui->widthSpinner->value());
|
scene->pen().setWidthF(ui->widthSpinner->value());
|
||||||
scene->brush().setColor(brush);
|
scene->brush().setColor(brush);
|
||||||
|
settings::settings().setValue("penColor", scene->pen().color());
|
||||||
|
settings::settings().setValue("penCosmetic", scene->pen().isCosmetic());
|
||||||
|
settings::settings().setValue("penWidth", scene->pen().widthF());
|
||||||
|
settings::settings().setValue("brushColor", scene->brush().color());
|
||||||
close();
|
close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user