TTKMusicPlayer  3.7.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 - 2024 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
31 public:
35  explicit MusicHlPalette(QWidget *parent = nullptr);
36 
40  QColor color() const;
44  void setColor(const QColor &color);
45 
49  void initialize();
50 
51 Q_SIGNALS:
55  void colorChanged(const QColor &color);
56 
57 public Q_SLOTS:
61  void setSaturation(double dblsaturation);
62 
63 private:
67  virtual void paintEvent(QPaintEvent *event) override final;
68  virtual void resizeEvent(QResizeEvent *event) override final;
69  virtual void mousePressEvent(QMouseEvent *event) override final;
70  virtual void mouseMoveEvent(QMouseEvent *event) override final;
74  void calculateColor();
75 
78  QColor m_color;
80 
81 };
82 
83 
88 {
89  Q_OBJECT
91 public:
95  explicit MusicHlSaturationPalette(QWidget *parent = nullptr);
96 
100  double saturation() const;
104  void setSaturation(double dblsaturation);
105 
106 Q_SIGNALS:
110  void saturationChanged(double dblSaturation);
111 
112 public Q_SLOTS:
116  void setBaseColor(const QColor &color);
117 
118 private:
122  virtual void paintEvent(QPaintEvent *event) override final;
123  virtual void resizeEvent(QResizeEvent *event) override final;
124  virtual void mousePressEvent(QMouseEvent *event) override final;
125  virtual void mouseMoveEvent(QMouseEvent *event) override final;
129  void calculateSuration();
130 
131  QColor m_color;
132  double m_dblVernierX, m_dblVernierPercentX, m_dblSaturation;
133 
134 };
135 
136 
137 namespace Ui {
138 class MusicColorDialog;
139 }
140 
145 {
146  Q_OBJECT
148 public:
152  explicit MusicColorDialog(QWidget *parent = nullptr);
153  explicit MusicColorDialog(const QColor &color, QWidget *parent = nullptr);
157  ~MusicColorDialog();
158 
162  static QColor popup(QWidget *parent = nullptr, const QColor &color = {});
163 
167  QColor color() const;
171  void setColor(const QColor &color);
172 
173 public Q_SLOTS:
177  void buttonClicked(int index);
181  void colorChanged(const QColor &color);
182 
183 private:
184  Ui::MusicColorDialog *m_ui;
185  QColor m_color;
186 
187 };
188 
189 #endif // MUSICCOLORDIALOG_H
#define TTK_MODULE_EXPORT
Ui::MusicColorDialog * m_ui
The class of the color hl saturation palette.
#define TTK_DECLARE_MODULE(Class)
Definition: ttkqtglobal.h:152
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.