diff options
author | Ken Moore <ken@ixsystems.com> | 2019-10-29 08:16:05 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-10-29 08:16:05 -0400 |
commit | bbf4e940ff2e1c257ffd78c10d85b3681eb72f46 (patch) | |
tree | 480c429c743606f09a837ebc652ca57a69c42119 /src-qt5/core/lumina-theme-engine | |
parent | Merge pull request #705 from lbartoletti/shortcut_lumina_photo (diff) | |
parent | remove QSignalMapper. Use lambda func instead. (diff) | |
download | lumina-bbf4e940ff2e1c257ffd78c10d85b3681eb72f46.tar.gz lumina-bbf4e940ff2e1c257ffd78c10d85b3681eb72f46.tar.bz2 lumina-bbf4e940ff2e1c257ffd78c10d85b3681eb72f46.zip |
Merge pull request #706 from lbartoletti/fix_deprecated
Fix deprecated
Diffstat (limited to 'src-qt5/core/lumina-theme-engine')
-rw-r--r-- | src-qt5/core/lumina-theme-engine/src/lthemeengine/fontspage.cpp | 9 | ||||
-rw-r--r-- | src-qt5/core/lumina-theme-engine/src/lthemeengine/paletteeditdialog.cpp | 16 |
2 files changed, 10 insertions, 15 deletions
diff --git a/src-qt5/core/lumina-theme-engine/src/lthemeengine/fontspage.cpp b/src-qt5/core/lumina-theme-engine/src/lthemeengine/fontspage.cpp index 8d1ed1ab..15a0ef3d 100644 --- a/src-qt5/core/lumina-theme-engine/src/lthemeengine/fontspage.cpp +++ b/src-qt5/core/lumina-theme-engine/src/lthemeengine/fontspage.cpp @@ -1,4 +1,3 @@ -#include <QSignalMapper> #include <QMessageBox> #include <QSettings> #include <QApplication> @@ -13,12 +12,8 @@ FontsPage::FontsPage(QWidget *parent) : TabPage(parent), m_ui(new Ui::FontsPage){ m_ui->setupUi(this); - QSignalMapper *mapper = new QSignalMapper(this); - mapper->setMapping(m_ui->changeGeneralFontButton, m_ui->generalFontLabel); - mapper->setMapping(m_ui->changeFixedWidthFontButton, m_ui->fixedFontLabel); - connect(m_ui->changeGeneralFontButton, SIGNAL(clicked()), mapper, SLOT(map())); - connect(m_ui->changeFixedWidthFontButton, SIGNAL(clicked()), mapper, SLOT(map())); - connect(mapper, SIGNAL(mapped(QWidget*)), SLOT(onFontChangeRequested(QWidget*))); + connect(m_ui->changeGeneralFontButton, &QToolButton::clicked, [this](){onFontChangeRequested(m_ui->generalFontLabel);}); + connect(m_ui->changeFixedWidthFontButton, &QToolButton::clicked, [this](){onFontChangeRequested(m_ui->fixedFontLabel);}); readSettings(); //icons diff --git a/src-qt5/core/lumina-theme-engine/src/lthemeengine/paletteeditdialog.cpp b/src-qt5/core/lumina-theme-engine/src/lthemeengine/paletteeditdialog.cpp index 6c5b0665..1c377965 100644 --- a/src-qt5/core/lumina-theme-engine/src/lthemeengine/paletteeditdialog.cpp +++ b/src-qt5/core/lumina-theme-engine/src/lthemeengine/paletteeditdialog.cpp @@ -28,9 +28,9 @@ PaletteEditDialog::~PaletteEditDialog(){ QPalette PaletteEditDialog::selectedPalette() const{ QPalette palette; for(int i = 0; i < QPalette::NColorRoles; i++){ - palette.setBrush(QPalette::Active, QPalette::ColorRole(i), m_ui->tableWidget->item(i,0)->backgroundColor()); - palette.setBrush(QPalette::Inactive, QPalette::ColorRole(i), m_ui->tableWidget->item(i,1)->backgroundColor()); - palette.setBrush(QPalette::Disabled, QPalette::ColorRole(i), m_ui->tableWidget->item(i,2)->backgroundColor()); + palette.setBrush(QPalette::Active, QPalette::ColorRole(i), m_ui->tableWidget->item(i,0)->background().color()); + palette.setBrush(QPalette::Inactive, QPalette::ColorRole(i), m_ui->tableWidget->item(i,1)->background().color()); + palette.setBrush(QPalette::Disabled, QPalette::ColorRole(i), m_ui->tableWidget->item(i,2)->background().color()); } return palette; } @@ -40,9 +40,9 @@ void PaletteEditDialog::setPalette(const QPalette &palette){ if(!m_ui->tableWidget->item(i,0)){ m_ui->tableWidget->setItem(i, 0, new QTableWidgetItem()); } if(!m_ui->tableWidget->item(i,1)){ m_ui->tableWidget->setItem(i, 1, new QTableWidgetItem()); } if(!m_ui->tableWidget->item(i,2)){ m_ui->tableWidget->setItem(i, 2, new QTableWidgetItem()); } - m_ui->tableWidget->item(i,0)->setBackgroundColor(palette.color(QPalette::Active, QPalette::ColorRole(i))); - m_ui->tableWidget->item(i,1)->setBackgroundColor(palette.color(QPalette::Inactive, QPalette::ColorRole(i))); - m_ui->tableWidget->item(i,2)->setBackgroundColor(palette.color(QPalette::Disabled, QPalette::ColorRole(i))); + m_ui->tableWidget->item(i,0)->setBackground(QBrush(palette.color(QPalette::Active, QPalette::ColorRole(i)))); + m_ui->tableWidget->item(i,1)->setBackground(QBrush(palette.color(QPalette::Inactive, QPalette::ColorRole(i)))); + m_ui->tableWidget->item(i,2)->setBackground(QBrush(palette.color(QPalette::Disabled, QPalette::ColorRole(i)))); } QStringList labels; labels << tr("Window text") << tr("Button background") << tr("Bright") << tr("Less bright") << tr("Dark") << tr("Less dark") << tr("Normal text") << tr("Bright text") << tr("Button text") << tr("Normal background") << tr("Window") << tr("Shadow") << tr("Highlight") << tr("Highlighted text") << tr("Link") << tr("Visited link") << tr("Alternate background") << tr("Default") << tr("Tooltip background") << tr("Tooltip text") << tr("Placeholder text"); @@ -55,9 +55,9 @@ void PaletteEditDialog::hideEvent(QHideEvent *){ } void PaletteEditDialog::on_tableWidget_itemClicked(QTableWidgetItem *item){ - QColor color = QColorDialog::getColor(item->backgroundColor(), this, tr("Select Color")); + QColor color = QColorDialog::getColor(item->background().color(), this, tr("Select Color")); if(color.isValid()){ - item->setBackgroundColor(color); + item->setBackground(QBrush(color)); emit paletteChanged(selectedPalette()); } } |