Commit graph

262 commits

Author SHA1 Message Date
Olivier Goffart
3194dd21ca Expose VRc to the C++ API
(Not yet in use in the code gen)
2020-11-10 12:43:19 +01:00
Olivier Goffart
95c4bac794 Add a dealloc and drop_in_place function to the ComponentVTable 2020-11-06 17:13:01 +01:00
Olivier Goffart
4910c1fdaa Fix string comparison in C++ 2020-11-03 19:42:01 +01:00
Olivier Goffart
8a95b806c7 Strawman implementation of a combo box 2020-11-03 17:55:49 +01:00
Olivier Goffart
a6dbd0d7fa Fix C++ build on MSVC 2020-11-03 17:42:34 +01:00
Olivier Goffart
11e55dd8d2 String -> Float conversions 2020-11-03 15:19:58 +01:00
Olivier Goffart
4a182ef4d0 Layout alignment 2020-11-03 12:22:34 +01:00
Olivier Goffart
a82c23fc41 Add ability for the native style to export native Globals 2020-11-02 16:13:04 +01:00
Olivier Goffart
356cd8c3ee Fix compileation with clang
The operator== must be in the same namespace as the struct for ADL to work proprerly
2020-11-01 16:09:42 +01:00
Olivier Goffart
cc85aa818d C++: implements operator== for StandardListViewItem 2020-11-01 15:56:19 +01:00
Olivier Goffart
1eb7203ec8 Also do the comperty comparison in C++ 2020-10-31 14:36:38 +01:00
Olivier Goffart
5face45c51 Rename Component::compute_layout to apply_layout
And pass the expected rectangle.
This is currently not used yet but will be needed when we can have
repeated elements within a box layout
2020-10-29 19:08:52 +01:00
Olivier Goffart
263df7dc63 Remove the www from all sixtyfps.io URL 2020-10-29 11:06:06 +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
4a702243d1 Fix C++ layouts 2020-10-27 08:16:02 +01:00
Olivier Goffart
47be71e16d Introduce layout stretching 2020-10-26 16:40:35 +01:00
Olivier Goffart
20cfb65e53 Bump version 2020-10-22 08:41:45 +02:00
Simon Hausmann
fae046cef4
Small typo fix 2020-10-21 21:35:45 +02:00
Olivier Goffart
c50b9d73d3 Document the generated C++ code 2020-10-21 11:29:25 +02:00
Olivier Goffart
a2a134725f Pin corrosion git hash
Because otherwise there could be breaking changes
2020-10-21 09:12:59 +02:00
Olivier Goffart
1de39e5769 String concatenation 2020-10-19 18:37:15 +02:00
Olivier Goffart
e4e601de83 Draw the frame properly around the native scrollview 2020-10-16 10:45:17 +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
Simon Hausmann
8835e25ccd Advocate the CMake FetchContent approach for the C++ Integration
This may be slightly easier to use than the separate build & install sequence.
2020-10-15 16:00:49 +02:00
Simon Hausmann
48602c3b5c Fix MSVC warning about #pragma GCC
Only use the pragma with GCC and Clang
2020-10-13 23:00:12 +02:00
Simon Hausmann
a37d42fa0e Add an init function to the Item vtable
This will be called by the run-time and will allow items to set up
bindings that rely on internals that should not be exposed to the
compiler/runtime.
2020-10-12 16:49:44 +02:00
Olivier Goffart
7bd77f698f cmake: use the newly introduced CRATES option from corrosion 2020-10-12 06:57:03 +02:00
Olivier Goffart
9d106c6830 Some changes in the README 2020-10-09 13:49:39 +02:00
Olivier Goffart
d8f7139f48 Fix Native StandardListView with C++ 2020-10-08 17:18:22 +02:00
Olivier Goffart
4bdf447b11 C++ build documentation and README 2020-10-08 12:25:12 +02:00
Olivier Goffart
11d367467a Fix install when using a config + debug configuration 2020-10-08 11:28:42 +02:00
Olivier Goffart
2837bf3a5f CI: generate packages 2020-10-08 11:28:42 +02:00
Olivier Goffart
07c4b6cb3d CMake: Fix installation 2020-10-07 18:20:55 +02:00
Olivier Goffart
3040885c6d Fixup C++ build 2020-10-07 11:48:22 +02:00
Olivier Goffart
8b02568b4b Refactor the cmake C++ build 2020-10-07 11:40:34 +02:00
Olivier Goffart
58b176d10c ListView in C++
This make sure the layout is correct, but does not implement the
optimization to only instentiate visible items
2020-10-05 11:32:43 +02:00
Olivier Goffart
6d9af3449a C++ model for the todo example in C++ 2020-09-30 18:30:19 +02:00
Olivier Goffart
f01977ca06 Fix removing from model in C++ 2020-09-30 18:17:15 +02:00
Simon Hausmann
9ad8968529 Add support for the initial_focus synthetic property
Setting it will translate to a set_focus_item call in the constructor.

This implements parts of #55
2020-09-30 15:11:01 +02:00
Olivier Goffart
2050f08f1e Ability to make change to the model property 2020-09-30 15:04:32 +02:00
Olivier Goffart
f4f4775a19 Refactor the C++ Repeater to do the same as the Rust one 2020-09-29 14:20:43 +02:00
Olivier Goffart
6662e1ff00 Proper Scrollbar on the native style 2020-09-28 18:13:13 +02:00
Olivier Goffart
6dd0d178a0 Rename ScrollArea to ScrollView 2020-09-28 10:52:29 +02:00
Olivier Goffart
3b6679ed4b Two ways binding works also work as three ways binding and more
A side effect is that the order of calling set_binding and link_two_ways is no longer relevant
2020-09-28 10:42:27 +02:00
Olivier Goffart
abe24e2e9e C++ two way bindings 2020-09-25 15:21:37 +02:00
Simon Hausmann
e5dfb3a4c0 Implement basic focus handling
Similar to the mouse_grabber, we use a VisitChildrenResult field to
track the focus item within a component. Unlike the mouse grabber
however, it is set/cleared using dedicated focus events.

The key event now routes the key event directly to the focus item.

The focus can be requested via set_focus_item on a window, which the
TextItem does.
2020-09-25 10:43:47 +02:00
Simon Hausmann
aa5babffe1 Prepare for key event delivery to a specific focus item
Begin by routing key events through the component. In the future that
will direct the event to the focus item.
2020-09-25 10:06:15 +02:00
Simon Hausmann
2b76e9277a Prepare for allowing an item mouse handler to request focus
In the future the TextInput will request focus on mouse click,for
example.

Pass the outer-most component through to ItemVTable's input_event.

For the purpose of disambiguating this component from any nested
component instantiated by a repeater or so, it's called the
app_component.

The ComponentVTable takes a reference to a ComponentRefPin instead of a
ComponentRefPin by value, as the vtable macro gets confused otherwise
and thinks it's a self argument.
2020-09-25 10:06:15 +02:00
Olivier Goffart
315fd7a881 Start doing a ScrollArea element
Unfortunately something is wrong with the Qt style, it looks like the Qt style
does not respect the rect given for the sub components

Also Input is not handled yet.
2020-09-22 20:05:41 +02:00
Simon Hausmann
93a08c5207 Add a LineEdit widget to the ugly and native style 2020-09-18 18:54:37 +02:00