diff --git a/mainwindow.cpp b/mainwindow.cpp index 5f457e8..3dcf4aa 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -350,6 +350,12 @@ MainWindow::MainWindow(QWidget *parent) this->opt.background = col; this->ui->graphicsView->redraw(); }); + connect(this->ui->button_selection_color, &QPushButton::clicked, [=]() { + QColor col = QColorDialog::getColor(opt.selection_color, 0, "Selection Color"); + if (col.isValid()) + this->opt.selection_color = col; + this->ui->graphicsView->redraw(); + }); } MainWindow::~MainWindow() @@ -826,3 +832,4 @@ void MainWindow::on_actionRotate_triggered() dialog->show(); connect(dialog, &RotationDialog::finished, [=]() { this->ui->graphicsView->redraw(); }); } + diff --git a/mainwindow.ui b/mainwindow.ui index c664fac..ac750c9 100644 --- a/mainwindow.ui +++ b/mainwindow.ui @@ -524,24 +524,21 @@ - - + + - + 0 0 - - 100 - - - 30 + + Horizontal Spacing: - - + + 0 @@ -549,28 +546,29 @@ - Show Sprites per Line + Vertical Spacing: - - - - - 0 - 0 - - - - 100 + + + + 1 - 30 + 4 - - + + + + Choose Color + + + + + 0 @@ -578,7 +576,7 @@ - Horizontal Spacing: + Show Sprites per Line @@ -595,13 +593,35 @@ - - - - 1 + + + + + 0 + 0 + + + + 100 - 4 + 30 + + + + + + + + 0 + 0 + + + + 100 + + + 30 @@ -618,15 +638,8 @@ - - - - Choose Color - - - - - + + 0 @@ -634,7 +647,14 @@ - Vertical Spacing: + Selection Color: + + + + + + + Choose Color @@ -675,7 +695,7 @@ 0 0 609 - 786 + 814 @@ -706,7 +726,7 @@ 0 0 1026 - 30 + 18 diff --git a/sprite.cpp b/sprite.cpp index b893f8d..6fa6115 100644 --- a/sprite.cpp +++ b/sprite.cpp @@ -135,8 +135,8 @@ void Sprite::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QW if (id >= opt->selection_from && id <= opt->selection_to) { QPen pen; - pen.setWidth(2); - pen.setColor(Qt::green); + pen.setWidth(5); + pen.setColor(opt->selection_color); painter->setPen(pen); painter->setOpacity(1); painter->drawRect(this->boundingRect()); diff --git a/sprite.h b/sprite.h index f11f4af..4945033 100644 --- a/sprite.h +++ b/sprite.h @@ -44,6 +44,7 @@ struct options { QList undoDB; QColor background = QColor(0xd9,0xd6,0xc8); + QColor selection_color = QColor(0x00,0xff,0x00); QStringList col_names = {"Black","White","Red","Cyan","Purple","Green","Blue","Yellow","Orange","Brown", "Pink", "Dark Grey", "Grey","Light Green","Light Blue","Light Grey"}; QList col_list = { QColor(0,0,0),