|
@@ -1261,7 +1261,14 @@ final class CanvasToolsPanel: NSView, AppearanceRefreshable {
|
|
|
|
|
|
|
|
for tool in CanvasTool.toolbarTools {
|
|
for tool in CanvasTool.toolbarTools {
|
|
|
let button = CanvasToolButton(tool: tool)
|
|
let button = CanvasToolButton(tool: tool)
|
|
|
- button.onClick = { [weak self] in self?.selectTool(tool) }
|
|
|
|
|
|
|
+ button.onClick = { [weak self] in
|
|
|
|
|
+ guard let self else { return }
|
|
|
|
|
+ if self.activeTool == tool {
|
|
|
|
|
+ self.selectTool(.pointer)
|
|
|
|
|
+ } else {
|
|
|
|
|
+ self.selectTool(tool)
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
toolButtons[tool] = button
|
|
toolButtons[tool] = button
|
|
|
toolStack.addArrangedSubview(button)
|
|
toolStack.addArrangedSubview(button)
|
|
|
}
|
|
}
|