SetWordWrap() did not work when the BTextView was not (yet) attached to a
window this fixes the tool tip size/layout in apps that use BubbleHelper (Beam, WonderBrush, ...). Thanks to Rene and Stefano for sending me a test application. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28489 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -2348,28 +2348,27 @@ BTextView::SetWordWrap(bool wrap)
|
|||||||
{
|
{
|
||||||
if (wrap == fWrap)
|
if (wrap == fWrap)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (Window() != NULL) {
|
bool updateOnScreen = fActive && Window() != NULL;
|
||||||
if (fActive) {
|
if (updateOnScreen) {
|
||||||
// hide the caret, unhilite the selection
|
// hide the caret, unhilite the selection
|
||||||
if (fSelStart != fSelEnd)
|
if (fSelStart != fSelEnd)
|
||||||
Highlight(fSelStart, fSelEnd);
|
Highlight(fSelStart, fSelEnd);
|
||||||
else {
|
else {
|
||||||
_HideCaret();
|
_HideCaret();
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fWrap = wrap;
|
|
||||||
_Refresh(0, fText->Length(), true, true);
|
|
||||||
|
|
||||||
if (fActive) {
|
|
||||||
// show the caret, hilite the selection
|
|
||||||
if (fSelStart != fSelEnd && fSelectable)
|
|
||||||
Highlight(fSelStart, fSelEnd);
|
|
||||||
else
|
|
||||||
_ShowCaret();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fWrap = wrap;
|
||||||
|
_Refresh(0, fText->Length(), true, true);
|
||||||
|
|
||||||
|
if (updateOnScreen) {
|
||||||
|
// show the caret, hilite the selection
|
||||||
|
if (fSelStart != fSelEnd && fSelectable)
|
||||||
|
Highlight(fSelStart, fSelEnd);
|
||||||
|
else
|
||||||
|
_ShowCaret();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user