summaryrefslogtreecommitdiff
path: root/src/tikzit.h
diff options
context:
space:
mode:
authorAleks Kissinger <aleks0@gmail.com>2018-08-03 23:22:11 +0200
committerAleks Kissinger <aleks0@gmail.com>2018-08-03 23:22:11 +0200
commit247d9e6b004b2920d696245838b9969690637fd2 (patch)
treec5120e553ed37ddd1ed899f61eaba141af57f9b2 /src/tikzit.h
parent31a78ae551b781eccc47546a2f6d4bf121af24cf (diff)
support for RGB colors, edit color and name in style editor
Diffstat (limited to 'src/tikzit.h')
-rw-r--r--src/tikzit.h14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/tikzit.h b/src/tikzit.h
index 3369962..35b19de 100644
--- a/src/tikzit.h
+++ b/src/tikzit.h
@@ -62,10 +62,12 @@
#include <QObject>
#include <QVector>
+#include <QStringList>
#include <QPointF>
#include <QMenuBar>
#include <QMainWindow>
#include <QFont>
+#include <QColor>
// Number of pixels between (0,0) and (1,0) at 100% zoom level. This should be
// divisible by 8 to avoid rounding errors with e.g. grid-snapping.
@@ -115,13 +117,20 @@ public:
void quit();
void init(QApplication *app);
+ // convenience functions for named colors
+ QColor colorByIndex(int i);
+ QColor colorByName(QString name);
+ QString nameForColor(QColor col);
+
void openTikzStyles();
- void loadStyles(QString fileName);
+ bool loadStyles(QString fileName);
void showStyleEditor();
TikzStyles *styles() const;
QString styleFile() const;
//StylePalette *stylePalette() const;
+ QString styleFilePath() const;
+
public slots:
void focusChanged(QWidget *old, QWidget *nw);
private:
@@ -135,7 +144,10 @@ private:
MainWindow *_activeWindow;
TikzStyles *_styles;
QString _styleFile;
+ QString _styleFilePath;
StyleEditor *_styleEditor;
+ QStringList _colNames;
+ QVector<QColor> _cols;
};
extern Tikzit *tikzit;