Code Monkey home page Code Monkey logo

Comments (5)

davidedc avatar davidedc commented on May 25, 2024

Or perhaps there could/should be an option for a row to be "vertically fitting" all the proportional elements according to their relative height proportions, just it is horizontally-fitting all the proportional elements according to the relative horizontal proportions. Is there such a way to do that? (so in the example 2 above, the orange bar would be 4 times as tall as the blue one).

from cuis-smalltalk-dev.

jvuletich avatar jvuletich commented on May 25, 2024

Davide, we could modify the behavior to be as you suggest. I even did it to play a bit with it (and haven't included the tweak in the update stream).
For minor direction layout (height in your example), the parameter (2.0 and 0.5 in your example) are taken as fractions of the available space. If a fraction greater than 1 is specified, it is considered 1. I think it is simple, and enough.
For major direction, I scaled everything by the sum of all fractions, but only if that sum is greater than one. This makes it easy to keep adding widgets without needing to tweak the fractions of all the previous ones. But it also allows exact control (by giving fractions that sum to less than 1).
Does this makes sense? Do you still see a reason for changing the minor (vertical) layout?

from cuis-smalltalk-dev.

davidedc avatar davidedc commented on May 25, 2024

Got it. I don't have a practical case. I'm going through the code and I was wondering if having only one unique way of calculating the proportions could be enough, it would seem simpler as opposed to having two, but maybe a matter of taste.

(which brings me to another question - the "adjustHorizontallyByAt" and "adjustVerticallyByAt" seem to be symmetrical methods that could be handled by one same function. Perhaps another case of having "one way of doing both things", perhaps would be simpler? )

from cuis-smalltalk-dev.

jvuletich avatar jvuletich commented on May 25, 2024

Well maybe those could be unified. If I remember correctly, when I wrote them I didn't find a trivial way to do it, without a significant performance penalty.

from cuis-smalltalk-dev.

jvuletich avatar jvuletich commented on May 25, 2024

Please email https://lists.cuis.st/mailman/listinfo/cuis-dev if you think this deserves further discussion.

from cuis-smalltalk-dev.

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.