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:
@@ -361,8 +361,16 @@ ExpanderWindow::MessageReceived(BMessage *msg)
|
|||||||
if (!fExpandingStarted && fListingStarted) {
|
if (!fExpandingStarted && fListingStarted) {
|
||||||
BString string;
|
BString string;
|
||||||
int32 i = 0;
|
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->Insert(string.String());
|
||||||
|
}
|
||||||
fListingText->ScrollToSelection();
|
fListingText->ScrollToSelection();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user