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:
parent
4e9f7b8efa
commit
80873d1bc5
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue