Have square images in the following sizes:
* 20
* 100
* 150
* 200
* 300
and place them in a can-shrink Picture allocated at the sizes:
* 200x100
* 100x200
and set align to center/center.
That's 10 combinations and they should all do the right thing.
This fixes fallout from 3742fabae0 where
we would no longer allocate widgets to their natural size when
align flags where used.
GtkPicture wants to be allocated at 100% in that case, so a picture with
a 100x100 image inside a 200x200 window should be allocated 100x100.
The new adjustment code now does the following (for width-for-height
instead of height-for-width, swap width and height in the following):
1. query the minimum width for the allocated height
2. query the natural width
3. compute the maximum of (1) and (2)
4. set the widget width to the minimum of (3) and the allocated
width.
5. compute the natural height for (4)
6. set the widget height to the minimum of (5) and the allocated height.
But don't call it too early, we only want to call it once we have
prepared the target.
This way, we guarantee that a GL context is always available and that it
is bound to the correct target.
This CSS:
calc(5px+3px)
is wrong because it gets broken to:
calc( 5px +3px )
which is 2 numbers inside the calc, and what you want is:
calc( 5px + 3px )
but you need to add a space to get this, like so:
calc(5px + 3px)
which is the recommended way to write calc() statements.
So whenever we encounter an error, check if the next token is a signed
number and if so, include it in the error message.
This is an alternative to gdk_surface_create_gl_context() when the
context is meant to only draw to textures.
This is useful in the testsuite or in GStreamer or with GLArea,
basically whenever we want to do GL stuff but don't need to actually
draw anything on screen.
A bunch of code will need to be updated to deal with context->surface
being NULL.
in order to make builds reproducible.
See https://reproducible-builds.org/ for why this is good
This was suggested by Matthias Clasen as an alternative to MR !3929
When adjusting allocations, don't query height for the current width,
but query it for the adjusted width.
And adjust width not to the width-for-any-height, but to
width-for-allocated-height.
Even when we have tons of width available, still do the wrapping at
max-width-chars.
This is what happened in GTK3, too, but it happened automatically
because GTK3 did for_size = MIN (for_size, nat_size) and GTK4 does not.
So we do this manually in the label now.
Fixes the label-sizing.ui reftest.
Ideally this would be using box layout, but it overrides measure() so it's
not possible - so reimplement it instead. Fix an accidentally int division
along the way.