Commit graph

197 commits

Author SHA1 Message Date
Simon Hausmann
aafb96cb93 Get rid of abi::datastructures::WindowProperties
Instead, pass a reference to the root item when mapping the window,
at which point we can downcast to the new Window item. If we have one,
then we'll read its width/height (for initial values) and install
bindings to keep them up-to-date.
2020-08-12 09:44:42 +02:00
Simon Hausmann
3d5d112deb Fix paths to logos 2020-08-11 16:57:04 +02:00
Simon Hausmann
02b1d49fa4 Remove old test programs
I haven't used graphicstest in a long time to debug something and
rustwasmtest is superseeded by the shinier and prettier gallery and
printer demos.
2020-08-11 14:42:19 +02:00
Simon Hausmann
3b6a1085ac Fix published demos with parcel
Don't load off of /, use relative paths.
2020-08-11 14:36:27 +02:00
Simon Hausmann
50eafc3fd7 Simplify wasm builds
Replace webpack, which needs a configuration file, etc. with parcel,
which requires none. Just "parcel index.html" and it'll figure out the
rest :-)
2020-08-11 14:22:52 +02:00
Simon Hausmann
f2eec61968 Add a window to the top-level component
This means that we always have a window and for the C++
API we don't require this ComponentWindow use anymore.
2020-08-11 13:38:38 +02:00
Olivier Goffart
b5c9bf5d10 Settings page for the printer demo
Fix the text maximum size so it can be put in a layout
2020-08-11 12:08:44 +02:00
Olivier Goffart
35cb14b2e6 Slider 2020-08-10 14:58:13 +02:00
Olivier Goffart
36243ccdf7 Traverse item front to back for input events 2020-08-10 10:45:02 +02:00
Olivier Goffart
2ba40ebc96 Printerdemo: small effect on press
It works now that we have a grabbed item.
2020-08-07 16:32:49 +02:00
Olivier Goffart
0a56912d0f Mouse grab in rust 2020-08-07 16:06:49 +02:00
Simon Hausmann
8b74381097 Some work on the copy page 2020-08-07 15:53:59 +02:00
Simon Hausmann
a6c7dd1610 Add placeholder pages for copy/fax/settings 2020-08-07 13:49:24 +02:00
Simon Hausmann
1ba3b848fd Fix default font size for the page buttons
Bigger looks better :-)
2020-08-07 10:37:29 +02:00
Simon Hausmann
aecf6a8878 Center text in buttons in the demo and gallery
This adds horizontal_alignment/vertical_alignment properties, along with
width/height to Text.

This still uses a hard-coded enumeration in the compiler, which is meant
to go away in favor of general enum support.
2020-08-07 10:02:52 +02:00
Olivier Goffart
479173c22f Implement spacing in GridLayout 2020-08-05 15:42:38 +02:00
Simon Hausmann
3596059eab Add wasm build for the printer demo 2020-08-05 15:02:36 +02:00
Simon Hausmann
87cac657b2 Scale the icon size with the size of the window 2020-08-05 14:55:59 +02:00
Simon Hausmann
5dfb9aa875 Fix initialize size of printer demo
Map it to 800x600 logical pixels for a better initial look.

This implements respecting the initial values for width/height and tries
to apply them to the window begin created.

The PinnedOptionalProp wrapper is needed because while cbindgen mapped
the previous Option<&...> to a raw pointer, the new Option<Pin<&...>> is
not detected as a pointer.
2020-08-05 13:22:53 +02:00
Olivier Goffart
2dd3cecc5a Add a SpinBox 2020-08-05 12:56:13 +02:00
Simon Hausmann
fb763eeb8e Fix initial icon sizes
Now that the scale factor is initialized, these need adjusting.
2020-08-05 10:51:40 +02:00
Simon Hausmann
d3c596669c Add larger icons to the printer demo
The icons on the main screen are now nicely large and they scale down on
activation.
2020-08-05 10:04:11 +02:00
Simon Hausmann
48df8d0911 Rework the API between the items and the renderer
Move fields out of the HighLevelRenderingPrimitive that are suitable to
represent as uniform variables. That reduces fields like Image or
Rectangle to their image or dimension, and only if *they* change, then
we re-do the work of building geometry and uploading it to the GPU.

