Commit graph

50 commits

Author SHA1 Message Date
Tobias Hunger
aea4ecca99 Apply pre-commit hooks to all files 2021-08-17 22:38:16 +02:00
Olivier Goffart
ffccef4e0c Examples: replace all _ by - in identifiers 2021-08-10 22:21:01 +02:00
Simon Hausmann
9f06136064 Fix slide puzzle auto mode checkbox
After commit 1eb54a4743,
mouse events would get clipped away and make it
impossible to tick the checkbox.
2021-07-15 18:57:50 +02:00
Olivier Goffart
13bd828b96 Update license date 2021-07-02 15:55:54 +02:00
Simon Hausmann
76eeabd216 Try to fix the auto-play checkbox with DejaVu
Amend b4955d2415 as the checkbox needs to scale
down a bit more with DejaVu.
2021-06-30 17:09:34 +02:00
Simon Hausmann
b4955d2415 Fix shuffle and auto-play checkbox in slide puzzle
Text's behavior right now is to clip on a line basis, so with the given
font-size for these two elements, the glyphs aren't shown at all because
the ascent + descent that's use for the clip test is bigger than the
maximum height, despite the actual glyphs fitting.

For now, reduce the font-size slightly to make the glyphs fit.
2021-06-30 16:10:24 +02:00
Simon Hausmann
a7ce64657c Restore source compatibility for drop-shadow-blur
Let's keep source compatibility and define `drop-shadow-blur` to be a radius.
The CSS spec says that the standard deviation is half of the radius.

We just need to scale again and increase the shadow rect to make sure that no borders are visible.
2021-05-20 12:14:05 +02:00
Simon Hausmann
8d278faac2 Make the drop shadow more subtle in the slide puzzle
In the current upstream version it's very very subtle.
2021-05-20 09:02:45 +02:00
Simon Hausmann
bb7b301b10 GL backend: new box drop shadow implementation
This replaces the box gradient with a new implementation that
behaves like the HTML Canvas element, by applying a gaussian
blur to the alpha of the rectangle to shadow.

The drop-shadow-blur property is changed to be now just a "level", like
the HTML Canvas shadowBlur property, which is defined to be half of the
standard deviation of the gaussian blur to be applied.
2021-05-20 08:50:02 +02:00
Olivier Goffart
223d489ba0 Fix the slide puzzle
It panics at runtime because of binding loop involving layout
2021-05-18 11:10:51 +02:00
Simon Hausmann
d842760a41 Minor tweak to slide puzzle theme data structure
Use a brush instead of color as property type for those theme properties
that can be brushes.

This allows to use gradients for backgrounds for live demonstrations
2021-04-26 14:10:40 +02:00
Olivier Goffart
91ed04a72c Make length (still the default for all property) be the logical length
And a new `physical_length` is now the physical_length unit

Note: this does not change the runtime part yet
2021-04-21 17:15:19 +02:00
Simon Hausmann
cb70f58990 Port the slide puzzle over to specifying the custom font in .60 2021-04-14 09:49:51 +02:00
Olivier Goffart
80b236489e Add a clip property that can be set to the Rectangle 2021-04-12 18:48:43 +02:00
Olivier Goffart
f7a76dc352 Add ImageFit::cover, and fix ImageFit::contain 2021-02-09 10:52:04 +01:00
Simon Hausmann
c771bcff45 Print a warning when trying to animate deprecated properties 2021-02-02 22:58:54 +01:00
Simon Hausmann
e61529976e Issue warnings when creating bindings against deprecated properties 2021-02-02 22:42:02 +01:00
Simon Hausmann
1d6a0b0b9c Improve drop shadow visual in the slide puzzle
Re-apply d03da6b57b to give the shadow
a round corner -- the clip doesn't have one.
2021-01-28 16:23:37 +01:00
Olivier Goffart
23a511b380 Replace img!"..." by @image-url("...") 2021-01-28 11:49:24 +01:00
Simon Hausmann
f8eec03296 Allow drop-shadow on Clip
Commit d03da6b57b illustrates how this
would be rather convenient. Eventually perhaps `Clip` can turn into a
boolean `clip: true` property.
2021-01-28 08:40:09 +01:00
Simon Hausmann
d03da6b57b Add a drop shadow to the pieces puzzle tiles
If `clip` were a similarly created property, then
this would probably look a little nicer in the source code.
The `Clip` element is a little in the way.
2021-01-27 19:19:17 +01:00
Simon Hausmann
a69ce3a397 Remove the 'align-' prefix from TextHorizontal/TextVerticalAlignment 2021-01-25 10:59:18 +01:00
Olivier Goffart
61399e566a Add a title to the Window
also add a color, but not yet implemented
2020-12-18 16:47:14 +01:00
Olivier Goffart
0d2d48be4f Rename "signal" to "callback" 2020-12-18 09:51:01 +01:00
Simon Hausmann
625978fe1a WIP: Add an image-fit property to Image/ClippedImage 2020-12-15 10:26:54 +01:00
Olivier Goffart
f3f18259ae Some items default size is the parent size
Fixes #122
2020-12-02 18:36:23 +01:00
Simon Hausmann
6fba6aca56 Consistency fix for transitions API
Use "in" and "out" instead of "to" and "out".
2020-12-01 11:18:47 +01:00
Simon Hausmann
9360fc3c5a Don't silently drop fields in object literals inside arrays
This patch tries to improve the ability to convert different kinds of
object literals in an array into a common type. We used to take the
first entry as the "shape" of all elements, which meant that if the
first element was missing a field it would be silently dropped from all
future fields.

