mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2024-11-05 08:51:19 -05:00
7ec4d1a109
The header QMetaType must now be included explicitly if no other header includes QObject. Adjust band combo box layout settings to ensure it is rendered at minimum content size otherwise it stretches the signal meter width to an ugly extent. Also retired the "frequencies" settings file key so that upgrades and downgrades between 1.5 and 1.6 no longer require rebuilding the working frequencies list. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@5727 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
57 lines
1.4 KiB
C++
57 lines
1.4 KiB
C++
#ifndef W_F_PALETTE_HPP__
|
|
#define W_F_PALETTE_HPP__
|
|
|
|
#include <QMetaType>
|
|
#include <QList>
|
|
#include <QVector>
|
|
#include <QColor>
|
|
|
|
class QString;
|
|
|
|
//
|
|
// Class WFPalette
|
|
//
|
|
// Encapulates a waterfall palette description. A colour gradient
|
|
// over 256 intervals is described by a list of RGB colour triplets.
|
|
// The list of colours are use to interpolate the full 256 interval
|
|
// waterfall colour gradient.
|
|
//
|
|
// Responsibilities
|
|
//
|
|
// Construction from a string which is a path to a file containing
|
|
// colour descriptions in the form rrr;ggg;bbb on up to 256
|
|
// consecutive lines, where rrr, ggg and, bbb are integral numbers in
|
|
// the range 0<=n<256.
|
|
//
|
|
// Construction from a list of QColor instances. Up to the first 256
|
|
// list elements are used.
|
|
//
|
|
// Includes a design GUI to create or adjust a WFPalette.
|
|
//
|
|
class WFPalette
|
|
{
|
|
public:
|
|
using Colours = QList<QColor>;
|
|
|
|
WFPalette () = default;
|
|
explicit WFPalette (Colours const&);
|
|
explicit WFPalette (QString const& file_path);
|
|
WFPalette (WFPalette const&) = default;
|
|
WFPalette& operator = (WFPalette const&) = default;
|
|
|
|
Colours colours () const {return colours_;}
|
|
|
|
// interpolate a gradient over 256 steps
|
|
QVector<QColor> interpolate () const;
|
|
|
|
// returns true if colours have been modified
|
|
bool design ();
|
|
|
|
private:
|
|
Colours colours_;
|
|
};
|
|
|
|
Q_DECLARE_METATYPE (WFPalette::Colours);
|
|
|
|
#endif
|