Instead, the typically animated properties such as the position or the
color are passed separately with each draw call. This avoids re-decoding
PNG files and uploading them again when moving an image element around
on the screen.
2020-08-05 09:44:12 +02:00
Simon Hausmann
a9297af00d Update the rendering primitives lazily using a property listener scope
This also allows avoiding the need to store the high-level rendering
primitive item in the low-level primitive struct for comparison later.
2020-08-04 22:48:03 +02:00
Olivier Goffart
c9fab854e3 Some tweek in the animation 2020-08-04 18:18:55 +02:00
Simon Hausmann
504b4a327b Provide the svg source for the image and a conversion script 2020-08-04 17:22:55 +02:00
Simon Hausmann
685a3fb8ab Rename Text::font_pixel_size to just font_size
Since length are resolution independent, it doesn't make sense anymore
to have the pixel infix.
2020-08-04 16:56:42 +02:00
Simon Hausmann
4aed6ac6f3 Small touch-up on the rectangles 2020-08-04 16:37:10 +02:00
Simon Hausmann
67feaed237 Ignore a potential build directory 2020-08-04 16:09:33 +02:00
Simon Hausmann
254df328d0 Add support for images (resources) in models
This also allows replacing the emojis (not working due to lack of fallback) with images
2020-08-04 16:09:33 +02:00
Olivier Goffart
8c793c81e9 Implement some transition between pages 2020-08-04 14:13:22 +02:00
Olivier Goffart
d158690a88 Add some buttons for the printer demo 2020-08-04 12:19:32 +02:00
Olivier Goffart
3becd69bc5 Skeleton for the printerdemo 2020-08-04 10:11:02 +02:00
Olivier Goffart
b259a09338 Rename the types float32 and int32 to float and int 2020-08-03 16:15:41 +02:00
Olivier Goffart
de188e0a54 Add the as_weak to rust generated component 2020-08-03 15:36:54 +02:00
Olivier Goffart
8aef208340 Rust: add on_* to set signal handler 2020-08-03 15:01:10 +02:00
Olivier Goffart
b2a1a72450 C++: add on_* funciton to connect to signals 2020-08-03 15:01:10 +02:00
Simon Hausmann
30d7a0b36d Move PathData and friends from datastructure to
graphics
2020-08-03 13:43:44 +02:00
Simon Hausmann
1b270f42d0 Move datastructures::Color into graphics 2020-08-03 13:27:35 +02:00
Simon Hausmann
ce7f66320b Move datastructures::Resource into graphics
It's only used for graphics at the moment and used
for image resources.
2020-08-03 12:47:05 +02:00
Simon Hausmann
05f3ff10a6 Rename graphics::RenderingPrimitive to HighLevelRenderingPrimitive
That plays better with the existing LowlLevelRenderingPrimitive.
2020-08-03 12:39:57 +02:00
Simon Hausmann
550d0122a5 Move datastructures::RenderingPrimitive to graphics 2020-08-03 12:39:52 +02:00
Simon Hausmann
6c5d423cd4 Rename sixtyfps_corelib to sixtyfps-corelib 2020-08-03 10:01:58 +02:00
Olivier Goffart
cb67e40c32 Rename WeakPin -> PinWeak 2020-07-31 18:19:26 +02:00
Olivier Goffart
9760cf4969 Begin to implement a Flickable
The implementation is still very rough and will need to be improved
2020-07-30 14:36:21 +02:00
Olivier Goffart
604359f01f Put the gallery in a layout 2020-07-28 10:44:17 +02:00
Simon Hausmann
a4938c4d8e Add wasm boilerplate 2020-07-25 17:34:59 +02:00
Olivier Goffart
d3ad4603c8 A dummy checkbox 2020-07-24 11:56:54 +02:00
Simon Hausmann
9938197b58 Split Rectangle again
Into the previous Rectangle and BorderRectangle that allows (rounded) borders through a stroke in addition to the fill.

Next step is to make the compiler make the choice automatically depending
on the properties used.
2020-07-24 10:15:12 +02:00
Simon Hausmann
dd9bd2cf72 Add a rounded border to the button
There's still an open question about how to avoid the border properties
for all rectangles but allocate them only for those who have a border.
Regardless, this border illustrates the issue with the lack of text sizing.
2020-07-24 09:21:30 +02:00