Comments (4)
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.
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.
Since this isn't a bug I am closing the ticket
from urho3d.
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)
- Lua Sample 12 coroutine usage HOT 1
- Crash in UI::Update() HOT 3
- ios crash HOT 1
- Dropping 32 bit support HOT 6
- Dropping DirectX 9 support
- Segfault on SetModel in headless mode HOT 4
- Dropping macOS support HOT 4
- DropDownList displayed element is not vertically centered HOT 1
- SDL_VIDEO_DRIVER_X11_SUPPORTS_GENERIC_EVENTS always 0 when build 32-bit version of the engine on 64-bit Linux Mint HOT 5
- Non-Master AnimatedModel Removing Skeleton
- Dot at the end of a doxygen comment HOT 7
- Error building on Windows + MSYS + MinGW-W64 HOT 1
- Dockerize-web broken HOT 2
- Not building on arch Linux. HOT 3
- Toolset Visual Studio 2022 (v143) поломан HOT 12
- Не работает превью ресурсов в редакторе HOT 13
- Использовать нижний регистр для файлов HOT 2
- Build failes on (Void) Linux with make HOT 6
- -gl2 поломан
- Малая понятность CMake скриптов
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from urho3d.