Opened 8 years ago

Closed 18 months ago

Last modified 18 months ago

#7560 closed bug (fixed)

BTextView does not properly handle wrapped lines

Reported by: humdinger Owned by: pulkomandy
Priority: normal Milestone: R1
Component: Kits/Interface Kit Version: R1/Development
Keywords: Cc: yourpalal
Blocked By: Blocking: #11723, #12143, #12719, #12908, #13479
Has a Patch: no Platform: All


This is hrev41650 pre-alpha3.

When you invoke the TeamMonitor (CTRL+ALT+DEL) for the first time, and click on an entry in the list of teams, the scroll view height increases with a nice little jump.

Attachments (1)

teammonitor.png (18.6 KB) - added by diver 4 years ago.

Download all attachments as: .zip

Change History (19)

comment:1 Changed 8 years ago by diver

Layout is wrong until you select any process. I think it got broken during TeamMonitor localization.

comment:2 Changed 7 years ago by diver

Cc: jonas.kirilla yourpalal added

hrev41243/hrev41250 are possible candidates.

comment:3 Changed 7 years ago by leavengood

Owner: changed from korli to leavengood
Status: newin-progress

Taking ownership since I've been working on Team Monitor lately.

comment:4 Changed 5 years ago by jonas.kirilla

Cc: jonas.kirilla removed

comment:5 Changed 4 years ago by pulkomandy

hrev41250 seems to be a likely candidate. It introduces the AllShowingTextView which sets its min size when FrameResized is called.

I see two possible problems with this:

  • The size could be set earlier, as soon as SetText is called. This may avoid a resize > set min size > try to resize again path, but more important is that the text can be changed at any time, and there is no guarantee that FrameResized will be called after it does.
  • Only the minimal size is set, and that doesn't prevent the view from growing bigger than it. As a result, the bottom part of the window, which is a BCardLayout, is resized only when the other view added to it (the one with the app icon and name) is shown, this one fully constraints the view size and fixes the layout.

comment:6 Changed 4 years ago by pulkomandy

Resolution: fixed
Status: in-progressclosed

Fixed in hrev48529.

comment:7 Changed 4 years ago by diver

Resolution: fixed
Status: closedreopened

This is how it looks now:

Changed 4 years ago by diver

Attachment: teammonitor.png added

comment:8 Changed 4 years ago by diver

Owner: changed from leavengood to pulkomandy
Status: reopenedassigned

comment:9 Changed 4 years ago by diver

Blocking: 11723 added

comment:10 Changed 4 years ago by vidrep

Team monitor window still looks the same as shown above in latest build hrev49000.

comment:11 Changed 4 years ago by Janus

Blocking: 12143 added

(In #12143) This is a duplicate of #7560.

comment:12 Changed 3 years ago by diver

Blocking: 12719 added

comment:13 Changed 3 years ago by waddlesplash

Component: Servers/input_serverKits/Interface Kit
Summary: TeamMonitor's scroll view grows on first clickBTextView does not properly handle wrapped lines

It's actually a BTextView layout bug: try resizing the window horizontally, you'll see that the BTextView will grow horizontally and collapse vertically, and then the buttons will be fully visible.

comment:14 Changed 3 years ago by pulkomandy

Blocking: 12908 added

comment:15 Changed 2 years ago by humdinger

Blocking: 13479 added

(In #13479) Thanks for the ticket, but as discussed at the forums, the issue is already tracked with #7560.

comment:16 Changed 2 years ago by axeld

It's not a BTextView bug, it's an API inconvenience, you'll have to call BWindow::ResizeToPreferred().

However, when I add this (to BootPromptWindow.cpp, line 259), the window size is only sometimes correct, but mostly way too large. I haven't had the time to investigate, but this is definitely a bug somewhere (and that might even be located in BTextView, after all).

comment:17 Changed 18 months ago by pulkomandy

Resolution: fixed
Status: assignedclosed

Fixed TeamMonitor in hrev51582 by setting various explicit constraints to not get a too small window. Also made similar changes to FirstBootPrompt

In both cases the issue is similar: nothing forces the window to be very wide, so ResizeToPreferred ends up asking the BTextView a HeightForWidth for a very small width (52px in my case). This causes the text view to lay out one word per line and return a very large height.

By constraining the window width to a sane minimal size, we can avoid the problem. So I now agree with Axel, there isn't really a bug here and we just need to be more careful with the way we lay things out in windows.

comment:18 Changed 18 months ago by axeld

Great, makes sense! Thanks for finally getting to the bottom of this!

Note: See TracTickets for help on using tickets.