Browse files

[gui] don't set <width> to the parent if <width>auto</width> is speci…

  • Loading branch information...
1 parent 29aad47 commit 650829f8ab950f5bc2c98233aa67c91bf82697a7 Jonathan Marshall committed Jan 23, 2014
Showing with 1 addition and 1 deletion.
  1. +1 −1 xbmc/guilib/GUIControlFactory.cpp
@@ -806,7 +806,7 @@ CGUIControl* CGUIControlFactory::Create(int parentID, const CRect &rect, TiXmlEl
(labelInfo.align & XBFONT_RIGHT))
posX -= width;
- if (!width)
+ if (!width && !minWidth) // no width specified, so compute from parent
width = max(rect.Width() - posX, 0.0f);
if (!GetDimensions(pControlNode, "top", "bottom", "centertop", "centerbottom", "height", rect.Height(), posY, height, minHeight))

5 comments on commit 650829f


koying replied Jan 23, 2014

Somehow, this breaks the Quartz skin, which I find annoying ;)


jmarshallnz replied Jan 23, 2014

Please get the Quartz author to open a post on the forum and ping me.

Shouldn't this fallback to skin res width / height if parent width is None? Reason for brake in Quartz is that there is no parent width available.

See pecinko/quartz@3b7389c


jmarshallnz replied Jan 26, 2014

It will, yes. The problem is where you have 2 auto-sizing containers: A grouplist for example (which with current code defaults to auto-sizing) containing auto-sizing labels. You add the first label with auto and it gives a minimum width of 1 pixel (it has to be something other than zero) and a maximum width of the parent's width (1200 or whatever). Once that label is added, however, the width of the auto-sizing list is 1, which means the second label inherits that as it's maximum width, and it doesn't render.

The alternate is switching the grouplist to not auto-size by default. Will look into it.


jmarshallnz replied Jan 26, 2014

6e65fa1 should do the trick.

Please sign in to comment.