aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app.go11
1 files changed, 9 insertions, 2 deletions
diff --git a/app.go b/app.go
index 89b4438..6dcbe5c 100644
--- a/app.go
+++ b/app.go
@@ -1461,7 +1461,14 @@ func (m *AppModel) handleSidebarClick(x, y int) {
// Tools: rows 16+, then 3 brush width rows
toolRow := relY - 16
if toolRow >= 0 && toolRow < 8 {
- m.tool = Tool(toolRow)
+ newTool := Tool(toolRow)
+ if m.tool != newTool && m.mode == ModeTextEdit {
+ m.mode = ModeNormal
+ m.movingLabel = -1
+ m.textEditing = false
+ m.textInput.Blur()
+ }
+ m.tool = newTool
}
bwRow := relY - 25
if bwRow >= 0 && bwRow < 3 {
@@ -1926,7 +1933,7 @@ func (m *AppModel) renderGrid(gw, gh int) string {
}
// Live text preview with cursor
- if m.mode == ModeTextEdit {
+ if m.mode == ModeTextEdit && m.tool == ToolText {
text := m.textInput.Value()
cursorCh := ""
if m.textInput.Focused() {