Expander: Smarter window sizing

* When using the "Show Content" feature, enlarge the window horizontally rather than wrapping.

Ref: enhancement request #3797.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33073 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Philippe Saint-Pierre 2009-09-12 02:59:50 +00:00
parent 8a0ea31a5a
commit 80c5515366
1 changed files with 9 additions and 1 deletions

View File

@ -361,8 +361,16 @@ ExpanderWindow::MessageReceived(BMessage *msg)
if (!fExpandingStarted && fListingStarted) {
BString string;
int32 i = 0;
while (msg->FindString("output", i++, &string) == B_OK)
while (msg->FindString("output", i++, &string) == B_OK) {
// expand the window if we need...
float delta = fListingText->StringWidth(string.String())
- fListingText->Frame().Width();
if (delta > 0) {
ResizeTo(Frame().Width() + delta,
Frame().Height());
}
fListingText->Insert(string.String());
}
fListingText->ScrollToSelection();
}