Commit graph

323 commits

Author SHA1 Message Date
Simon Hausmann
2d249ae907 Place the icons in the sidebar manually 2021-02-22 11:17:38 +01:00
Simon Hausmann
4cee552201 Fill the night mode icon when clicked
Work around issue #173 by explicitly initializing the global night mode property
2021-02-22 11:17:38 +01:00
Simon Hausmann
58167e6281 Work around rendering issue with the ink SVG
Pre-render the SVG
2021-02-22 11:17:38 +01:00
Simon Hausmann
ba14486788 Fix side bar layout padding 2021-02-22 11:17:38 +01:00
Simon Hausmann
08bb6c0828 Provide space for the main view
This also allows getting rid of the intermediate fake rectangle
2021-02-22 11:17:38 +01:00
Simon Hausmann
1592866661 Start working on the new printer demo design 2021-02-22 11:17:38 +01:00
Simon Hausmann
bb97fdd2a2 Use SVG images in the printer demo 2021-02-12 19:04:36 +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
Olivier Goffart
23a511b380 Replace img!"..." by @image-url("...") 2021-01-28 11:49:24 +01:00
Simon Hausmann
a69ce3a397 Remove the 'align-' prefix from TextHorizontal/TextVerticalAlignment 2021-01-25 10:59:18 +01:00
Simon Hausmann
5f265ffc09 Split up ComponentWindow::run() into show(), hide() and sixtyfps::run_event_loop()
This allows creating multiple windows for example, and it will allow for
showing windows in those tests that require a mapped window.

As a bonus, the run() function on generated components is not consuming
anymore.
2021-01-19 09:50:22 +01:00
Olivier Goffart
23486d94f5 Fix MSVC warning 2021-01-14 12:23:59 +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
Olivier Goffart
002cfa76af Use PRIVATE in target_link_libraries 2020-12-16 14:29:12 +01:00
Olivier Goffart
f53e52e403 Don't compile the printer demo as a lib by default
Reverts parts of commit b8b2a30853 that was commited by mistake
2020-12-08 13:54:12 +01:00
Olivier Goffart
b8b2a30853 Add a note about wasm build in the example README 2020-12-08 13:10:52 +01:00
Olivier Goffart
6d112465d1 Attempt to simplify the wasm build 2020-12-08 11:51:10 +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
a5932c9f88 Remove the outline around the canvas in the wasm demos 2020-11-26 17:31:46 +01:00
Simon Hausmann
c73edd503b Fix tapping on the quit icon in the wasm printer demo
Don't let that make the demo become dysfunctional.
2020-11-26 14:56:18 +01:00
Simon Hausmann
5a0239e557 Show the printer demo in fullscreen in a mobile browser in landscape 2020-11-26 14:55:48 +01:00
Olivier Goffart
57cf4e0988 Use transitions in the printer demo for the color level 2020-11-20 12:40:09 +01:00
Olivier Goffart
fd45f575d7 Some improvement of the main screen of the printer demo
Apply some of the hints from the reddit thread

 - make sure the icons are centered
 - make sure the spacing and padding of the main buttons are the same
 - make the color slightly lighter
 - align the title ind controls in the top bar
