Commit graph

176 commits

Author SHA1 Message Date
Tobias Hunger
e01bd87df8 Janitor: Fix warnings about markdown files
These might change the layout of the rendered markdown files. This will
also fix some typos along the way:-)
2021-06-28 08:32:25 +02:00
Tobias Hunger
13d7f5e7bd Janitor: Fix typos in comments and user-facing strings
Also adapt tests for error messages containing the fixed strings.

No behavior change is intended!
2021-06-28 08:32:25 +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
Simon Hausmann
7773678e22 Simplify wasm "startup" code
Apply the simplification of 2398d00e6f to all
index.html files we use. An async function
can be called directly.
2021-04-14 09:36:33 +02:00
Simon Hausmann
e614fb3bb1 Remove manual plaster font loading for the slide puzzle wasm version
Since commit 727c9a19f7 the plaster font is included in the
wasm binary.
2021-04-14 09:35:19 +02:00
Olivier Goffart
80b236489e Add a clip property that can be set to the Rectangle 2021-04-12 18:48:43 +02:00
Simon Hausmann
445ddd58d5 API cleanup
Remove the `application` infix from `register_application_font`, to
reduce the changes that it might be interpreted to be a function that
also changes the default font in all text elements.
2021-02-17 14:37:31 +01: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
03664b8f01 Fix Cargo.toml
Fix up commit 5df6c99f4f that accidentally removed the wasm markers
2021-01-28 22:12:48 +01:00
Simon Hausmann
5df6c99f4f Improve application font support for WASM and simplify font handling
We can use fontdb on all platforms, which gives consistent font query
behavior of application fonts. And then we also don't need our hand-made
"db" anymore for the wasm build and the included DejaVu font.
2021-01-28 21:47:52 +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
9edf60a178 Fix wasm example using rand 2021-01-28 16:03:57 +01:00
Olivier Goffart
17eaffb6e1 Update rand dependency in the examples 2021-01-28 15:43:38 +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
Simon Hausmann
727c9a19f7 Add basic text item support
This needs more work, but gets something onto the screen at least.
2021-01-14 08:53:13 +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
261b2cb533 Make the link to the source point to the directory instead of the .60 2020-12-11 09:20:01 +01:00
Olivier Goffart
29771f9591 Slider demo: make sure that it is always fullscreen 2020-12-08 16:13:14 +01:00
Olivier Goffart
3f6f16c633 Also simplify wasm build for the slide puzzle 2020-12-08 12:39:47 +01:00
Simon Hausmann
1e683de64d Simplify Rust Timer API
Don't require the caller to Box the closure. With the assumption that
the majority of callers *want* the closure to be boxed (i.e. it's not
already boxed), the API becomes easier to use.
2020-12-04 10:57:19 +01:00
Simon Hausmann
7047856d4e Replace FooRc with Foo and without ComponentHandle in examples and tests 2020-12-03 08:13:24 +01:00
Simon Hausmann
08b8a8cb83 Port the examples away from the ComponentHandle based API 2020-12-03 08:13:15 +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
51eae642dc Add one more item for the puzzle 2020-11-30 11:03:39 +01:00
Simon Hausmann
4c5e43c919 Move the plaster font into a sub-directory on its own
Otherwise it might look like the example is under the OFL license :)
2020-11-27 15:44:53 +01:00
Olivier Goffart
1712a19f98 Slide Puzzle Wasm: fix font loading 2020-11-27 15:23:44 +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
Simon Hausmann
a5932c9f88 Remove the outline around the canvas in the wasm demos 2020-11-26 17:31:46 +01:00
Simon Hausmann
859d83bb12 Fix up parent commit
The edit was intended for index.html, not the older test.html.
2020-11-26 13:34:41 +01:00
Simon Hausmann
66470f59b7 Wording tweak for the slide puzzle HTML 2020-11-26 13:25:48 +01:00
Simon Hausmann
94c758892a Apply the mobile optimizations to the main slide puzzle html 2020-11-26 13:23:42 +01:00
Simon Hausmann
d3549b252c Tweak responsible slide puzzle html
* Show the text and link always, only hide it in mobile landscape.

* Use the 100%/50% viewport scale for the canvas also on the desktop
2020-11-26 11:29:06 +01:00
Simon Hausmann
12bff05188 First try at a responsive slide puzzle for the web
Based on the bootstrap media queries, make the canvas basically
full-screen and adjust to landscape and portrait.
2020-11-26 10:42:04 +01:00
Olivier Goffart
68d6791814 slide puzzle: Fix the pressed state 2020-11-24 18:15:45 +01:00