summaryrefslogtreecommitdiff
path: root/src/colortable.h
blob: c2b64a4db6be64b577f43b7e0dab5fa6e0211a95 (plain)
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
#ifndef COLORTABLE_H
#define COLORTABLE_H

#include <QTableWidget>

class Settings;

class ColorTable : public QTableWidget
{
public:
  ColorTable(QWidget* parent=nullptr);

  void load(Settings& s);
  void resetColors();
  void commitColors();

private:
  Settings* m_settings;

  void addColor(
    const QString& text, const QColor& defaultColor,
    std::function<QColor ()> get,
    std::function<void (const QColor&)> commit);

  void onColorActivated();
};

#endif // COLORTABLE_H