diff options
author | dec05eba <dec05eba@protonmail.com> | 2020-10-07 21:14:32 +0200 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2020-10-10 10:16:54 +0200 |
commit | 85a1edf8d9c21b830f7ec4a2d42b8e5c1d044845 (patch) | |
tree | ae52bde5c03546123c0837be7df98fc9a3ea9a00 /src/Text.cpp | |
parent | cd94bfc187d6a716f00d218e514409d8e65603c4 (diff) |
Matrix: only show notification on mention if window is not focused or message was received in another room
Also fix caret position in text being incorrect after resize.
Change caret behavior when pressing up/down at the first/last row,
to not go to the beginning/end.
Diffstat (limited to 'src/Text.cpp')
-rw-r--r-- | src/Text.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/Text.cpp b/src/Text.cpp index d58473d..c1adc5d 100644 --- a/src/Text.cpp +++ b/src/Text.cpp @@ -97,6 +97,7 @@ namespace QuickMedia { this->maxWidth = maxWidth; dirty = true; + dirtyCaret = true; } } @@ -567,7 +568,7 @@ namespace QuickMedia } if(closest_index != -1) return closest_index; - return 0; + return startIndex; } // TODO: This can be optimized by using binary search @@ -588,7 +589,7 @@ namespace QuickMedia } if(closest_index != -1) return closest_index; - return num_vertices; + return startIndex; } // TODO: Optimize text editing by only processing the changed parts in updateGeometry. @@ -697,8 +698,7 @@ namespace QuickMedia { updateGeometry(); - if(dirtyCaret || caretMoveDirection != CaretMoveDirection::NONE) - { + if(editable && (dirtyCaret || caretMoveDirection != CaretMoveDirection::NONE)) { updateCaret(); dirtyCaret = false; caretMoveDirection = CaretMoveDirection::NONE; |