Opened 6 years ago

Closed 4 years ago

Last modified 4 years ago

#13796 closed bug (fixed)

[TextControl] Text don't align when typing or removing

Reported by: hyche Owned by: nobody
Priority: normal Milestone: R1/beta3
Component: Kits/Interface Kit Version: R1/Development
Keywords: Cc:
Blocked By: Blocking:
Platform: All

Description

How to reproduce:

  • Create a new TextControl object
  • Set alignment of text to B_ALIGN_RIGHT or B_ALIGN_CENTER
  • Type and see

Attachments (4)

align-text-when-changing.patch (648 bytes ) - added by hyche 6 years ago.
0001-TextView-Reimplement-the-behavior-of-ScrollToOffset.patch (1.4 KB ) - added by hyche 6 years ago.
0002-TextInput-Fix-text-alignment-when-typing-or-removing.patch (997 bytes ) - added by hyche 6 years ago.
BeOSTextInputJustificationExamples.mp4 (1.6 MB ) - added by AGMS 6 years ago.
Video of inserting and deleting text in BeOS text input boxes, with right, left, center alignments. Note how scrolling is minimized and it jumps to center when needed.

Download all attachments as: .zip

Change History (19)

by hyche, 6 years ago

comment:1 by hyche, 6 years ago

patch: 01

comment:2 by waddlesplash, 6 years ago

Resolution: fixed
Status: newclosed

Applied in hrev51611. Thanks!

comment:3 by hyche, 6 years ago

Resolution: fixed
Status: closedreopened

Sorry for reopening this, the old patch not scroll text when it grows more than the bounding box. Also the first of new patch may causes some applications misbehave..

Last edited 6 years ago by hyche (previous) (diff)

comment:4 by AGMS, 6 years ago

Noticable in hrev51624 (and a few earlier) in one-line text input boxes: you can type past the visible end. Previously (and in BeOS) it always scrolled the text to keep the cursor visible, now text doesn't move. Try the FileTypes preference, or BeShare chat.

in reply to:  4 comment:5 by hyche, 6 years ago

Replying to Alexander G. M. Smith:

Noticable in hrev51624 (and a few earlier) in one-line text input boxes: you can type past the visible end. Previously (and in BeOS) it always scrolled the text to keep the cursor visible, now text doesn't move.

New patches above fixes this issue. It also fixes when removing text that past the bounding view, the cursor is not visible. But someone should review the patches and merge. As I mentioned earlier in the first of new patches, the new fix changed the behavior of function ScrollToOffset.

Last edited 6 years ago by hyche (previous) (diff)

comment:6 by AGMS, 6 years ago

There's almost always something extra that needs fixing after a change. And details that need thinking about. Should the text be centered/right/left justified when the text input is not active, but scroll to show the cursor when it becomes active? Could even animate that scrolling. But then the user would have trouble clicking on a particular character, if that also activates the text box and starts it scrolling. So best to always keep the cursor visible.

BeOS justifies the text if it fits, and overrides that if the cursor is off screen. It's kind of weird for centered text, always keeping the cursor visible but also centering it around the original cursor position where it last did a jump scroll to move the cursor back on screen. Let me know if you need a video of that. Though if you fix it, you don't have to duplicate that behavior, just need something reasonable for the user.

comment:7 by pulkomandy, 6 years ago

Patches look ok (from my limited knowledge - we should really consider a test suite). Will merge in the evening if no one did it during the day.

in reply to:  6 comment:8 by hyche, 6 years ago

Replying to Alexander G. M. Smith:

Let me know if you need a video of that. Though if you fix it, you don't have to duplicate that behavior, just need something reasonable for the user.

Yes please, I really need it. I am preparing a video demonstrates new behavior of TextView, but somehow the BeScreenRecorder doesn't work.

Replying to Pulkomandy:

Patches look ok (from my limited knowledge - we should really consider a test suite). Will merge in the evening if no one did it during the day.

I will make new patch, because there is a new issue when the cursor is offscreen and then if the window resizes then use leftarrow key back to text beginning, the text not align anymore. I am busy at school work right now, maybe tomorrow patch will be submitted.

comment:9 by AGMS, 6 years ago

Tried to make a video using VirtualBox's video capture. It sort of works for a few seconds, then the video file goes corrupt (tried several times, also under Windows and Linux host OS). I'll try a camera and make a video of the real screen tomorrow.

by AGMS, 6 years ago

Video of inserting and deleting text in BeOS text input boxes, with right, left, center alignments. Note how scrolling is minimized and it jumps to center when needed.

comment:11 by pulkomandy, 6 years ago

patch: 10

comment:12 by waddlesplash, 6 years ago

Original patches reverted in hrev52117.

comment:13 by pulkomandy, 4 years ago

Milestone: R1R1/beta3
Resolution: fixed
Status: reopenedclosed

Fixed in hrev54496.

comment:14 by jscipione, 4 years ago

Reverted in hrev54430. Fixed again in hrev54549.

comment:15 by jscipione, 4 years ago

Reverted in hrev54530, not hrev54430. Fixed again in hrev54549.

Note: See TracTickets for help on using tickets.