Giter Site home page Giter Site logo

Comments (4)

cadaver avatar cadaver commented on May 2, 2024

This is actually as expected, but I can see how it would seem like an error.

The child button's right alignment is incompatible with the horizontal layouting, which happens from left to right. As soon as fileText's layout is updated (when the container resizes), the child's alignment is forced to left.

As the button is the only child for the fileText, you should be able to let the fileText remain in free layouting mode.

Suggestions for less confusing behavior are welcome. Perhaps children that are not left/top -aligned should be ignored in layouting calculations instead of forcing them to left/top alignment, or alternatively the alignment could be checked earlier and warnings produced if it wasn't left/top.

Also, fileText.AddChild(fileText) is suspicious, fortunately it should be a no-op.

from urho3d.

friesencr avatar friesencr commented on May 2, 2024

suspicious is a nice word 😄 I was thinking pants was a better word. I am looking forward to getting this beast done. After staring at the same code for a while it sort of loses its meaning to me.

I wrote a ui for an engine. It was tough! https://github.com/friesencr/le_gui

My engine had to take several passes to calculate everything. It had like 5 phases and control events happened in the middle. I used .NET Webforms as some inspiration. Do not tell a soul! I made the mistake of not making it reactive enough so it didn't perform the best either. It did have some cool hierarchical frame buffer caching which was kind of neat. It was writen in lua and used some cool metatable stuff to proxy the getters/setters. Since I don't know opengl it I didn't know how to the scissor thing that Urho does. The layout stuff was by far the hardest though. Every feature I added made the logic more and more brittle and so my sanity.

This is probably not worth reading but I will attempt to recreate my logic from memory.
Within each 'UIElement' I had something called a 'row'. The row was broken into 3 pieces. Left, middle and right stuff. If an object was left aligned it went into the left box. And so the right. What was left over from the left and the right was given to the middle.

I will have to tinker around with it for a while. I had tried using more complex uielements to get the same effect but the styling seems to work best when the row item is a Text. If there was a concise way of explaining the ordering and render logic it would fit well in the documentation. I have 10 years of css/box models taking up my pea brain.

http://cadaver.homeftp.net/urho3d/a00033.html

from urho3d.

friesencr avatar friesencr commented on May 2, 2024

Since this isn't a bug I am closing the ticket

from urho3d.

cadaver avatar cadaver commented on May 2, 2024

Just noticed that the editor is also relying on right alignment and horizontal layouts for the accelerator texts. I'll reopen this so that the underlying issue isn't forgotten. I'll see if there's a clear workaround and try to document it.

from urho3d.

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.