From 8d9573ad15a5435f7e4b13f2b32e628c06d90ea3 Mon Sep 17 00:00:00 2001 From: staphen Date: Sat, 14 Sep 2024 19:04:58 -0400 Subject: [PATCH] Use current color as initial color in color dialogs --- source/dialogs/importdialog.cpp | 2 +- source/dialogs/settingsdialog.cpp | 6 ++++-- source/widgets/palettewidget.cpp | 6 ++++-- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/source/dialogs/importdialog.cpp b/source/dialogs/importdialog.cpp index aff6d3a5..907f5566 100644 --- a/source/dialogs/importdialog.cpp +++ b/source/dialogs/importdialog.cpp @@ -84,7 +84,7 @@ void ImportDialog::on_fontSymbolsEdit_textChanged(const QString &text) void ImportDialog::on_fontColorButton_clicked() { - QColor color = QColorDialog::getColor(); + QColor color = QColorDialog::getColor(this->renderColor); if (color.isValid()) setRenderColor(color); diff --git a/source/dialogs/settingsdialog.cpp b/source/dialogs/settingsdialog.cpp index 6a5c6772..e0a6ca64 100644 --- a/source/dialogs/settingsdialog.cpp +++ b/source/dialogs/settingsdialog.cpp @@ -29,7 +29,8 @@ void SettingsDialog::initialize() void SettingsDialog::on_defaultPaletteColorPushButton_clicked() { - QColor color = QColorDialog::getColor(); + QColor color = QColor(ui->defaultPaletteColorLineEdit->text()); + color = QColorDialog::getColor(color); if (color.isValid()) this->ui->defaultPaletteColorLineEdit->setText(color.name()); @@ -37,7 +38,8 @@ void SettingsDialog::on_defaultPaletteColorPushButton_clicked() void SettingsDialog::on_paletteSelectionBorderColorPushButton_clicked() { - QColor color = QColorDialog::getColor(); + QColor color = QColor(ui->paletteSelectionBorderColorLineEdit->text()); + color = QColorDialog::getColor(color); if (color.isValid()) this->ui->paletteSelectionBorderColorLineEdit->setText(color.name()); diff --git a/source/widgets/palettewidget.cpp b/source/widgets/palettewidget.cpp index 1b243f97..24154d6b 100644 --- a/source/widgets/palettewidget.cpp +++ b/source/widgets/palettewidget.cpp @@ -861,7 +861,8 @@ void PaletteWidget::on_colorLineEdit_returnPressed() void PaletteWidget::on_colorPickPushButton_clicked() { - QColor color = QColorDialog::getColor(); + QColor color = this->pal->getColor(this->selectedFirstColorIndex); + color = QColorDialog::getColor(color); if (!color.isValid()) return; @@ -869,7 +870,8 @@ void PaletteWidget::on_colorPickPushButton_clicked() if (this->selectedFirstColorIndex == this->selectedLastColorIndex) { colorEnd = color; } else { - colorEnd = QColorDialog::getColor(); + colorEnd = this->pal->getColor(this->selectedLastColorIndex); + colorEnd = QColorDialog::getColor(colorEnd); if (!colorEnd.isValid()) return; }