From c528926ce69ab330c9c6caf3ee97cd2dc5d0dada Mon Sep 17 00:00:00 2001 From: Martchus Date: Thu, 8 Jun 2023 16:21:50 +0200 Subject: [PATCH] Remove useless function from palette editor --- paletteeditor/paletteeditor.cpp | 17 ----------------- paletteeditor/paletteeditor.h | 1 - 2 files changed, 18 deletions(-) diff --git a/paletteeditor/paletteeditor.cpp b/paletteeditor/paletteeditor.cpp index 6ad799b..0d4b4f9 100644 --- a/paletteeditor/paletteeditor.cpp +++ b/paletteeditor/paletteeditor.cpp @@ -31,7 +31,6 @@ PaletteEditor::PaletteEditor(QWidget *parent) { m_ui->setupUi(this); m_ui->paletteView->setModel(m_paletteModel); - updatePreviewPalette(); updateStyledButton(); m_ui->paletteView->setModel(m_paletteModel); auto *const delegate = new ColorDelegate(this); @@ -94,7 +93,6 @@ void PaletteEditor::setPalette(const QPalette &palette) resolve(mask) #endif ; - updatePreviewPalette(); updateStyledButton(); m_paletteUpdated = true; if (!m_modelUpdated) { @@ -220,21 +218,6 @@ void PaletteEditor::buildPalette() setPalette(temp); } -void PaletteEditor::updatePreviewPalette() -{ - const QPalette::ColorGroup g = currentColorGroup(); - // build the preview palette - const QPalette currentPalette = palette(); - QPalette previewPalette; - for (int i = QPalette::WindowText; i < QPalette::NColorRoles; ++i) { - const QPalette::ColorRole r = static_cast(i); - const QBrush br = currentPalette.brush(g, r); - previewPalette.setBrush(QPalette::Active, r, br); - previewPalette.setBrush(QPalette::Inactive, r, br); - previewPalette.setBrush(QPalette::Disabled, r, br); - } -} - void PaletteEditor::updateStyledButton() { m_ui->buildButton->setColor(palette().color(QPalette::Active, QPalette::Button)); diff --git a/paletteeditor/paletteeditor.h b/paletteeditor/paletteeditor.h index bf75abe..7106cf3 100644 --- a/paletteeditor/paletteeditor.h +++ b/paletteeditor/paletteeditor.h @@ -48,7 +48,6 @@ private Q_SLOTS: void save(); private: - void updatePreviewPalette(); void updateStyledButton(); QPalette::ColorGroup currentColorGroup() const