Olivier Goffart
74bc9521b9
Fix the scope while resolving a model expression
...
The `self` was always referring to the `root` instead of the enclosing
element.
2021-07-26 11:08:46 +02:00
Olivier Goffart
ae210e79ec
Properly handle self assignment on non-float types
2021-07-23 16:33:50 +02:00
Olivier Goffart
01f11695a7
Properly merge the animation when inlining and removing aliases
...
Fix #193
Fix #345
2021-07-23 15:25:53 +02:00
Olivier Goffart
ff8f7930d2
ListView: fix default height of items
2021-07-22 17:13:36 +02:00
Olivier Goffart
a6d3b11bd9
Remove a test that don't pass (yet)
...
I thought i had fixed it, but apparently not.
More work is needed
2021-07-22 15:27:24 +02:00
Olivier Goffart
6a49024839
Fix date in license header in new file
...
I imported this file from an old file and it still had the previous year
2021-07-22 14:44:35 +02:00
Olivier Goffart
8743ff87ed
Consider that elements in a listview are part of a layout
2021-07-22 14:38:58 +02:00
Olivier Goffart
19ad14b6f2
C++: Fix assigning a @linear-gradient to a color property
2021-07-22 14:38:58 +02:00
Olivier Goffart
0a46b367e2
C++: fix creating a gradient from a const reference to a color
2021-07-22 14:38:58 +02:00
Olivier Goffart
c2433d0f0b
Fix panic when parsing linear-gradient with a trailing coma
2021-07-22 14:38:58 +02:00
Simon Hausmann
f4ffbd3d3d
Fix panic when editing text after programmatically replacing it
...
When replacing the text, it may happen that the cursor position becomes outdated.
As per #331 we should make sure that this is handled also on an API level,
but this patch at least avoids the panic triggered by using editing.
2021-07-19 18:30:06 +02:00
Olivier Goffart
722ae70284
Test: Don't use rust syntax to initialize C++ struct
...
I wonder why it worked with gcc, this is not even the C++20 syntax
2021-07-15 18:35:44 +02:00
Olivier Goffart
e633ee825d
Fix error with struct that are only referenced by callbacks
...
We would have a compilation error in rust or C++ because the
collect_struct visitor would not visit these type and not produce
them correctly
2021-07-15 14:06:49 +02:00
Olivier Goffart
cc8249212d
Fix name conflict when having two global with the same name in different files
...
Give globals an unique id so two global with the same name imported
from different file don't clash
Fixes #159
2021-07-13 14:36:38 +02:00
Olivier Goffart
1eb54a4743
The clip property now clips the mouse events
...
Fixes #180
Note that there is still a small issue that the clipped element may
not recieve the MouseExit event because it is still considered
having the mouse.
2021-07-12 15:39:39 +02:00
Tobias Hunger
dc51d4ccda
Use impl Default
instead of new()
constructors
2021-07-12 13:22:25 +02:00
Olivier Goffart
7193cbeec1
Revert "C++ Fix struct with a field that has the same name as the struct itself"
...
This reverts commit 9e70e009a2
.
This turns out to break CI
Changed the test not to use the same name for a field and the struct
2021-07-09 15:52:28 +02:00
Olivier Goffart
9e70e009a2
C++ Fix struct with a field that has the same name as the struct itself
2021-07-09 14:37:42 +02:00
Olivier Goffart
6ed5044940
Fix rust compilation when using keywords in struct
2021-07-09 13:33:09 +02:00
Olivier Goffart
5c18e100b0
Fix unary operator + in rust
2021-07-09 12:52:18 +02:00
Olivier Goffart
8e52b7d865
Fix bug that caused two way binding to sometimes disapear
2021-07-08 17:44:50 +02:00
Olivier Goffart
6cd9d77abd
Test flickable to actually test something
...
For some reason the test was disabled, and one of the value was off
Also add a InheritFlickable (just so we test Flickable in sub components)
2021-07-07 17:48:34 +02:00
Olivier Goffart
920903ad19
Throw an error if there are duplicated id in a component
2021-07-07 12:31:40 +02:00
Tobias Hunger
ec5646566a
Janitor: Use insert over insert_str to insert a single character
2021-07-03 22:34:53 +02:00
Tobias Hunger
af7e53566b
Janitor: clippy says to prefer writeln! over write! ending in \n
2021-07-03 22:34:53 +02:00
Olivier Goffart
13bd828b96
Update license date
2021-07-02 15:55:54 +02:00
Olivier Goffart
9faf16ebe1
GridLayout: fix layout with rowspan and colspan
...
One should not simply distribute the maximum and minimum sizes amongst
the spans, one should make sure that each coinstraints is respected
2021-07-02 12:30:07 +02:00
Olivier Goffart
35e20763a7
More replacement of &*std::begin
with std::data
...
Complement the previous commit.
It is not ok to call *std::begin for an empty vector.
Also added a test for it.
2021-06-30 17:10:58 +02:00
Olivier Goffart
32e59cf040
Fix division by 0 when layouting empty images
2021-06-22 14:27:01 +02:00
Olivier Goffart
cb75d44acc
Fix setting model properties to aliased properties
2021-06-22 13:31:27 +02:00
Olivier Goffart
d0923bd82f
Height for width for Image in layout
2021-06-21 12:24:36 +02:00
Olivier Goffart
c0d813424d
Add C++/Rust/JS test for accessing image dimensions
2021-06-21 12:00:57 +02:00
Olivier Goffart
99c140ae08
Allow accessing the width and height of the image in .60
...
Closes #208
2021-06-21 11:22:50 +02:00
Olivier Goffart
42c25248a8
Allow to give a name to for
and if
2021-06-18 16:40:40 +02:00
Olivier Goffart
52e85933ed
Fix unit tests
...
Code was moved, so the test need to be adapted to that
2021-06-18 15:46:45 +02:00
Olivier Goffart
0b6bd7b219
Fix accessing elided property
...
Fixes #177
2021-06-18 15:08:30 +02:00
Olivier Goffart
4e0a91c35a
Test for Flickable layout and small layout fix
...
Test for issue #194 which was already fixed.
And also fix a small other issue where the preferred size was not properly
computed in layouts.
Closes #194
2021-06-18 14:27:01 +02:00
Olivier Goffart
a0bea36e43
Fix preferred size of the Window with a layout
...
A few problem:
- the horizontal and vertical property were swapped
- The implementation of the "preferred_xxx" property was not materialized properly
because the `bindings` were borrowed in the materialize_fake_properties pass
- Since the Window has a stretch factor of 0., the preferred size of the inner layout
was not taken into account when merging the LayoutInfo. I believe taking the
maximum preferred size is the right solution when merging them.
2021-06-18 13:51:25 +02:00
Olivier Goffart
51d532d209
Fix grid layout tests
...
One must make sure the initial preferred size is clamped within the
max and min size
2021-06-18 11:37:58 +02:00
Simon Hausmann
9965dca031
Fix formatting
2021-06-17 11:20:44 +02:00
Simon Hausmann
7b95371c78
Move the Rust tutorial into a sub-directory
...
To make room for the C++ version next to it :-)
2021-06-17 11:04:43 +02:00
Olivier Goffart
deaa0fddb0
WIP layout: split vertical and horizontal cache
...
Split the vertical and horizontal pass into different property cache
This will allow to implement "height for with"
This patch does not port the Rust or C++ binding yet
2021-06-16 15:14:07 +02:00
Simon Hausmann
cf5d554338
Fix doctests on Windows, part 3
...
It seems that the path attribute takes a unix-style path, even on Windows.
2021-06-16 14:22:59 +02:00
Simon Hausmann
4153c03477
Prospective fix for doctests on Windows
2021-06-16 14:03:46 +02:00
Simon Hausmann
8bc8767e17
Test the tutorial Rust code in doctests
...
This implicitly also "tests" the .60 code since we're using the macro
2021-06-16 13:35:16 +02:00
Olivier Goffart
ee00c9eb92
Rename maximum- and minimum- properties to max- and min-
...
Issue #259
2021-06-14 10:28:30 +02:00
Olivier Goffart
2483425d57
Add abs()
2021-06-11 14:17:47 +02:00
Olivier Goffart
6c1aa9bd8f
Add a pass to always have the top level as a Window
2021-06-09 11:02:55 +02:00
Olivier Goffart
ce34ff87d0
Finish support for callback aliases
...
cc #111
2021-06-07 20:40:36 +02:00
Olivier Goffart
715d38903f
Allow to omit the type of aliases
2021-06-07 10:48:09 +02:00