Opened 14 years ago

Closed 7 years ago

Last modified 7 years 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
Platform: All

Description

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 10 years ago.

Download all attachments as: .zip

Change History (19)

comment:1 by diver, 14 years ago

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

comment:2 by diver, 12 years ago

Cc: jonas.kirilla yourpalal added

hrev41243/hrev41250 are possible candidates.

comment:3 by leavengood, 12 years ago

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

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

comment:4 by jonas.kirilla, 11 years ago

Cc: jonas.kirilla removed

comment:5 by pulkomandy, 10 years ago

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 by pulkomandy, 10 years ago

Resolution: fixed
Status: in-progressclosed

Fixed in hrev48529.

comment:7 by diver, 10 years ago

Resolution: fixed
Status: closedreopened

This is how it looks now:

by diver, 10 years ago

Attachment: teammonitor.png added

comment:8 by diver, 10 years ago

Owner: changed from leavengood to pulkomandy
Status: reopenedassigned

comment:9 by diver, 10 years ago

Blocking: 11723 added

comment:10 by vidrep, 10 years ago

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

comment:11 by Janus, 9 years ago

Blocking: 12143 added

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

comment:12 by diver, 9 years ago

Blocking: 12719 added

comment:13 by waddlesplash, 8 years ago

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 by pulkomandy, 8 years ago

Blocking: 12908 added

comment:15 by humdinger, 8 years ago

Blocking: 13479 added

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

comment:16 by axeld, 8 years ago

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 by pulkomandy, 7 years ago

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 by axeld, 7 years ago

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

Note: See TracTickets for help on using tickets.