[haiku-bugs] Re: [Haiku] #6882: BTextControl layout issues

  • From: "yourpalal" <trac@xxxxxxxxxxxx>
  • Date: Wed, 24 Nov 2010 22:51:05 -0000

#6882: BTextControl layout issues
---------------------------------+------------------------------
  Reporter:  axeld               |        Owner:  yourpalal
      Type:  bug                 |       Status:  assigned
  Priority:  normal              |    Milestone:  R1/beta1
 Component:  Kits/Interface Kit  |      Version:  R1/Development
Resolution:                      |     Keywords:
Blocked By:                      |  Has a Patch:  0
  Platform:  All                 |     Blocking:
---------------------------------+------------------------------

Comment (by yourpalal):

 Replying to [comment:2 bonefish]:
 > Replying to [ticket:6882 axeld]:
 > > While fixing bug #6863 I came across the following bugs:
 > > * setting a min size on the text view layout item does change the size
 of the text control, but does not affect the size of the text view, ie. if
 you make the layout item smaller, the text view will go out of the visible
 area.
 >
 > Did you try to call `InvalidateLayout()` on the view? The
 `BAbstractLayoutItem::SetExplicit*()` calls don't do that. Don't know if
 for a reason.
 >

 It seems to me that they probably should, BAbstractLayout::SetExplicit*()
 methods don't either, although they at least call BView::SetExplicit*() in
 some cases, which does cause a layout invalidation.

 > > * the layout item contains 5 pixels spacing for the label - this
 should be done via layout spacing, not being hard-coded.
 >
 > That would be nicer indeed. The current implementation just maps to the
 facilities of the non-layout version and there is no settable spacing. If
 we want to change that, we should do so before R1, since it breaks layouts
 relying on how it works now.
 >
 > > * preferred size is broken (100 pixel width, how so?)
 >
 > This is actually a tricky one. The obvious approach would be to compute
 the preferred width based on the text width. The problem is that it
 changes while typing, so the whole layout would need to be invalidated all
 the time. My only idea for compensating for that would be a more elaborate
 layout invalidation mechanism (track the different properties
 (min/max/preferred size, alignment) individually (e.g. in a flags array
 per layout/view)).
 >
 > Assigning to Alex in case he's interested.

 Thanks, it's now on my todo list :)

-- 
Ticket URL: <http://dev.haiku-os.org/ticket/6882#comment:5>
Haiku <http://dev.haiku-os.org>
Haiku - the operating system.

Other related posts: