File: colorbutton.h

package info (click to toggle)
olive-editor 20181223-2
  • links: PTS
  • area: main
  • in suites: buster
  • size: 2,844 kB
  • sloc: cpp: 20,147; xml: 315; ansic: 16; makefile: 11
file content (36 lines) | stat: -rw-r--r-- 702 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#ifndef COLORBUTTON_H
#define COLORBUTTON_H

#include <QPushButton>
#include <QColor>
#include <QUndoCommand>

class ColorButton : public QPushButton {
    Q_OBJECT
public:
    ColorButton(QWidget* parent = 0);
    QColor get_color();
    void set_color(QColor c);
	const QColor& getPreviousValue();
private:
    QColor color;
	QColor previousColor;
    void set_button_color();
signals:
    void color_changed();
private slots:
    void open_dialog();
};

class ColorCommand : public QUndoCommand {
public:
    ColorCommand(ColorButton* s, QColor o, QColor n);
    void undo();
    void redo();
private:
    ColorButton* sender;
    QColor old_color;
    QColor new_color;
};

#endif // COLORBUTTON_H