Author Topic: Enforce widget min size (label resize height, anchors)  (Read 4802 times)

kittikun

  • Newbie
  • *
  • Thank You
  • -Given: 2
  • -Receive: 5
  • Posts: 46
    • View Profile
Enforce widget min size (label resize height, anchors)
« on: August 21, 2014, 05:48:00 AM »
Hi am trying to show a list of posts in my games. The label size is variable so I designed my control the following way

- Background (Advanced Anchor, bottom set to label bottom)
|- Label (Advanced Anchor, top, left, right set to background


it works perfectly when the text is growing but if the text is only one word or less, the background is shrinking breaking the overall look of the control.

Is there any way to achieve this without the shrinking?

I was thinking that is widgets could be assigned a min value, things would be fixed

Thank you
« Last Edit: August 21, 2014, 10:07:59 PM by kittikun »

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Enforce widget min size (label resize height, anchors)
« Reply #1 on: August 22, 2014, 03:33:42 AM »
Background is anchored to label, and label is anchored to background? You have a circular anchor there? I'm surprised that works at all to be honest. You should be anchoring one to the other, not to each other. You can always create a third widget (ALT+SHIFT+W) to serve as the common container for the two if needed.

kittikun

  • Newbie
  • *
  • Thank You
  • -Given: 2
  • -Receive: 5
  • Posts: 46
    • View Profile
Re: Enforce widget min size (label resize height, anchors)
« Reply #2 on: August 22, 2014, 07:07:17 AM »
Yes this could work but I ended up writing a script for that :)