212 this->ui->tabs->setCurrentWidget(document); |
212 this->ui->tabs->setCurrentWidget(document); |
213 document->restoreSplitterState(this->documentSplitterState); |
213 document->restoreSplitterState(this->documentSplitterState); |
214 connect(document, &Document::splitterChanged, this, &MainWindow::handleDocumentSplitterChange); |
214 connect(document, &Document::splitterChanged, this, &MainWindow::handleDocumentSplitterChange); |
215 connect(document, &Document::mouseClick, this, &MainWindow::canvasMouseReleased); |
215 connect(document, &Document::mouseClick, this, &MainWindow::canvasMouseReleased); |
216 connect(document, &Document::mouseMove, this, &MainWindow::canvasMouseMoved); |
216 connect(document, &Document::mouseMove, this, &MainWindow::canvasMouseMoved); |
|
217 document->setCanvasOverpaintCallback([&](Canvas* canvas, QPainter* painter) |
|
218 { |
|
219 if (this->selectedTool != nullptr) |
|
220 { |
|
221 this->selectedTool->overpaint(canvas, painter); |
|
222 } |
|
223 }); |
217 } |
224 } |
218 |
225 |
219 void MainWindow::runSettingsEditor() |
226 void MainWindow::runSettingsEditor() |
220 { |
227 { |
221 SettingsEditor settingsEditor{&this->settings, this->defaultKeyboardShortcuts, this}; |
228 SettingsEditor settingsEditor{&this->settings, this->defaultKeyboardShortcuts, this}; |