mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-10-14 09:14:14 +02:00
Always use Qt's own colour dialog
On GTK desktops (Mint, XFCE, GNOME) Qt hands QColorDialog to GTK's chooser. Its "Custom" row is a recent-colours list kept by GTK: every colour picked is pushed in on the left and the oldest drops out, so a user's saved wire colours are lost (forum topic 3190). It also ignores the custom colours QET saves (#918) and has no swatch grid for the double-click to accept (#1172). Pass DontUseNativeDialog at every colour dialog, so all platforms get the dialog Windows already shows: 16 custom slots that change only on "Add to Custom Colors", saved across restarts. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -220,6 +220,7 @@ void ConductorColorToolButton::chooseOtherColor()
|
||||
{
|
||||
QColorDialog dialog(m_current, this);
|
||||
dialog.setWindowTitle(tr("Choisir une couleur de conducteur"));
|
||||
dialog.setOption(QColorDialog::DontUseNativeDialog);
|
||||
ColorDialogDoubleClick::install(&dialog);
|
||||
if (dialog.exec() == QDialog::Accepted && dialog.selectedColor().isValid()) {
|
||||
applyColor(dialog.selectedColor());
|
||||
|
||||
@@ -96,7 +96,8 @@ void GuidesPropertiesWidget::addGuide() {
|
||||
colorBtn->setStyleSheet(QString("background-color: %1; color: white; font-weight: bold;").arg(defaultColor.name()));
|
||||
|
||||
connect(colorBtn, &QPushButton::clicked, [this, colorBtn]() {
|
||||
QColor c = QColorDialog::getColor(colorBtn->property("color").value<QColor>(), this);
|
||||
QColor c = QColorDialog::getColor(colorBtn->property("color").value<QColor>(), this,
|
||||
QString(), QColorDialog::DontUseNativeDialog);
|
||||
if (c.isValid()) {
|
||||
colorBtn->setProperty("color", c);
|
||||
colorBtn->setStyleSheet(QString("background-color: %1; color: white; font-weight: bold;").arg(c.name()));
|
||||
|
||||
@@ -186,7 +186,8 @@ void DiagramBgColorToolButton::applySystemColor()
|
||||
void DiagramBgColorToolButton::chooseOtherColor()
|
||||
{
|
||||
const QColor c = QColorDialog::getColor(m_current, this,
|
||||
tr("Choisir une couleur de fond"));
|
||||
tr("Choisir une couleur de fond"),
|
||||
QColorDialog::DontUseNativeDialog);
|
||||
if (c.isValid()) {
|
||||
applyColor(c);
|
||||
}
|
||||
|
||||
@@ -1729,7 +1729,8 @@ QWidget *DynamicTextItemDelegate::createEditor(
|
||||
* handling, so it didn't crash). Resolving the dialog
|
||||
* before returning removes the second, competing teardown
|
||||
* path entirely. */
|
||||
QColor color = QColorDialog::getColor(index.data(Qt::EditRole).value<QColor>(), parent);
|
||||
QColor color = QColorDialog::getColor(index.data(Qt::EditRole).value<QColor>(), parent,
|
||||
QString(), QColorDialog::DontUseNativeDialog);
|
||||
QWidget *w = new QWidget(parent);
|
||||
if (color.isValid())
|
||||
{
|
||||
|
||||
@@ -48,7 +48,8 @@ void KColorButton::setColor(const QColor &color)
|
||||
|
||||
void KColorButton::chooseColor()
|
||||
{
|
||||
const auto selected = QColorDialog::getColor(m_color, this);
|
||||
const auto selected = QColorDialog::getColor(m_color, this, QString(),
|
||||
QColorDialog::DontUseNativeDialog);
|
||||
if (!selected.isValid() || selected == m_color) {
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user