Revert "IK: align BTextView text rect/fix alignment"
This reverts commit a9b301871d.
hrev54496
Change-Id: Ife3c834ad98d330f04976d9adf3b1553e7aca034
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3153
Reviewed-by: Axel Dörfler <[email protected]>
This commit is contained in:
@@ -1,12 +1,11 @@
|
||||
/*
|
||||
* Copyright 2001-2020 Haiku Inc. All rights reserved.
|
||||
* Copyright 2001-2015, Haiku Inc.
|
||||
* Distributed under the terms of the MIT License.
|
||||
*
|
||||
* Authors:
|
||||
* Frans van Nispen ([email protected])
|
||||
* Stephan Aßmus <[email protected]>
|
||||
* Ingo Weinhold <[email protected]>
|
||||
* John Scipione <[email protected]>
|
||||
*/
|
||||
|
||||
|
||||
@@ -638,6 +637,7 @@ void
|
||||
BTextControl::SetAlignment(alignment labelAlignment, alignment textAlignment)
|
||||
{
|
||||
fText->SetAlignment(textAlignment);
|
||||
fText->AlignTextRect();
|
||||
|
||||
if (fLabelAlign != labelAlignment) {
|
||||
fLabelAlign = labelAlignment;
|
||||
@@ -911,7 +911,6 @@ BTextControl::DoLayout()
|
||||
// place the text view and set the divider
|
||||
textFrame.InsetBy(kFrameMargin, kFrameMargin);
|
||||
BLayoutUtils::AlignInFrame(fText, textFrame);
|
||||
fText->SetTextRect(textFrame.OffsetToCopy(B_ORIGIN));
|
||||
|
||||
fDivider = divider;
|
||||
|
||||
@@ -1116,6 +1115,7 @@ BTextControl::_InitText(const char* initialText, const BMessage* archive)
|
||||
|
||||
SetText(initialText);
|
||||
fText->SetAlignment(B_ALIGN_LEFT);
|
||||
fText->AlignTextRect();
|
||||
}
|
||||
|
||||
// Although this is not strictly initializing the text view,
|
||||
@@ -1171,6 +1171,7 @@ BTextControl::_LayoutTextView()
|
||||
frame.InsetBy(kFrameMargin, kFrameMargin);
|
||||
fText->MoveTo(frame.left, frame.top);
|
||||
fText->ResizeTo(frame.Width(), frame.Height());
|
||||
fText->AlignTextRect();
|
||||
|
||||
TRACE("width: %.2f, height: %.2f\n", Frame().Width(), Frame().Height());
|
||||
TRACE("fDivider: %.2f\n", fDivider);
|
||||
|
||||
Reference in New Issue
Block a user