summaryrefslogtreecommitdiff
path: root/src/gui/mainwindow.cpp
diff options
context:
space:
mode:
authorAleks Kissinger <aleks0@gmail.com>2018-03-17 19:01:02 -0400
committerAleks Kissinger <aleks0@gmail.com>2018-03-17 19:01:02 -0400
commit3cea1514203a451c0a8806d276807863b463a78f (patch)
treed6850ab0f41a6d85f3504e8c92fcecf79b37689b /src/gui/mainwindow.cpp
parent39c2c74c664a6c770639ead8f45322352cacb997 (diff)
added saving, style application, and copy and paste
Diffstat (limited to 'src/gui/mainwindow.cpp')
-rw-r--r--src/gui/mainwindow.cpp23
1 files changed, 19 insertions, 4 deletions
diff --git a/src/gui/mainwindow.cpp b/src/gui/mainwindow.cpp
index eac7c44..26e19b6 100644
--- a/src/gui/mainwindow.cpp
+++ b/src/gui/mainwindow.cpp
@@ -25,12 +25,11 @@ MainWindow::MainWindow(QWidget *parent) :
setAttribute(Qt::WA_DeleteOnClose, true);
_tikzDocument = new TikzDocument(this);
- _tools = new ToolPalette(this);
- addToolBar(_tools);
+ _toolPalette = new ToolPalette(this);
+ addToolBar(_toolPalette);
- _tikzScene = new TikzScene(_tikzDocument, _tools, this);
+ _tikzScene = new TikzScene(_tikzDocument, _toolPalette, this);
ui->tikzView->setScene(_tikzScene);
- _fileName = "";
_pristine = true;
@@ -80,10 +79,26 @@ void MainWindow::changeEvent(QEvent *event)
{
if (event->type() == QEvent::ActivationChange && isActiveWindow()) {
tikzit->setActiveWindow(this);
+ tikzit->stylePalette()->raise();
}
QMainWindow::changeEvent(event);
}
+void MainWindow::updateFileName()
+{
+ setWindowTitle("TiKZiT - " + _tikzDocument->shortName());
+}
+
+void MainWindow::refreshTikz()
+{
+ ui->tikzSource->setText(_tikzDocument->tikz());
+}
+
+ToolPalette *MainWindow::toolPalette() const
+{
+ return _toolPalette;
+}
+
TikzDocument *MainWindow::tikzDocument() const
{
return _tikzDocument;