diff options
| author | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2020-01-17 18:49:30 +0000 |
|---|---|---|
| committer | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2020-01-17 18:49:30 +0000 |
| commit | 3ffbf4041ee2f9cc210621d6adad928b1bcfe525 (patch) | |
| tree | 6f5e19dada356bac48fb558b58c2fff9b948341c /src | |
| parent | 50da6ee1fc7741a3aeff2fb7c89828dfaf30ab81 (diff) | |
| download | qmmp-3ffbf4041ee2f9cc210621d6adad928b1bcfe525.tar.gz qmmp-3ffbf4041ee2f9cc210621d6adad928b1bcfe525.tar.bz2 qmmp-3ffbf4041ee2f9cc210621d6adad928b1bcfe525.zip | |
qsui: added options for ColorWidget
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@9206 90c681e8-e032-0410-971d-27865f9a5e38
Diffstat (limited to 'src')
| -rw-r--r-- | src/plugins/Ui/qsui/colorwidget.cpp | 15 | ||||
| -rw-r--r-- | src/plugins/Ui/qsui/colorwidget.h | 11 |
2 files changed, 20 insertions, 6 deletions
diff --git a/src/plugins/Ui/qsui/colorwidget.cpp b/src/plugins/Ui/qsui/colorwidget.cpp index b02e3a46b..d774dbfdc 100644 --- a/src/plugins/Ui/qsui/colorwidget.cpp +++ b/src/plugins/Ui/qsui/colorwidget.cpp @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2005-2014 by Ilya Kotov * + * Copyright (C) 2005-2020 by Ilya Kotov * * forkotov02@ya.ru * * * * This program is free software; you can redistribute it and/or modify * @@ -18,7 +18,6 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ -#include <QColorDialog> #include <QPalette> #include "colorwidget.h" @@ -31,10 +30,20 @@ ColorWidget::ColorWidget(QWidget *parent) : QFrame(parent) ColorWidget::~ColorWidget() {} +QColorDialog::ColorDialogOptions ColorWidget::options() const +{ + return m_options; +} + +void ColorWidget::setOptions(QColorDialog::ColorDialogOptions options) +{ + m_options = options; +} + void ColorWidget::mousePressEvent(QMouseEvent *) { QColor color = QColorDialog::getColor(palette().color(backgroundRole()), parentWidget(), - tr("Select Color")); + tr("Select Color"), m_options); if (color.isValid()) { setColor(color.name()); diff --git a/src/plugins/Ui/qsui/colorwidget.h b/src/plugins/Ui/qsui/colorwidget.h index 95e0b4f25..f141f8902 100644 --- a/src/plugins/Ui/qsui/colorwidget.h +++ b/src/plugins/Ui/qsui/colorwidget.h @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2005-2014 by Ilya Kotov * + * Copyright (C) 2005-2020 by Ilya Kotov * * forkotov02@ya.ru * * * * This program is free software; you can redistribute it and/or modify * @@ -22,6 +22,7 @@ #include <QFrame> #include <QPaintEvent> +#include <QColorDialog> /** @author Ilya Kotov @@ -29,19 +30,23 @@ class ColorWidget : public QFrame { Q_OBJECT + Q_PROPERTY(QColorDialog::ColorDialogOptions options READ options WRITE setOptions) public: ColorWidget(QWidget *parent = nullptr); - ~ColorWidget(); + QColorDialog::ColorDialogOptions options() const; + void setOptions(QColorDialog::ColorDialogOptions options); + const QString colorName() const; public slots: - void setColor (QString); + void setColor(QString); private: void mousePressEvent(QMouseEvent *) override; QString m_colorName; + QColorDialog::ColorDialogOptions m_options = QColorDialog::ColorDialogOptions(); }; |
