Tracker: always shrink the text input when renaming

When renaming an entry at the edge of a PoseView, the input
would not resize as usual. This change ensures the input
becomes resizable again if the text becomes small enough.
Fixes #3438.

Signed-off-by: Augustin Cavalier <waddlesplash@gmail.com>
This commit is contained in:
Gabriel Maia 2016-09-07 21:47:16 +00:00 committed by Augustin Cavalier
parent 4e9f7b8efa
commit 80873d1bc5
1 changed files with 9 additions and 2 deletions

View File

@ -333,11 +333,18 @@ TextViewFilter(BMessage* message, BHandler**, BMessageFilter* filter)
BTextView* textView = dynamic_cast<BTextView*>(
scrollView->FindView("WidgetTextView"));
if (textView != NULL) {
BRect textRect = textView->TextRect();
BRect rect = scrollView->Frame();
if (rect.right + 3 > poseView->Bounds().right
|| rect.left - 3 < 0)
if (rect.right + 5 > poseView->Bounds().right
|| rect.left - 5 < 0)
textView->MakeResizable(true, NULL);
if (textRect.Width() + 10 < rect.Width()) {
textView->MakeResizable(true, scrollView);
// make sure no empty white space stays on the right
textView->ScrollToOffset(0);
}
}
}