TTKMusicPlayer  4.3.0.0
TTKMusicPlayer imitates Kugou UI, the music player uses of qmmp core library based on Qt for windows and linux
musiccolordialog.h
Go to the documentation of this file.
1 #ifndef MUSICCOLORDIALOG_H
2 #define MUSICCOLORDIALOG_H
3 
4 /***************************************************************************
5  * This file is part of the TTK Music Player project
6  * Copyright (C) 2015 - 2026 Greedysky Studio
7 
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 3 of the License, or
11  * (at your option) any later version.
12 
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17 
18  * You should have received a copy of the GNU General Public License along
19  * with this program; If not, see <http://www.gnu.org/licenses/>.
20  ***************************************************************************/
21 
23 
27 class TTK_MODULE_EXPORT MusicHlPalette : public QWidget
28 {
29  Q_OBJECT
30 public:
34  explicit MusicHlPalette(QWidget *parent = nullptr);
35 
39  QColor color() const noexcept;
43  void setColor(const QColor &color);
44 
48  void initialize();
49 
50 Q_SIGNALS:
54  void colorChanged(const QColor &color);
55 
56 public Q_SLOTS:
60  void setSaturation(double dblsaturation);
61 
62 private:
66  virtual void paintEvent(QPaintEvent *event) override final;
67  virtual void resizeEvent(QResizeEvent *event) override final;
68  virtual void mousePressEvent(QMouseEvent *event) override final;
69  virtual void mouseMoveEvent(QMouseEvent *event) override final;
73  void calculateColor();
74 
77  QColor m_color;
79 
80 };
81 
82 
87 {
88  Q_OBJECT
89 public:
93  explicit MusicHlSaturationPalette(QWidget *parent = nullptr);
94 
98  double saturation() const noexcept;
102  void setSaturation(double dblsaturation);
103 
104 Q_SIGNALS:
108  void saturationChanged(double dblSaturation);
109 
110 public Q_SLOTS:
114  void setBaseColor(const QColor &color);
115 
116 private:
120  virtual void paintEvent(QPaintEvent *event) override final;
121  virtual void resizeEvent(QResizeEvent *event) override final;
122  virtual void mousePressEvent(QMouseEvent *event) override final;
123  virtual void mouseMoveEvent(QMouseEvent *event) override final;
127  void calculateSuration();
128 
129  QColor m_color;
130  double m_dblVernierX, m_dblVernierPercentX, m_dblSaturation;
131 
132 };
133 
134 
135 namespace Ui {
136 class MusicColorDialog;
137 }
138 
143 {
144  Q_OBJECT
145 public:
149  explicit MusicColorDialog(QWidget *parent = nullptr);
150  explicit MusicColorDialog(const QColor &color, QWidget *parent = nullptr);
154  ~MusicColorDialog();
155 
159  static QColor popup(QWidget *parent = nullptr, const QColor &color = {});
160 
164  QColor color() const noexcept;
168  void setColor(const QColor &color);
169 
170 public Q_SLOTS:
174  void buttonClicked(int index);
178  void colorChanged(const QColor &color);
179 
180 private:
181  Ui::MusicColorDialog *m_ui;
182  QColor m_color;
183 
184 };
185 
186 #endif // MUSICCOLORDIALOG_H
#define TTK_MODULE_EXPORT
Ui::MusicColorDialog * m_ui
The class of the color hl saturation palette.
TTK_MODULE_EXPORT void initialize(TTK::Attribute attr)
The class of the moving dialog base.
The class of the color hl palette.
QPointF m_ptfVernierPercentPos
The class of the get color table widget.