397 |
397 |
398 void MainWindow::selectTool(BaseTool* tool) |
398 void MainWindow::selectTool(BaseTool* tool) |
399 { |
399 { |
400 if (tool != nullptr && tool != this->selectedTool) |
400 if (tool != nullptr && tool != this->selectedTool) |
401 { |
401 { |
|
402 if (this->selectedTool != nullptr) |
|
403 { |
|
404 this->selectedTool->reset(); |
|
405 } |
402 this->selectedTool = tool; |
406 this->selectedTool = tool; |
403 for (auto&& pair : items(this->toolActions)) |
407 for (auto&& pair : items(this->toolActions)) |
404 { |
408 { |
405 pair.value->setChecked(pair.key == tool); |
409 pair.value->setChecked(pair.key == tool); |
406 } |
410 } |