diff options
Diffstat (limited to 'src/gui/mainwindow.cpp')
-rw-r--r-- | src/gui/mainwindow.cpp | 23 |
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; |