Commit graph

263 commits

Author SHA1 Message Date
Olivier Goffart
8361ef4019 Start code egeneration for the two ways binding
This is only meant to include the cases in which the property are optimized.
Does not work yet for the dynamic component
2020-09-24 14:37:16 +02:00
Olivier Goffart
221bb853d7 Change the exaple to used named struct for models 2020-09-17 14:00:50 +02:00
Olivier Goffart
913d680333 Recactor rust Model after first round of API review
- Remove EmptyModel and use an Option
 - Make ModelRc a type alias
 - Rename ArrayModel into VecModel
2020-09-16 14:25:57 +02:00
Simon Hausmann
625cb6c6b8 Add a constructor to Text and let the color default to black
We really shouldn't require specifying a color for every Text {} element just in order
to see *some* text.

For Rectangle OTOH transparent is a good default (and thus for Color), hence
this change just to Text.

Right now the constructor bit is also a bit repetitive, this could
perhaps be folded into BuiltinItem to generate the ffi, default impl and
forward to an init function if it exists.
2020-09-16 08:20:13 +02:00
Olivier Goffart
2ae4f1757b Rename model method to match the rust API 2020-09-15 14:10:07 +02:00
Olivier Goffart
0d8a38577d Todo example: make the "add todo" button do something 2020-09-14 16:38:45 +02:00
Olivier Goffart
4de2e57175 Use a Model trait in the rust backend 2020-09-14 14:02:34 +02:00
Simon Hausmann
520df89e2c Add the same (a)rgb_(uint8/float) functions in C++ Color as in Rust 2020-09-11 17:55:52 +02:00
Simon Hausmann
9ecaf11eed Various additions to the Rust Color API
As discussed in the most recent API review.
2020-09-09 18:53:59 +02:00
Olivier Goffart
8761ca80a3 Add SharedArray::push and adjust a bit the API 2020-09-09 18:47:15 +02:00
Simon Hausmann
6b8ccc5ef4 Some touch-ups for the printer demo's settings page 2020-09-09 08:53:15 +02:00
Simon Hausmann
246a7142ec Fix printerdemo C++ build after API changes 2020-09-08 22:34:22 +02:00
Simon Hausmann
19cce012a0 Add ARGBColor<T> to the color API
As discussed in the last API review, this replaces the as_rgba_f32/u8
"accessor" functions by returning a struct with named fields.
2020-09-08 22:11:23 +02:00
Simon Hausmann
ec07d6bfe8 Tweaks to the color schemes of the printer demo and ugly style/gallery
The printer demo looks slightly less boring on white background with brighter colors.

In exchange, the controls can become more dull and hopefully easier to see.
2020-09-08 15:30:28 +02:00
Olivier Goffart
3f45b545ff C++: Don't return model data by const value
Prevetn warning
2020-09-07 12:50:08 +02:00
Olivier Goffart
a1756ca860 Do not use symbolic link when we don't need to
On windows, symbolic links support is not working out of the box.
So better avoid symbolic links needed for the build.
There is still symbolic links used to build the rust doc, but that's only
in nightly and only for the documentation
2020-09-07 11:10:07 +02:00
Olivier Goffart
f6c8ea0f20 Make the Model/Repeater type safe in C++ 2020-09-04 19:02:56 +02:00
Olivier Goffart
0751552068 Printer demo: the ink data now comes from the native code 2020-09-04 15:49:33 +02:00
Simon Hausmann
7ca8cf7cdd Change the color scheme of the printer demo a little
To adjust for better contrast in the style changes
2020-09-02 09:25:39 +02:00
Simon Hausmann
704644c752 Reduce use of bright colors in the printer demo
Use slightly aggressive colors for the buttons of the printer demo,
shrink the ink cartridge bars a little and replace the red for the 2000
with a more subtle silver.

Based on privately received feedback ;-)
2020-09-01 15:05:40 +02:00
Olivier Goffart
9782d85fdb Native style works with C++ 2020-09-01 12:25:11 +02:00
Olivier Goffart
46b86e023d Exclude the wasm example from the workspace so they do not get built by default
They should only be built for wasm build

Also cleanup their Cargo.toml file: only cdynlib is required and no need to rename the web-sys crate
2020-08-27 14:25:15 +02:00
Olivier Goffart
58cdaeb8dd Update license header to mention that commertial option are available 2020-08-26 13:23:42 +02:00
Olivier Goffart
f0dbd0cc80 node frontend for the printerdemo 2020-08-26 09:11:21 +02:00
Simon Hausmann
04ee36b27e Speed up non-wasm build
Don't build wasm-bindgen-*, js-sys, console_error_panic_hook and web-sys
(and dependencies, total 9 crates) when not building for wasm.
Especially web-sys has a ton of .rs files in its crate and takes a
while.
2020-08-25 14:01:57 +02:00
Olivier Goffart
ea1f215367 Some polishinbg of the .toml files
- Give all the sixtyfps-* create a 0.0.1 version
 - Make sure that the internal dependences are using the exact same version
   (so "=0.0.1")
 - Add the description/homepage/repository fields in the .toml files
 - Set publish=false  to crates that are not meant to be published on crates.io
2020-08-24 16:28:11 +02:00
Olivier Goffart
dcf5e63203 Put the shebang before the license header 2020-08-24 12:28:02 +02:00
Olivier Goffart
725db91878 Fax page 2020-08-24 08:38:30 +02:00
Simon Hausmann
7f1d9f5252 Commit correct license tags to Cargo.toml
For now that's GPL-3.0 only, but this can be changed :-)
2020-08-18 10:12:59 +02:00
Simon Hausmann
2823f32692 Apply license headers to all non-binary/non-json sources 2020-08-17 17:55:20 +02:00
Simon Hausmann
86b67787a1 More printer demo polish
* Align the images on the main screen buttons
    * Increase the spacing between the images and the button text
2020-08-14 14:27:34 +02:00
Simon Hausmann
85b1ec0ea9 Add a subtle background gradient 2020-08-14 14:20:36 +02:00
Simon Hausmann
1a42f446a2 Replace the logo in the printer demo with a visual power button 2020-08-14 14:04:09 +02:00
Simon Hausmann
c362eb2b5f Minor polish to the printer demo html 2020-08-13 18:43:34 +02:00
Simon Hausmann
92d5f4d493 Place the project logo in the top right corner of the printer demo
That'll look nicer in the screenshot :)
2020-08-13 18:19:53 +02:00
Olivier Goffart
f7c1e112b3 Some stuff in the home screen of the printer demo 2020-08-12 14:54:08 +02:00
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
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
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
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