Opened 13 years ago
Closed 10 years ago
#8391 closed bug (fixed)
BTextView::SetAlignment Bug?
Reported by: | cipri | Owned by: | axeld |
---|---|---|---|
Priority: | normal | Milestone: | R1 |
Component: | Kits/Interface Kit | Version: | R1/alpha3 |
Keywords: | Cc: | ||
Blocked By: | Blocking: | #11528 | |
Platform: | All |
Description
SetAlignment works fine, but not if you call SetWordWrap(false). Then it's aligned to the left and you can not change it. Is that intentional? Because it would be useful, for example for the BTextControl, so be able to make the text being centered and not aligned to the left.
Attachments (1)
Change History (8)
comment:1 by , 13 years ago
comment:2 by , 10 years ago
PulkoMandy sent me there because of EasyTask #11528 and the non-centered text in the Mouse Preferences' TextControl.
After some checking, it seems that _BTextInput_::AlignTextRect() ignores the value of BTextView::Alignment().
I have a modified functional version of TextInput.cpp which correctly deals with B_ALIGN_LEFT|RIGHT|CENTER alignment values.
I still need to verify that the very few lines I've added are conform to the coding guidelines and to prepare the patch.
comment:3 by , 10 years ago
Blocking: | 11528 added |
---|
comment:4 by , 10 years ago
patch: | 0 → 1 |
---|
comment:5 by , 10 years ago
// The switch statement raises a warning about unprocessed // vertical alignment values
Can't you just add
default: break;
to it to avoid that?
It would look cleaner than chained if I think.
by , 10 years ago
Attachment: | 0001-Fix-alignment-in-TextControl-widgets-fixes-8391.patch added |
---|
comment:6 by , 10 years ago
There you go.
But it makes me think, should I process Vertical Alignment too ? Or do we keep this for now ?
comment:7 by , 10 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Patch applied in hrev48463. Thanks!
For example, even if wordwrap is set to false, the text could be aligned to the left just in the case, that the string/text doesnt fit fully in the visible area. And if it fits, it could align like the user wants.