Comments (2)
If resizing changes the layout it's because the layout as defined by the constraints is not stable; this is usually caused by too few, or contradictory constraints.
Let's break down the VFL:
|-[w1(200)]-(>=0)-|
expands to:- the parent's leading attribute is equal to the leading attribute of
w1
, minus a constant default spacing - the width attribute of
w1
is set to be a constant value of 200 - the trailing attribute of the parent is equal to, or greater than the trailing attribute of
w1
, plus a constant spacing of 0
- the parent's leading attribute is equal to the leading attribute of
All these constraints are set to be required to solve the layout.
This is similar to the line below of |-[w2(300)]-(>=0)-|
but the width is now different. The solver will try to size the parent into something that can contain both w1
and w2
, but since there's no way to get a stable layout with all these required constraints, you're going to get into an unstable layout.
You can set a priority; for instance, you may want to lower the priority of the spacing between the trailing attribute of w1
and the parent's own trailing attribute; this would give precedence to the constraint between w2
and the parent.
You can also remove the constraint between the trailing attribute of w1
and the trailing attribute of the parent; after all, if you hardcode the width of w1
and you expect w2
to be bigger, then you don't need to attach the trailing edges together.
from emeus.
I don't understand though why the >=
operators don't make the layout stable. You can satisfy all the required constraints with a width of (300 + default spacing). Or am I misunderstanding how the greater-or-equal operator works? It sounds like instead of (>=0)
I should be adding a (==0)
constraint with a low priority.
from emeus.
Related Issues (14)
- Constraints should take height-for-width widget sizes into account HOT 3
- Segfault when adding widget to child of layout that has not been laid out yet
- Emeus Constraint Layout does not play well with nested layout inside GtkGrid
- Build fails with FileNotFoundError: [Errno 2] No such file or directory: 'gtkdoc-scan' HOT 1
- unclear unref
- bad weak ref
- unclear strengths
- misleading comment HOT 1
- shrinkability issues HOT 1
- obvious constraints HOT 2
- Build VAPI HOT 3
- Example not rendered in editor HOT 1
- Support eVFL in the EmeusVflParser HOT 1
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 emeus.