Fix palette editor
* Fix missing signal connection; when renaming slots the auto-connections were lost * Remove handlers which aren't used anyways
This commit is contained in:
parent
7c7704e4e5
commit
b16caee532
|
@ -31,13 +31,17 @@ PaletteEditor::PaletteEditor(QWidget *parent)
|
|||
auto *const delegate = new ColorDelegate(this);
|
||||
m_ui->paletteView->setItemDelegate(delegate);
|
||||
m_ui->paletteView->setEditTriggers(QAbstractItemView::AllEditTriggers);
|
||||
connect(m_paletteModel, &PaletteModel::paletteChanged, this, &PaletteEditor::paletteChanged);
|
||||
m_ui->paletteView->setSelectionBehavior(QAbstractItemView::SelectRows);
|
||||
m_ui->paletteView->setDragEnabled(true);
|
||||
m_ui->paletteView->setDropIndicatorShown(true);
|
||||
m_ui->paletteView->setRootIsDecorated(false);
|
||||
m_ui->paletteView->setColumnHidden(2, true);
|
||||
m_ui->paletteView->setColumnHidden(3, true);
|
||||
|
||||
connect(m_paletteModel, &PaletteModel::paletteChanged, this, &PaletteEditor::paletteChanged);
|
||||
connect(m_ui->buildButton, &ColorButton::colorChanged, this, &PaletteEditor::buildPalette);
|
||||
connect(m_ui->computeRadio, &QRadioButton::clicked, this, &PaletteEditor::handleComputeRadioClicked);
|
||||
connect(m_ui->detailsRadio, &QRadioButton::clicked, this, &PaletteEditor::handleDetailsRadioClicked);
|
||||
}
|
||||
|
||||
PaletteEditor::~PaletteEditor()
|
||||
|
@ -93,29 +97,6 @@ void PaletteEditor::setPalette(const QPalette &palette, const QPalette &parentPa
|
|||
setPalette(palette);
|
||||
}
|
||||
|
||||
void PaletteEditor::handleBuildButtonColorChanged(const QColor &)
|
||||
{
|
||||
buildPalette();
|
||||
}
|
||||
|
||||
void PaletteEditor::handleActiveRadioClicked()
|
||||
{
|
||||
m_currentColorGroup = QPalette::Active;
|
||||
updatePreviewPalette();
|
||||
}
|
||||
|
||||
void PaletteEditor::handleInactiveRadioClicked()
|
||||
{
|
||||
m_currentColorGroup = QPalette::Inactive;
|
||||
updatePreviewPalette();
|
||||
}
|
||||
|
||||
void PaletteEditor::handleDisabledRadioClicked()
|
||||
{
|
||||
m_currentColorGroup = QPalette::Disabled;
|
||||
updatePreviewPalette();
|
||||
}
|
||||
|
||||
void PaletteEditor::handleComputeRadioClicked()
|
||||
{
|
||||
if (m_compute) {
|
||||
|
|
|
@ -39,18 +39,12 @@ public:
|
|||
void setPalette(const QPalette &palette, const QPalette &parentPalette);
|
||||
|
||||
private Q_SLOTS:
|
||||
void handleBuildButtonColorChanged(const QColor &);
|
||||
void handleActiveRadioClicked();
|
||||
void handleInactiveRadioClicked();
|
||||
void handleDisabledRadioClicked();
|
||||
void buildPalette();
|
||||
void paletteChanged(const QPalette &palette);
|
||||
void handleComputeRadioClicked();
|
||||
void handleDetailsRadioClicked();
|
||||
|
||||
void paletteChanged(const QPalette &palette);
|
||||
|
||||
private:
|
||||
void buildPalette();
|
||||
|
||||
void updatePreviewPalette();
|
||||
void updateStyledButton();
|
||||
|
||||
|
|
Loading…
Reference in New Issue