Olivier Goffart
c7e5b39973
Layout the items in the ListView
2020-10-02 18:07:39 +02:00
Olivier Goffart
f10c2bfd7c
More ListView WIP
2020-10-02 18:07:39 +02:00
Olivier Goffart
dec06be70c
WIP ListView
2020-10-02 18:07:39 +02:00
Simon Hausmann
7e0e7b43f0
Add support for calling focus() on TextInput elements
...
This allows activating text inputs in signal handlers connected for
example to buttons.
This implements parts of #55
2020-10-01 08:52:45 +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
2d01b92c84
Ability to change part of objects from the .60 syntax
2020-09-30 11:33:36 +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
9d53c45291
Implement two ways binding in rust
2020-09-25 12:57:08 +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
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
4981c3ca75
Some check for the two way bindings
2020-09-23 14:06:08 +02:00
Olivier Goffart
2ee861365c
Flickable: expose the viewport property as viewport_*
...
The code generator forward that the the viewport
2020-09-22 13:52:27 +02:00
Olivier Goffart
b36a9004ef
Move the RepeaterInner in a Rc and use that for the ModelPeer
2020-09-21 15:23:24 +02:00
Simon Hausmann
7053aee0c8
Pass the ComponentWindow to ItemVTable::input_event
2020-09-18 16:18:48 +02:00
Olivier Goffart
bfe2bf2478
Ability to read properties of a struct
2020-09-17 13:53:00 +02:00
Olivier Goffart
8134fe5088
Support for named type as property
2020-09-17 13:14:01 +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
79ba5d9de8
Provide a window reference in various ItemVTable functions
...
Access to the window, in particular the scale factor, will be needed in a few places.
2020-09-15 15:55:47 +02:00
Olivier Goffart
4de2e57175
Use a Model trait in the rust backend
2020-09-14 14:02:34 +02:00
Olivier Goffart
8761ca80a3
Add SharedArray::push and adjust a bit the API
2020-09-09 18:47:15 +02:00
Olivier Goffart
6065127581
Some progress towards signal with arguments
...
Generated code compile, but i haven't tested if it works yet
2020-09-08 17:41:20 +02:00
Olivier Goffart
a6504ee61b
Start implementing some code that passes argument to functions and signals
2020-09-08 14:37:44 +02:00
Olivier Goffart
e997dff094
Use a reference as a signal argument.
...
It will be easier to make that work with C++
2020-09-08 12:12:01 +02:00
Olivier Goffart
e10ed650ee
Lookup of signal argument within a signal handler
2020-09-08 12:12:01 +02:00
Olivier Goffart
9f026c820d
Parse declaration of signal with arguments
2020-09-07 17:41:24 +02:00
Olivier Goffart
16f5cf42e3
Actually compute the layout of elements within a for loop
2020-09-07 14:04:14 +02:00
Simon Hausmann
ec36a50a25
Add support for warning diagnostics
...
They're emitted via codemap_diagnostics. For the Rust proc-macro we
generate a funny warning symbol until the proper APIs are stable.
2020-09-04 20:28:43 +02:00
Olivier Goffart
f5aeb9ba60
Only the computation of the model needs to be done in the evaluation scope for it
...
Otherwise any change in any of the properties of the delegate will cause
the model to be reset.
2020-09-04 15:37:38 +02:00
Olivier Goffart
9fbb40d91b
Start working on a debug statement
2020-09-03 19:10:07 +02:00
Simon Hausmann
3b971a2e2f
Remove Color::From<u32>
...
Instead make it clear on the call site what the encoding is (argb).
2020-09-03 11:17:40 +02:00
Simon Hausmann
5dbd0b213c
Add support for grid layout padding
2020-08-28 15:06:14 +02:00
Simon Hausmann
7976a4057f
Improve handling of nested layouts
...
We support directly nested layouts, but we did not support indirect
nesting:
GridLayout {
Rectangle {
l2 := GridLayout { ... }
}
}
This patch fixes that by detecting this scenario and merging the layout
info of the element (Rectangle) and the layout inside (l2). This makes
it much easier to create re-usable components that use layouts
themselves and allows placing them in layouts.
2020-08-28 15:06:14 +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
420fc2dc36
Fix bug in rust code generation for *=
2020-08-24 08:56:10 +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
4a74f6d0a3
Implement releasing graphics resources in Rust via Drop
...
Further enhances #12
2020-08-14 13:44:53 +02:00
Simon Hausmann
3b4bcd51d4
Clean up window field initialization in the Rust generator
...
Use an option instead of a vector sequence expansion to achieve the effect
of an optional token expansion.
2020-08-14 10:27:49 +02:00
Olivier Goffart
fb5a82b6c7
Fix acessing repeater variable in a nested repeater, and fix array as property
2020-08-13 15:38:28 +02:00
Simon Hausmann
fc6c35bb3f
Fix formatting of generated code
...
Second attempt, remove all trialing spaces
2020-08-13 13:59:05 +02:00
Simon Hausmann
c394a10a85
Remove trailing spaces
2020-08-13 13:51:00 +02:00
Simon Hausmann
b96b627a4f
Release graphics resources of items when destroying components
...
This is only implemented for Rust at the moment.
2020-08-13 13:31:29 +02:00
Olivier Goffart
7e1af72a2e
Implement minimum/maximum width/height properties
2020-08-12 14:00:51 +02:00
Olivier Goffart
092411ccef
Attempt to merge the layout code between rust and C++
...
This does not actually merge so much but it is better than nothing.
I was not able to merge the code from the interpreter because of the life time issues
2020-08-12 11:53:39 +02:00
Simon Hausmann
b21aa4f9e7
Rename PropertyListenerScope to PropertyTracker
2020-08-12 11:31:33 +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
9fd7d35b0d
Remove stray scale_factor properties
2020-08-11 15:10:43 +02:00
Simon Hausmann
c1f91e38ca
Move the window scale factor into GraphicsWindow
2020-08-11 13:42:51 +02:00