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

  • From: "axeld" <trac@xxxxxxxxxxxx>
  • Date: Tue, 23 Nov 2010 16:53:56 -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 axeld):

 Replying to [comment:2 bonefish]:
 > Did you try to call `InvalidateLayout()` on the view? The
 `BAbstractLayoutItem::SetExplicit*()` calls don't do that. Don't know if
 for a reason.

 I did not try that, actually. However, since the views weren't even added
 to a layout, I'm not sure if that would have had any effect. Shouldn't you
 know at least if there is a reason that they don't call it, though? :-)

 > > * 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.

 I guess this would only come into play when there is no parent layout
 involved? This would also finally deprecate the {{{SetDivider()}}} stuff
 (which should then have no effect anymore).

 > > * 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)).

 Ah, indeed. One solution (that would follow what Java does, for example)
 would be not to invalidate the layout on {{{SetText()}}} - this way, the
 size would only actually matter when the layout is manually invalidated. I
 am not saying I like this solution, though :-)

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

Other related posts: