Git Product home page Git Product logo

Comments (6)

andydotxyz avatar andydotxyz commented on June 15, 2024

I'm not sure I agree that the only solution is a messy one... Can't you just get the minimum before turning on wrapping and cache that value?

from fyne.

dweymouth avatar dweymouth commented on June 15, 2024

What about when you need to update the text while it's already displayed (and update the positioning of an icon you want to position immediately to the right of the text string)?

BTW here is a case internally where it would be useful - https://github.com/fyne-io/fyne/blob/develop/dialog/text.go#L38

from fyne.

dweymouth avatar dweymouth commented on June 15, 2024

This could also supersede #4648

from fyne.

andydotxyz avatar andydotxyz commented on June 15, 2024

What I'm not really getting is why it's not just a right aligned icon with text filling the available space

from fyne.

dweymouth avatar dweymouth commented on June 15, 2024

As far as I can tell you can't achieve the desired positioning:

  • If you put the label and icon in an HBox, the text will always be forced to its minSize of "..." (using TruncateEllipsis)
  • If you put the label and icon in a border with label as center, and icon as right, then the icon will float all the way to the right with the available space, rather than immediately to the right of the end of the label's text
  • Writing a custom layout, you still need to know how much space the text takes up if the full thing can be displayed in the label (which is different from label MinSize which is only big enough for "...")

from fyne.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.