From 85a1edf8d9c21b830f7ec4a2d42b8e5c1d044845 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Wed, 7 Oct 2020 21:14:32 +0200 Subject: 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. --- src/Text.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/Text.cpp') 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; -- cgit v1.2.3