Instead, this patch merges the fields.
2020-12-01 10:57:47 +01:00
Simon Hausmann
002412ad68 Implement the hover effect on the auto-play checkbox 2020-11-27 14:59:48 +01:00
Simon Hausmann
2472eb51f0 Add the plaster font to plaster theme of the slide puzzle
For regular builds this is done by adding Rust API that allows
registering a font, and for the web the font is installed into the
browser using JavaScript API.

This is an initial approach to just add this ability. It might make
sense to introduce a syntax in the `.60` file to allow for the
registration of fonts and letting the compiler generate code that
performs this embedding and registration automatically.
2020-11-27 14:29:56 +01:00
Olivier Goffart
68d6791814 slide puzzle: Fix the pressed state 2020-11-24 18:15:45 +01:00
Olivier Goffart
3ae7c6e0b5 Hover effect 2020-11-24 18:09:32 +01:00
Simon Hausmann
d80868bbf4 Add support for font_weight to Text and TextInput
This allows implementing another sliding puzzle theme feature, the
boldness of the tile number text in the simple theme when the tile is in
the correct position. For the other themes the weight is constant and
it's bold.

More cleanup to follow later: unify the font handle and FontCacheKey
handling, improve the API to allow for the use of symbolic constants
(normal, bold, etc.) instead of the CSS number values.
2020-11-24 10:10:00 +01:00
Olivier Goffart
7c159c2284 slide_puzzle: Add the last tile on the image when the puzzle is finished 2020-11-23 16:39:43 +01:00
Simon Hausmann
3d85e45ec3 Add support for source clipping to the Image element
This allows rendering only a sub-rectangle of the original image, which
we can use right away in the sliding puzzle demo.
2020-11-23 15:46:59 +01:00
Olivier Goffart
807dbb3c00 Puzzle: Kick animation
Also support timer that can be cancelled from the timer event
2020-11-23 13:38:44 +01:00
Olivier Goffart
4383566db9 slide puzzle: Animation on checkbox 2020-11-20 17:14:04 +01:00
Olivier Goffart
781e92941c Slide puzzle: move the checkbox to its own component 2020-11-20 17:14:04 +01:00
Simon Hausmann
9283a43d3e Small typo fixes 2020-11-20 16:19:00 +01:00
Olivier Goffart
08fe5f6c72 Add a Clip 2020-11-20 15:45:45 +01:00
Olivier Goffart
2cc1070b7b Slide puzzle circle animation 2020-11-20 15:15:42 +01:00
Olivier Goffart
280414b556 slide_puzzle: Thumb up icon when winning 2020-11-16 13:30:48 +01:00
Olivier Goffart
0672f4b3cd Expose Timer API to rust API
And use it in the puzzle demo to implement the auto play mode
2020-11-16 12:17:02 +01:00
Olivier Goffart
6ca7c85eab Implement min and max 2020-11-13 15:30:07 +01:00
Olivier Goffart
b8d9373edd Slide Puzzle: add an image 2020-11-13 14:13:51 +01:00
Olivier Goffart
d499e86640 Implement cubic-bezier 2020-11-13 13:36:32 +01:00
Olivier Goffart
01356bde33 Some more logic got the sliding puzzle 2020-11-12 12:59:18 +01:00
Olivier Goffart
06a3baf3e7 Slide puzzle: add some themes 2020-11-11 17:39:24 +01:00
Olivier Goffart
8f362ead43 Missing license header 2020-11-10 15:12:25 +01:00
Olivier Goffart
270e1b3e5b Start experimenting with the sliding puzzle example 2020-11-10 14:30:36 +01:00