From 39c2c74c664a6c770639ead8f45322352cacb997 Mon Sep 17 00:00:00 2001 From: Aleks Kissinger Date: Mon, 12 Mar 2018 21:44:49 +0100 Subject: style loading works --- images/crop.svg | 48 +--------- images/refresh.svg | 1 + src/data/graphelementdata.cpp | 2 +- src/data/node.cpp | 2 +- src/data/nodestyle.cpp | 119 +++++++++++++++++++++---- src/data/nodestyle.h | 32 +++++-- src/data/project.cpp | 13 --- src/data/project.h | 21 ----- src/data/tikzassembler.cpp | 14 +-- src/data/tikzassembler.h | 10 +-- src/data/tikzlexer.l | 2 + src/data/tikzparser.y | 7 +- src/data/tikzstyles.cpp | 36 ++++++++ src/data/tikzstyles.h | 29 +++++++ src/gui/nodeitem.cpp | 6 +- src/gui/toolpalette.cpp | 2 +- src/main.cpp | 1 + src/tikzit.cpp | 91 ++++++++++++++----- src/tikzit.h | 14 ++- stylepalette.cpp | 33 ++++++- stylepalette.h | 5 +- stylepalette.ui | 197 ++++++++++++++++++++++++++---------------- tikzit.pro | 8 +- tikzit.qrc | 1 + 24 files changed, 457 insertions(+), 237 deletions(-) create mode 100644 images/refresh.svg delete mode 100644 src/data/project.cpp delete mode 100644 src/data/project.h create mode 100644 src/data/tikzstyles.cpp create mode 100644 src/data/tikzstyles.h diff --git a/images/crop.svg b/images/crop.svg index 226faa8..d10e9ba 100644 --- a/images/crop.svg +++ b/images/crop.svg @@ -1,47 +1 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + \ No newline at end of file diff --git a/images/refresh.svg b/images/refresh.svg new file mode 100644 index 0000000..29dff8a --- /dev/null +++ b/images/refresh.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/data/graphelementdata.cpp b/src/data/graphelementdata.cpp index 41fcbf0..43f7516 100644 --- a/src/data/graphelementdata.cpp +++ b/src/data/graphelementdata.cpp @@ -66,7 +66,7 @@ QString GraphElementData::property(QString key) if (i != -1) { return _properties[i].value(); } else { - return 0; + return QString(); // null QString } } diff --git a/src/data/node.cpp b/src/data/node.cpp index f94a3df..c78f49c 100644 --- a/src/data/node.cpp +++ b/src/data/node.cpp @@ -70,7 +70,7 @@ void Node::setStyleName(const QString &styleName) void Node::attachStyle() { if (_styleName == "none") _style = noneStyle; - else _style = tikzit->nodeStyle(_styleName); + else _style = tikzit->styles()->nodeStyle(_styleName); } NodeStyle *Node::style() const diff --git a/src/data/nodestyle.cpp b/src/data/nodestyle.cpp index 7eca791..e38d3a3 100644 --- a/src/data/nodestyle.cpp +++ b/src/data/nodestyle.cpp @@ -1,32 +1,113 @@ #include "nodestyle.h" +#include NodeStyle *noneStyle = new NodeStyle(); -NodeStyle::NodeStyle() +NodeStyle::NodeStyle() : _name("none"), _data(0) { - name = "none"; - shape = NodeShape::Circle; - fillColor = Qt::white; - strokeColor = Qt::black; - strokeThickness = 1; } -NodeStyle::NodeStyle(QString nm, NodeShape sh, QColor fillCol) + +NodeStyle::NodeStyle(QString name, GraphElementData *data): _name(name), _data(data) +{ +} + +bool NodeStyle::isNone() { return _data == 0; } + +GraphElementData *NodeStyle::data() const +{ + return _data; +} + +QString NodeStyle::name() const +{ + return _name; +} + +NodeShape NodeStyle::shape() const { - name = nm; - shape = sh; - fillColor = fillCol; - strokeColor = Qt::black; - strokeThickness = 1; + QString sh = _data->property("shape"); + if (sh.isNull()) return NodeShape::Circle; + else if (sh == "circle") return NodeShape::Circle; + else if (sh == "rectangle") return NodeShape::Rectangle; + else return NodeShape::Circle; } -NodeStyle::NodeStyle(QString nm, NodeShape sh, QColor fillCol, QColor strokeCol, int strokeThick) +QColor NodeStyle::fillColor() const { - name = nm; - shape = sh; - fillColor = fillCol; - strokeColor = strokeCol; - strokeThickness = strokeThick; + QString col = _data->property("fill"); + + if (col.isNull()) { + return QColor(Qt::white); + } else { + QColor namedColor(col); + if (namedColor.isValid()) { + return namedColor; + } else { + // TODO: read RGB colors + return QColor(Qt::white); + } + } +} + +QColor NodeStyle::strokeColor() const +{ + QString col = _data->property("draw"); + + if (col.isNull()) { + return QColor(Qt::black); + } else { + QColor namedColor(col); + if (namedColor.isValid()) { + return namedColor; + } else { + // TODO: read RGB colors + return QColor(Qt::white); + } + } +} + +int NodeStyle::strokeThickness() const +{ + return 1; +} + +QPen NodeStyle::pen() const +{ + QPen p(strokeColor()); + p.setWidthF((float)strokeThickness() * 3.0f); + return p; +} + +QBrush NodeStyle::brush() const +{ + return QBrush(fillColor()); +} + +QPainterPath NodeStyle::path() const +{ + QPainterPath pth; + pth.addEllipse(QPointF(0.0f,0.0f), 30.0f, 30.0f); + return pth; +} + +QPainterPath NodeStyle::palettePath() const +{ + return path(); +} + +QIcon NodeStyle::icon() const +{ + // draw an icon matching the style + QPixmap px(100,100); + px.fill(Qt::transparent); + QPainter painter(&px); + QPainterPath pth = path(); + painter.setPen(pen()); + painter.setBrush(brush()); + + pth.translate(50.0f, 50.0f); + painter.drawPath(pth); + return QIcon(px); } -bool NodeStyle::isNone() { return name == "none"; } diff --git a/src/data/nodestyle.h b/src/data/nodestyle.h index 00d1b20..58c0c12 100644 --- a/src/data/nodestyle.h +++ b/src/data/nodestyle.h @@ -1,24 +1,40 @@ #ifndef NODESTYLE_H #define NODESTYLE_H +#include "graphelementdata.h" + #include +#include +#include +#include +#include enum NodeShape { - Square, UpTriangle, DownTriangle, Circle + Rectangle, UpTriangle, DownTriangle, Circle }; class NodeStyle { public: NodeStyle(); - NodeStyle(QString nm, NodeShape sh, QColor fillCol); - NodeStyle(QString nm, NodeShape sh, QColor fillCol, QColor strokeCol, int strokeThick); + NodeStyle(QString name, GraphElementData *data); bool isNone(); - QString name; - NodeShape shape; - QColor fillColor; - QColor strokeColor; - int strokeThickness; + + GraphElementData *data() const; + QString name() const; + NodeShape shape() const; + QColor fillColor() const; + QColor strokeColor() const; + int strokeThickness() const; + + QPen pen() const; + QBrush brush() const; + QPainterPath path() const; + QPainterPath palettePath() const; + QIcon icon() const; +private: + QString _name; + GraphElementData *_data; }; extern NodeStyle *noneStyle; diff --git a/src/data/project.cpp b/src/data/project.cpp deleted file mode 100644 index b129dc0..0000000 --- a/src/data/project.cpp +++ /dev/null @@ -1,13 +0,0 @@ -#include "project.h" - -#include "QDebug" - -Project::Project(QObject *parent) : QObject(parent) -{ - -} - -void Project::addStyle(QString name, GraphElementData *properties) -{ - qDebug() << "got style {" << name << "} = [" << properties << "]"; -} diff --git a/src/data/project.h b/src/data/project.h deleted file mode 100644 index cbc2cb9..0000000 --- a/src/data/project.h +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef PROJECT_H -#define PROJECT_H - -#include "graphelementdata.h" - -#include -#include - -class Project : public QObject -{ - Q_OBJECT -public: - explicit Project(QObject *parent = 0); - void addStyle(QString name, GraphElementData *properties); - -signals: - -public slots: -}; - -#endif // PROJECT_H diff --git a/src/data/tikzassembler.cpp b/src/data/tikzassembler.cpp index 456464a..e0197da 100644 --- a/src/data/tikzassembler.cpp +++ b/src/data/tikzassembler.cpp @@ -7,14 +7,14 @@ int yyparse(void *scanner); TikzAssembler::TikzAssembler(Graph *graph, QObject *parent) : - QObject(parent), _graph(graph), _project(0) + QObject(parent), _graph(graph), _tikzStyles(0) { yylex_init(&scanner); yyset_extra(this, scanner); } -TikzAssembler::TikzAssembler(Project *project, QObject *parent) : - QObject(parent), _graph(0), _project(project) +TikzAssembler::TikzAssembler(TikzStyles *tikzStyles, QObject *parent) : + QObject(parent), _graph(0), _tikzStyles(tikzStyles) { yylex_init(&scanner); yyset_extra(this, scanner); @@ -37,9 +37,9 @@ Graph *TikzAssembler::graph() const return _graph; } -Project *TikzAssembler::project() const +TikzStyles *TikzAssembler::tikzStyles() const { - return _project; + return _tikzStyles; } bool TikzAssembler::isGraph() const @@ -47,8 +47,8 @@ bool TikzAssembler::isGraph() const return _graph != 0; } -bool TikzAssembler::isProject() const +bool TikzAssembler::isTikzStyles() const { - return _project != 0; + return _tikzStyles != 0; } diff --git a/src/data/tikzassembler.h b/src/data/tikzassembler.h index 8dbbc9b..38d67a7 100644 --- a/src/data/tikzassembler.h +++ b/src/data/tikzassembler.h @@ -7,7 +7,7 @@ #include "node.h" #include "graph.h" -#include "project.h" +#include "tikzstyles.h" #include #include @@ -17,15 +17,15 @@ class TikzAssembler : public QObject Q_OBJECT public: explicit TikzAssembler(Graph *graph, QObject *parent = 0); - explicit TikzAssembler(Project *project, QObject *parent = 0); + explicit TikzAssembler(TikzStyles *tikzStyles, QObject *parent = 0); void addNodeToMap(Node *n); Node *nodeWithName(QString name); bool parse(const QString &tikz); Graph *graph() const; - Project *project() const; + TikzStyles *tikzStyles() const; bool isGraph() const; - bool isProject() const; + bool isTikzStyles() const; signals: @@ -35,7 +35,7 @@ public slots: private: QHash _nodeMap; Graph *_graph; - Project *_project; + TikzStyles *_tikzStyles; void *scanner; }; diff --git a/src/data/tikzlexer.l b/src/data/tikzlexer.l index faf0d43..0a7ff39 100644 --- a/src/data/tikzlexer.l +++ b/src/data/tikzlexer.l @@ -68,6 +68,7 @@ FLOAT \-?[0-9]*(\.[0-9]+)? \\begin\{tikzpicture\} { return BEGIN_TIKZPICTURE_CMD; } \\end\{tikzpicture\} { return END_TIKZPICTURE_CMD; } +\\tikzstyle { return TIKZSTYLE_CMD; } \\begin\{pgfonlayer\} { return BEGIN_PGFONLAYER_CMD; } \\end\{pgfonlayer\} { return END_PGFONLAYER_CMD; } \\draw { return DRAW_CMD; } @@ -78,6 +79,7 @@ node { return NODE; } at { return AT; } to { return TO; } ; { return SEMICOLON; } += { return EQUALS; } \([ ]*{FLOAT}[ ]*,[ ]*{FLOAT}[ ]*\) { yylloc->last_column = yylloc->first_column + 1; diff --git a/src/data/tikzparser.y b/src/data/tikzparser.y index a4db3dd..76674f1 100644 --- a/src/data/tikzparser.y +++ b/src/data/tikzparser.y @@ -7,7 +7,7 @@ /* * Copyright 2010 Chris Heunen - * Copyright 2010-2013 Aleks Kissinger + * Copyright 2010-2017 Aleks Kissinger * Copyright 2013 K. Johan Paulsson * Copyright 2013 Alex Merry * @@ -85,6 +85,7 @@ void yyerror(YYLTYPE *yylloc, void *scanner, const char *str) { %token BEGIN_TIKZPICTURE_CMD "\\begin{tikzpicture}" %token END_TIKZPICTURE_CMD "\\end{tikzpicture}" +%token TIKZSTYLE_CMD "\\tikzstyle" %token BEGIN_PGFONLAYER_CMD "\\begin{pgfonlayer}" %token END_PGFONLAYER_CMD "\\end{pgfonlayer}" %token DRAW_CMD "\\draw" @@ -133,8 +134,8 @@ tikz: tikzstyles | tikzpicture; tikzstyles: tikzstyles tikzstyle | ; tikzstyle: "\\tikzstyle" DELIMITEDSTRING "=" "[" properties "]" { - if (assembler->isProject()) { - assembler->project()->addStyle(QString($2), $5); + if (assembler->isTikzStyles()) { + assembler->tikzStyles()->addStyle(QString($2), $5); } } diff --git a/src/data/tikzstyles.cpp b/src/data/tikzstyles.cpp new file mode 100644 index 0000000..186e19b --- /dev/null +++ b/src/data/tikzstyles.cpp @@ -0,0 +1,36 @@ +#include "tikzstyles.h" +#include "nodestyle.h" + +#include + +TikzStyles::TikzStyles(QObject *parent) : QObject(parent) +{ + +} + +NodeStyle *TikzStyles::nodeStyle(QString name) const +{ + foreach (NodeStyle *s , _nodeStyles) + if (s->name() == name) return s; + return noneStyle; //NodeStyle(name, NodeShape::Circle, Qt::white); +} + +QVector TikzStyles::nodeStyles() const +{ + return _nodeStyles; +} + +void TikzStyles::clear() +{ + _nodeStyles.clear(); +} + +void TikzStyles::addStyle(QString name, GraphElementData *data) +{ + //qDebug() << "got style {" << name << "} = [" << data << "]"; + if (!data->property("fill").isNull()) { // node style + _nodeStyles << new NodeStyle(name, data); + } else { // edge style + // TODO: edge styles + } +} diff --git a/src/data/tikzstyles.h b/src/data/tikzstyles.h new file mode 100644 index 0000000..eaf7e64 --- /dev/null +++ b/src/data/tikzstyles.h @@ -0,0 +1,29 @@ +#ifndef PROJECT_H +#define PROJECT_H + +#include "graphelementdata.h" +#include "nodestyle.h" + +#include +#include + +class TikzStyles : public QObject +{ + Q_OBJECT +public: + explicit TikzStyles(QObject *parent = 0); + void addStyle(QString name, GraphElementData *data); + + NodeStyle *nodeStyle(QString name) const; + QVector nodeStyles() const; + void clear(); + +signals: + +public slots: + +private: + QVector _nodeStyles; +}; + +#endif // PROJECT_H diff --git a/src/gui/nodeitem.cpp b/src/gui/nodeitem.cpp index 71226f3..21cdf79 100644 --- a/src/gui/nodeitem.cpp +++ b/src/gui/nodeitem.cpp @@ -57,10 +57,10 @@ void NodeItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidge painter->setBrush(Qt::NoBrush); painter->drawPath(shape()); } else { - QPen pen(_node->style()->strokeColor); - pen.setWidth(_node->style()->strokeThickness); + QPen pen(_node->style()->strokeColor()); + pen.setWidth(_node->style()->strokeThickness()); painter->setPen(pen); - painter->setBrush(QBrush(_node->style()->fillColor)); + painter->setBrush(QBrush(_node->style()->fillColor())); painter->drawPath(shape()); } diff --git a/src/gui/toolpalette.cpp b/src/gui/toolpalette.cpp index 430df3f..0a832a6 100644 --- a/src/gui/toolpalette.cpp +++ b/src/gui/toolpalette.cpp @@ -20,7 +20,7 @@ ToolPalette::ToolPalette(QWidget *parent) : select = new QAction(QIcon(":/images/Inkscape_icons_edit_select_all.svg"), "Select"); vertex = new QAction(QIcon(":/images/Inkscape_icons_draw_ellipse.svg"), "Add Vertex"); edge = new QAction(QIcon(":/images/Inkscape_icons_draw_path.svg"), "Add Edge"); - crop = new QAction(QIcon(":/images/Inkscape_icons_draw_rectangle.svg"), "Bounding Box"); + crop = new QAction(QIcon(":/images/crop.svg"), "Bounding Box"); tools->addAction(select); tools->addAction(vertex); diff --git a/src/main.cpp b/src/main.cpp index 96069ef..49b064d 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -20,6 +20,7 @@ int main(int argc, char *argv[]) QApplication a(argc, argv); a.setQuitOnLastWindowClosed(false); tikzit = new Tikzit(); + tikzit->init(); return a.exec(); } diff --git a/src/tikzit.cpp b/src/tikzit.cpp index 746268c..6ef86dd 100644 --- a/src/tikzit.cpp +++ b/src/tikzit.cpp @@ -1,7 +1,12 @@ #include "tikzit.h" +#include "tikzassembler.h" +#include "tikzstyles.h" +#include #include #include +#include +#include // application-level instance of Tikzit Tikzit *tikzit; @@ -9,25 +14,27 @@ Tikzit *tikzit; // font to use for node labels QFont Tikzit::LABEL_FONT("Courrier", 9); -Tikzit::Tikzit() +Tikzit::Tikzit() : _styleFile("[default]"), _activeWindow(0) { - _mainMenu = new MainMenu(); +} - _activeWindow = 0; +void Tikzit::init() +{ + QSettings settings("tikzit", "tikzit"); + _mainMenu = new MainMenu(); QMainWindow *dummy = new QMainWindow(); _toolPalette = new ToolPalette(dummy); _propertyPalette = new PropertyPalette(dummy); _stylePalette = new StylePalette(dummy); + _styles = new TikzStyles(this); - loadStyles(); - - //_toolPalette->show(); - //_propertyPalette->show(); _stylePalette->show(); - _windows << new MainWindow(); _windows[0]->show(); + + QString styleFile = settings.value("previous-tikzstyles-file").toString(); + if (!styleFile.isEmpty()) loadStyles(styleFile); } //QMenuBar *Tikzit::mainMenu() const @@ -45,13 +52,6 @@ PropertyPalette *Tikzit::propertyPalette() const return _propertyPalette; } -void Tikzit::loadStyles() -{ - _nodeStyles << new NodeStyle("black dot", NodeShape::Circle, Qt::black, Qt::black, 1); - _nodeStyles << new NodeStyle("white dot", NodeShape::Circle, Qt::white, Qt::black, 1); - _nodeStyles << new NodeStyle("gray dot", NodeShape::Circle, Qt::gray, Qt::black, 1); -} - void Tikzit::newDoc() { MainWindow *w = new MainWindow(); @@ -81,13 +81,6 @@ void Tikzit::removeWindow(MainWindow *w) } } -NodeStyle *Tikzit::nodeStyle(QString name) -{ - foreach (NodeStyle *s , _nodeStyles) - if (s->name == name) return s; - return noneStyle; //NodeStyle(name, NodeShape::Circle, Qt::white); -} - void Tikzit::open() { QSettings settings("tikzit", "tikzit"); @@ -109,8 +102,62 @@ void Tikzit::open() } } +void Tikzit::openTikzStyles() { + QSettings settings("tikzit", "tikzit"); + QString fileName = QFileDialog::getOpenFileName(0, + tr("Open File"), + settings.value("previous-tikzstyles-path").toString(), + tr("TiKZ Style Files (*.tikzstyles)")); + + if (!fileName.isEmpty()) { + loadStyles(fileName); + } +} + +void Tikzit::loadStyles(QString fileName) +{ + QSettings settings("tikzit", "tikzit"); + QFile file(fileName); + if (file.open(QIODevice::ReadOnly)) { + QFileInfo fi(file); + settings.setValue("previous-tikzstyles-path", fi.absolutePath()); + settings.setValue("previous-tikzstyles-file", fileName); + _styleFile = fi.fileName(); + QTextStream in(&file); + QString styleTikz = in.readAll(); + file.close(); + + _styles->clear(); + TikzAssembler ass(_styles); + bool parseSuccess = ass.parse(styleTikz); + if (parseSuccess) { + qDebug() << "parse successful"; + } else { + qDebug() << "parse failed"; + } + _stylePalette->reloadStyles(); + + } else { + settings.setValue("previous-tikzstyles-file", ""); + QMessageBox::warning(0, "Style file not found.", "Could not open style file, reverting to default."); + } +} + +QString Tikzit::styleFile() const +{ + return _styleFile; +} + + +TikzStyles *Tikzit::styles() const +{ + return _styles; +} + void Tikzit::quit() { _stylePalette->close(); QApplication::quit(); } + + diff --git a/src/tikzit.h b/src/tikzit.h index 07878aa..802b3ab 100644 --- a/src/tikzit.h +++ b/src/tikzit.h @@ -38,6 +38,7 @@ #include "propertypalette.h" #include "stylepalette.h" #include "nodestyle.h" +#include "tikzstyles.h" #include #include @@ -68,7 +69,6 @@ public: MainWindow *activeWindow() const; void setActiveWindow(MainWindow *activeWindow); void removeWindow(MainWindow *w); - NodeStyle *nodeStyle(QString name); static QFont LABEL_FONT; // Ui::MainMenu *_mainMenuUi; @@ -77,10 +77,15 @@ public: void newDoc(); void open(); void quit(); + void init(); + + void openTikzStyles(); + TikzStyles *styles() const; + QString styleFile() const; private: -// void createMenu(); - void loadStyles(); + // void createMenu(); + void loadStyles(QString fileName); MainMenu *_mainMenu; ToolPalette *_toolPalette; @@ -88,7 +93,8 @@ private: StylePalette *_stylePalette; QVector _windows; MainWindow *_activeWindow; - QVector _nodeStyles; + TikzStyles *_styles; + QString _styleFile; }; diff --git a/stylepalette.cpp b/stylepalette.cpp index 312f675..8852eb7 100644 --- a/stylepalette.cpp +++ b/stylepalette.cpp @@ -1,8 +1,14 @@ #include "stylepalette.h" #include "ui_stylepalette.h" +#include "tikzit.h" #include +#include +#include #include +#include +#include +#include StylePalette::StylePalette(QWidget *parent) : QDockWidget(parent), @@ -15,6 +21,13 @@ StylePalette::StylePalette(QWidget *parent) : if (geom != QVariant()) { restoreGeometry(geom.toByteArray()); } + + _model = new QStandardItemModel(this); + ui->styleListView->setModel(_model); + ui->styleListView->setViewMode(QListView::IconMode); + ui->styleListView->setMovement(QListView::Static); + + ui->styleListView->setGridSize(QSize(75,60)); } StylePalette::~StylePalette() @@ -22,9 +35,25 @@ StylePalette::~StylePalette() delete ui; } -void StylePalette::on_buttonOpenProject_clicked() +void StylePalette::reloadStyles() +{ + _model->clear(); + QString f = tikzit->styleFile(); + // + ui->styleFile->setText(f); + + QStandardItem *it; + QSize sz(60,60); + + foreach(NodeStyle *ns, tikzit->styles()->nodeStyles()) { + it = new QStandardItem(ns->icon(), ns->name()); + _model->appendRow(it); + } +} + +void StylePalette::on_buttonOpenTikzstyles_clicked() { - qDebug() << "got click"; + tikzit->openTikzStyles(); } void StylePalette::closeEvent(QCloseEvent *event) diff --git a/stylepalette.h b/stylepalette.h index b5c16f1..99dde02 100644 --- a/stylepalette.h +++ b/stylepalette.h @@ -2,6 +2,7 @@ #define STYLEPALETTE_H #include +#include namespace Ui { class StylePalette; @@ -14,12 +15,14 @@ class StylePalette : public QDockWidget public: explicit StylePalette(QWidget *parent = 0); ~StylePalette(); + void reloadStyles(); public slots: - void on_buttonOpenProject_clicked(); + void on_buttonOpenTikzstyles_clicked(); private: Ui::StylePalette *ui; + QStandardItemModel *_model; protected: void closeEvent(QCloseEvent *event) override; diff --git a/stylepalette.ui b/stylepalette.ui index 8068ea4..a8c893f 100644 --- a/stylepalette.ui +++ b/stylepalette.ui @@ -7,13 +7,13 @@ 0 0 250 - 350 + 430 250 - 350 + 430 @@ -23,79 +23,126 @@ Styles - - - - 10 - 12 - 51 - 16 - - - - Project: - - - - - - 60 - 13 - 131 - 16 - - - - - Courier - 75 - true - - - - [default] - - - - - - 195 - 10 - 22 - 22 - - - - New Project - - - - - - - :/images/document-new.svg:/images/document-new.svg - - - - - - 220 - 10 - 22 - 22 - - - - New Project - - - - - - - :/images/document-open.svg:/images/document-open.svg - - + + + + + 2 + + + 0 + + + + + Styles: + + + + + + + + 0 + 0 + + + + + Courier + 75 + true + + + + [default] + + + + + + + New Project + + + + + + + :/images/document-open.svg:/images/document-open.svg + + + + + + + + + + + :/images/refresh.svg:/images/refresh.svg + + + + + + + + + + 8 + true + + + + + + + + 2 + + + + + + 25 + 25 + + + + + + + + + + + + + 25 + 25 + + + + - + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + diff --git a/tikzit.pro b/tikzit.pro index d3a9c62..673730b 100644 --- a/tikzit.pro +++ b/tikzit.pro @@ -49,8 +49,8 @@ SOURCES += src/gui/mainwindow.cpp \ src/gui/mainmenu.cpp \ src/util.cpp \ stylepalette.cpp \ - src/data/project.cpp \ - src/data/tikzassembler.cpp + src/data/tikzassembler.cpp \ + src/data/tikzstyles.cpp HEADERS += src/gui/mainwindow.h \ src/gui/toolpalette.h \ @@ -73,8 +73,8 @@ HEADERS += src/gui/mainwindow.h \ src/gui/mainmenu.h \ src/util.h \ stylepalette.h \ - src/data/project.h \ - src/data/tikzassembler.h + src/data/tikzassembler.h \ + src/data/tikzstyles.h FORMS += src/gui/mainwindow.ui \ src/gui/propertypalette.ui \ diff --git a/tikzit.qrc b/tikzit.qrc index 65cfcd9..effe396 100644 --- a/tikzit.qrc +++ b/tikzit.qrc @@ -18,6 +18,7 @@ images/edge.svg images/node.svg images/select.svg + images/refresh.svg qt.conf -- cgit v1.2.3