#1651 closed bug (fixed)
[BTextControl] When alignment is set to B_ALIGN_RIGHT, the text is not aligned to the right of the control
Reported by: | oco | Owned by: | |
---|---|---|---|
Priority: | normal | Milestone: | R1/beta3 |
Component: | Kits/Interface Kit | Version: | R1/alpha3 |
Keywords: | Cc: | ||
Blocked By: | Blocking: | ||
Platform: | All |
Description
When alignment is set to B_ALIGN_RIGHT, the text is not aligned to the right of the control. The text is only moved a few pixels to the right.
steps to reproduce : The BTextControl is created with BRect(10, 15, 150, 20). ResizingMode is set to B_FOLLOW_LEFT | B_FOLLOW_TOP. flags is set to B_WILL_DRAW | B_NAVIGABLE. Then SetDivider is called with 0. And SetAlignment is called with (B_ALIGN_LEFT, B_ALIGN_LEFT) first. See B_ALIGN_LEFT.png.
Then SetAlignment is called with (B_ALIGN_RIGHT, B_ALIGN_RIGHT). See B_ALIGN_RIGHT.png.
Attachments (4)
Change History (17)
by , 17 years ago
Attachment: | B_ALIGN_LEFT.png added |
---|
comment:1 by , 17 years ago
Owner: | changed from | to
---|
This is obviously a bug in BTextView (which is responsible for the text view inside the BTextControl).
comment:3 by , 17 years ago
I haven't checked, but this bug could have been fixed by stippi's hrev24130, if not before. Can you check ? Or can you provide a test app ?
comment:4 by , 17 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Oh yeah, I tested this when I worked on it and this works just fine now. Didn't know it was broken before my initial changes.
comment:5 by , 13 years ago
Resolution: | fixed |
---|---|
Status: | closed → reopened |
Version: | R1/pre-alpha1 → R1/alpha3 |
I'm reopening this, as the symptom seems to have resurfaced. Not sure if the cause is the same. I'm attaching a small test file (source) that shows the problems.
The test creates a window with a BTextView and a BTextControl, the first directly above the second, both with the alignment set to B_ALIGN_RIGHT. In BeOS, this works as expected: both the view and the control show text aligned at the right of their fields.
In Haiku (tested on hrev42415) things are not so right.
The BTextControl appears with the text left-aligned. The text in the BTextView directly above is not visible at all!
However, if you click the mouse in the region above the visible control, you can select the view. You don't see a cursor immediately, but type a left-arrow and it will appear. Then type right-arrows and the text will appear character by character at the right of the field. The text was initially aligned right out of range!
comment:6 by , 10 years ago
follow-up: 8 comment:7 by , 8 years ago
Just to add, I experience an anomaly with a BTextControl with no label that should be center aligned. The code is a simple:
fLimitControl = new BTextControl("limitfield", NULL, "", NULL); fLimitControl->SetAlignment(B_ALIGN_CENTER, B_ALIGN_CENTER);
and after that I do a bit of DisallowChar() to only allow numbers.
In the attached clip (slow playback as every BeScreenCapture capture...) I press backspace to delete the text "100". Note the cursor already isn' really centered. I then enter characters, the control behaves as if it left aligned, but inset a few dozen pixels. I then delete all characters and re-type them. The cursor now is completely at the left side, no sign of center...
This is a real-word example of Clipdinger's settings window, if anyone wants to reproduce.
by , 8 years ago
Attachment: | btextcontrol_centered.avi added |
---|
Clipdinger's settings window BTextControl
comment:8 by , 8 years ago
Replying to humdinger:
In the attached clip (slow playback as every BeScreenCapture capture...) I press
Sorry to hijack the ticket... this should be fixed in v2.2
comment:10 by , 5 years ago
May be releated to #12608 where BTextControl centering calculations are wrong.
comment:11 by , 5 years ago
Owner: | removed |
---|---|
Status: | reopened → assigned |
comment:12 by , 4 years ago
Milestone: | R1 → R1/beta3 |
---|---|
Resolution: | → fixed |
Status: | assigned → closed |
Fixed in hrev54496.
B_ALIGN_LEFT.png