mirror of
https://github.com/rizinorg/cutter.git
synced 2025-01-31 08:37:26 +00:00
Disable modification buttons for builtin color themes (#1615)
This commit is contained in:
parent
594896c06f
commit
8138a43923
@ -61,9 +61,7 @@ AppearanceOptionsWidget::AppearanceOptionsWidget(PreferencesDialog *dialog)
|
|||||||
&AppearanceOptionsWidget::updateFontFromConfig);
|
&AppearanceOptionsWidget::updateFontFromConfig);
|
||||||
|
|
||||||
connect(ui->colorComboBox, &QComboBox::currentTextChanged,
|
connect(ui->colorComboBox, &QComboBox::currentTextChanged,
|
||||||
this, [this](const QString &str) {
|
this, &AppearanceOptionsWidget::updateModificationButtons);
|
||||||
ui->editButton->setEnabled(ThemeWorker().isCustomTheme(str));
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
AppearanceOptionsWidget::~AppearanceOptionsWidget() {}
|
AppearanceOptionsWidget::~AppearanceOptionsWidget() {}
|
||||||
@ -90,7 +88,7 @@ void AppearanceOptionsWidget::updateThemeFromConfig(bool interfaceThemeChanged)
|
|||||||
}
|
}
|
||||||
ui->themeComboBox->setCurrentIndex(currInterfaceThemeIndex);
|
ui->themeComboBox->setCurrentIndex(currInterfaceThemeIndex);
|
||||||
ui->colorComboBox->updateFromConfig(interfaceThemeChanged);
|
ui->colorComboBox->updateFromConfig(interfaceThemeChanged);
|
||||||
ui->editButton->setEnabled(ThemeWorker().isCustomTheme(ui->colorComboBox->currentText()));
|
updateModificationButtons(ui->colorComboBox->currentText());
|
||||||
}
|
}
|
||||||
|
|
||||||
void AppearanceOptionsWidget::on_fontSelectionButton_clicked()
|
void AppearanceOptionsWidget::on_fontSelectionButton_clicked()
|
||||||
@ -245,6 +243,14 @@ void AppearanceOptionsWidget::onLanguageComboBoxCurrentIndexChanged(int index)
|
|||||||
qWarning() << tr("Cannot set language, not found in available ones");
|
qWarning() << tr("Cannot set language, not found in available ones");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void AppearanceOptionsWidget::updateModificationButtons(const QString& theme)
|
||||||
|
{
|
||||||
|
bool editable = ThemeWorker().isCustomTheme(theme);
|
||||||
|
ui->editButton->setEnabled(editable);
|
||||||
|
ui->deleteButton->setEnabled(editable);
|
||||||
|
ui->renameButton->setEnabled(editable);
|
||||||
|
}
|
||||||
|
|
||||||
QIcon AppearanceOptionsWidget::getIconFromSvg(const QString& fileName, const QColor& after, const QColor& before)
|
QIcon AppearanceOptionsWidget::getIconFromSvg(const QString& fileName, const QColor& after, const QColor& before)
|
||||||
{
|
{
|
||||||
QFile file(fileName);
|
QFile file(fileName);
|
||||||
|
@ -53,6 +53,8 @@ private slots:
|
|||||||
void on_editButton_clicked();
|
void on_editButton_clicked();
|
||||||
void onLanguageComboBoxCurrentIndexChanged(int index);
|
void onLanguageComboBoxCurrentIndexChanged(int index);
|
||||||
|
|
||||||
|
void updateModificationButtons(const QString& theme);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Changes all @a before colors in given @a fileName svg file to @a after
|
* @brief Changes all @a before colors in given @a fileName svg file to @a after
|
||||||
|
Loading…
Reference in New Issue
Block a user