summaryrefslogtreecommitdiff
path: root/src/colortable.h
diff options
context:
space:
mode:
authorChris Bessent <lost.dragonist@gmail.com>2020-01-06 05:17:01 -0700
committerGitHub <noreply@github.com>2020-01-06 05:17:01 -0700
commitdfa600996c49c1b23dca884c963dc917bd9cfc0a (patch)
treec6def4277cc962822d0dcde71fa9148e050f693f /src/colortable.h
parente69078e2399a88bda7bb9ffae7a3d57db9a4e9cf (diff)
parentd1a788dfad341b32235abc25c2ba1645f8be1ace (diff)
Merge pull request #954 from ModOrganizer2/Develop
Stage for release 2.2.2
Diffstat (limited to 'src/colortable.h')
-rw-r--r--src/colortable.h39
1 files changed, 39 insertions, 0 deletions
diff --git a/src/colortable.h b/src/colortable.h
new file mode 100644
index 00000000..039b6024
--- /dev/null
+++ b/src/colortable.h
@@ -0,0 +1,39 @@
+#ifndef COLORTABLE_H
+#define COLORTABLE_H
+
+#include <QTableWidget>
+
+class Settings;
+
+// a QTableWidget to view and modify color settings
+//
+class ColorTable : public QTableWidget
+{
+public:
+ ColorTable(QWidget* parent=nullptr);
+
+ // adds colors to the table from the settings
+ //
+ void load(Settings& s);
+
+ // resets the colors to their default values; commitColors() must be called
+ // to save them
+ //
+ void resetColors();
+
+ // commits any changes
+ //
+ 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