Opened 18 months ago

Last modified 10 months ago

#13796 reopened bug

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

Reported by: hyche Owned by: nobody
Priority: normal Milestone: R1
Component: Kits/Interface Kit Version: R1/Development
Keywords: Cc:
Blocked By: Blocking:
Has a Patch: no 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 18 months ago.
0001-TextView-Reimplement-the-behavior-of-ScrollToOffset.patch (1.4 KB) - added by hyche 18 months ago.
0002-TextInput-Fix-text-alignment-when-typing-or-removing.patch (997 bytes) - added by hyche 18 months ago.
BeOSTextInputJustificationExamples.mp4 (1.6 MB) - added by AGMS 18 months 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 (16)

Changed 18 months ago by hyche

comment:1 Changed 18 months ago by hyche

Has a Patch: set

comment:2 Changed 18 months ago by waddlesplash

Resolution: fixed
Status: newclosed

Applied in hrev51611. Thanks!

comment:3 Changed 18 months ago by hyche

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 18 months ago by hyche (previous) (diff)

comment:4 Changed 18 months ago by AGMS

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.

comment:5 in reply to:  4 Changed 18 months ago by hyche

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 18 months ago by hyche (previous) (diff)

comment:6 Changed 18 months ago by AGMS

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 Changed 18 months ago by 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.

comment:8 in reply to:  6 Changed 18 months ago by hyche

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 Changed 18 months ago by AGMS

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.

Changed 18 months ago by AGMS

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 Changed 16 months ago by pulkomandy

Has a Patch: unset

comment:12 Changed 10 months ago by waddlesplash

Original patches reverted in hrev52117.

Note: See TracTickets for help on using tickets.