forked from hmatuschek/kochmorse
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added inter-char/inter-word pause and text settings.
- Loading branch information
1 parent
b54d209
commit f3d1c81
Showing
13 changed files
with
323 additions
and
69 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#include "colorbutton.hh" | ||
|
||
ColorButton::ColorButton(const QColor &color, QWidget *parent) | ||
: QToolButton(parent), _color(color) | ||
{ | ||
setColor(color); | ||
connect(this, SIGNAL(clicked()), this, SLOT(_onSelectColor())); | ||
} | ||
|
||
const QColor & | ||
ColorButton::color() const { | ||
return _color; | ||
} | ||
|
||
void | ||
ColorButton::setColor(const QColor &color) { | ||
_color = color; | ||
QPixmap pixmap(64,64); | ||
pixmap.fill(_color); | ||
setIcon(QIcon(pixmap)); | ||
} | ||
|
||
void | ||
ColorButton::_onSelectColor() { | ||
QColorDialog dialog(_color); | ||
if (QDialog::Accepted != dialog.exec()) | ||
return; | ||
setColor(dialog.currentColor()); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#ifndef COLORBUTTON_HH | ||
#define COLORBUTTON_HH | ||
|
||
#include <QToolButton> | ||
#include <QColorDialog> | ||
#include <QColor> | ||
|
||
|
||
class ColorButton : public QToolButton | ||
{ | ||
Q_OBJECT | ||
|
||
public: | ||
explicit ColorButton(const QColor &color, QWidget *parent=nullptr); | ||
|
||
const QColor &color() const; | ||
void setColor(const QColor &color); | ||
|
||
protected slots: | ||
void _onSelectColor(); | ||
|
||
protected: | ||
QColor _color; | ||
}; | ||
|
||
#endif // COLORBUTTON_HH |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.