2020-11-16 17:23:56 +01:00
Simon Hausmann
94ed0ae1d1 Fix printer speed
Enable the turbo mode by default!
2020-11-11 15:10:07 +01:00
Simon Hausmann
9d9f5f5462 Simplify the settings page a bit
Use horizontal and vertical layouts to reduce the amount of nesting.
The resolution slider is a bit wider now, but that one needs a bit of extra work anyway :)
2020-11-11 15:10:07 +01:00
Simon Hausmann
1c787d2cb3 Use font-size instead of font_size 2020-11-11 09:38:01 +01:00
Simon Hausmann
c85aa9a758 Use dashed properties for text alignment 2020-11-11 09:35:09 +01:00
Olivier Goffart
d6a440aa4a Change C++ API to use the ComponentHandle 2020-11-10 19:28:34 +01:00
Olivier Goffart
5b4a974c72 Split each page of the printer demo in its own file 2020-11-02 21:39:14 +01:00
Simon Hausmann
a2ae00ee92 Begin splitting up the printer demo into multiple files 2020-11-02 13:40:34 +01:00
Olivier Goffart
b89e7bd3d3 Printer demo: Remove workaround now that for is supported in layout 2020-10-31 11:33:12 +01:00
Olivier Goffart
263df7dc63 Remove the www from all sixtyfps.io URL 2020-10-29 11:06:06 +01:00
Simon Hausmann
8bb6f58deb Minor ui fix in printer demo settings page
Don't let the slider "touch" the "Resolution" text label.
2020-10-27 19:33:37 +01:00
Olivier Goffart
d3801e26d3 Change the syntax of structures to require the struct keyword 2020-10-27 16:09:05 +01:00
Olivier Goffart
0973cc7f86 Small changes to prnitdemo layout
Ideally we should convert to box layouts anyway
2020-10-27 09:02:22 +01:00
Olivier Goffart
aabd13b5a9 Adjust the ugly style default stretches 2020-10-27 07:24:04 +01:00
Simon Hausmann
63a88ad452 Add smooth rounded borders to the fax page 2020-10-26 13:48:10 +01:00
Olivier Goffart
b6655d0049 Add signal handler in the node printer demo 2020-10-21 12:44:12 +02:00
Olivier Goffart
1436402999 Change the target name for the C++ example
they were ending by _cpp because corrosion used to add all rust target as target
but that's no longer the case
2020-10-20 18:02:28 +02:00
Olivier Goffart
47bf84d85d Printer demo: some logic for the Fax page 2020-10-20 15:06:24 +02:00
Simon Hausmann
41ad33f443 Fix bug in struct initialization from object literals
When converting from object literal to object literal, we would check
recursively if the individual fields can be converted and then generate
code to convert each field.

For a conversion frmo object literal to a struct, we would a per-field
can_convert check as well, but there would not be any code (Expression)
generated for the conversion, instead it would be a straight cast. That
was fine so far in our tests and example code, because the fields never
required a conversion. With commit
071ab9fda1 the percentage number literals
used in the printer demo however would now require a conversion
(multiplication by 0.01) before the assignment to the float level field.

This patch adds the missing conversion by matching the Object -> Struct
conversion case, generating an intermediate Object type based on the
struct's properties, call maybe_convert recursively and *then* cast the
result to a struct.
2020-10-19 12:17:41 +02:00
Simon Hausmann
c9e5e5f25b Fix appearance of ink levels in printer demo
Work around a regression introduced in commit 071ab9fda1 that
I'll try to fix next week.
2020-10-17 13:31:37 +02:00
Simon Hausmann
96ead1d028
One more relative length use in the printer demo 2020-10-16 22:11:45 +02:00
Simon Hausmann
cfe0fb396c Use percentages in the printer demo
Looks a little prettier in the source code :)
2020-10-16 20:32:35 +02:00
Olivier Goffart
cdc6a34eaf Support for array in JS 2020-10-16 12:58:27 +02:00
Simon Hausmann
6aa292eac1 Change the names of the logical and physical pixel units
The logical pixels are now just called "px" and the less frequently
used physical pixels have the "phx" suffix.

The existing markup was adapted using the syntax updater and the
following patch:

    +    if node.kind() == SyntaxKind::NumberLiteral {
    +        if node.text().ends_with("lx") {
    +            return write!(
    +                file,
    +                "{}px",
    +                node.text().as_str().split_at(node.text().as_str().len() - 2).0
    +            );
    +        }
    +        if node.text().ends_with("px") {
    +            return write!(
    +                file,
    +                "{}phx",
    +                node.text().as_str().split_at(node.text().as_str().len() - 2).0
    +            );
    +        }
    +    }

Fixes #49
2020-10-16 07:19:40 +02:00