Steven Kirk
479d480ad9
Parameterize logger on area as well as level.
So we can filter our more logging calls early.
6 years ago
Steven Kirk
bd0b894271
Fix UseLayoutRounding calculations.
Ported `RoundLayoutSize` and `RoundLayoutValue` from WPF and use these to calculated layout rounding.
Fixes #3467 .
6 years ago
Steven Kirk
4d01dacd77
Remove copyright headers.
Some of our files had them, some didn't. They serve no purpose legally so best to remove the ceremony.
6 years ago
Steven Kirk
e9256a9e40
Initial implementation of add/remove styles.
Only currently works on top-level `Styles` collections, not working in `Application.Styles`.
6 years ago
Dariusz Komosinski
b6ed3bdbae
Move invalidation function to LayoutHelper.
6 years ago
Dariusz Komosinski
7a13d819fd
Optimize and add new efficient visual tree extensions.
6 years ago
Dariusz Komosinski
c864f5592c
Fix overlooked assignment.
6 years ago
Dariusz Komosinski
798bde1835
Cache visual children getter result.
6 years ago
Dariusz Komosinski
3e3eddca87
Save a few value lookups during arrange and measure.
6 years ago
Dariusz Komosinski
2b05319b6b
Remove unnecessary allocations from the layout loop.
6 years ago
Dariusz Komosinski
5814bd7163
Remove direct logging functions.
6 years ago
Dariusz Komosinski
01a404836e
Reduce allocations caused by logging.
6 years ago
Steven Kirk
b4d7d03afd
Constrain to availableSize in MeasureCore.
#2431 erroneously removed the `.Constrain(availableSize)` call in `Layoutable.Measure`. Now that the WPF source is available, I can see i that WPF does in fact constrain measure to availableSize and Grid relies on this.
Put constraint back in, undo the changes to the controls changed in #2431 (`StackPanel`, `Image`) and update the expected test results based on cross-checks with WPF in https://github.com/wieslawsoltes/WpfUnitTests/pull/1 .
7 years ago
Steven Kirk
7ac3556983
Fixed StackPanel arrange pass.
Now follow's WPF's behavior better. In order to get the desired outcome, the `.Constrain(availableSize)` call in `Layoutable.Measure` had to be removed. Controls that relied on that (`Image` and `ViewBox`) have to now call `Constrain` themselves.
Fixes #2350
7 years ago
Steven Kirk
f39e38545d
Use inner methods for invalidation.
8 years ago
Steven Kirk
c7b42d1326
Add the old overloads back in.
And mark them as `[Obsolete]`.
8 years ago
Steven Kirk
fad2e317ba
Make AffectsMeasure/Arrange/Render typed.
8 years ago
Miha Markič
0a38876590
Spellchecks all projects except for Base, Controls, Samples and Testing
8 years ago
Nikita Tsukanov
35f353c2db
Use OnMeasureInvalidated instead of virtual InvalidateMeasure
9 years ago
Steven Kirk
5a34acac2d
Don't need to do this.
We don't need to invalidate newly added controls with the layout manager - this is already handed by the parent control.
9 years ago
Steven Kirk
40c342989b
Assert control invalidation behavior.
Controls not attached to the visual tree should not notify the `LayoutManager` that they have had their layout invalidated. Similarly when added to the visual tree their parents and themselves should have their layout invalidated.
9 years ago
Nikita Tsukanov
09c9d7b7d5
Layout integration seems to be working now
9 years ago
Nikita Tsukanov
317b0f7034
testtesttest
9 years ago
Nikita Tsukanov
3126901721
WPF embedding improvements
9 years ago
Nikita Tsukanov
eb6bfd3de8
Moved layout manager from service locator to ILayoutRoot
9 years ago
Steven Kirk
4730ee1c41
Fix spelling of descendant.
While "descendent" is an acceptable English spelling, "descendant" is the common spelling.
9 years ago
Steven Kirk
16a47dac61
Apply margin before width/height.
Fixes #993 .
9 years ago
Steven Kirk
cfd2be07ec
Added LayoutUpdated event.
Fixes #825 .
9 years ago
Steven Kirk
c554467d13
Invalidate measure when control removed
When a control's parent changes, invalidate its measure and the measure
of all descendents.
10 years ago
Steven Kirk
5be41985c3
Renamed Perspex -> Avalonia
10 years ago
Steven Kirk
46c93b70bf
Fix layout error.
10 years ago
Steven Kirk
75e13dc02b
Fix arrange size with margins.
Fixes #432 .
10 years ago
Steven Kirk
ea6b1d4cfd
Starting removing hard dependency on Serilog.
Instead log through a static Logger, and provide a Serilog consumer for
this.
10 years ago
Steven Kirk
5802040d3e
Optimize ContentPresenter.
Make ContentPresenter have many of Border's properties so that every
instance of a ContentPresenter doesn't need to be wrapped in a Border.
Idea stolen from UWP.
10 years ago
Steven Kirk
a70c5aaa44
Invalidate visual on invalidate measure/arrange.
10 years ago
Steven Kirk
93b4d810b9
Moved scaling to per-window.
Always returning a scaling factor of 1 currently.
10 years ago
Steven Kirk
d460ec9fd0
Implemented basic layout scaling.
Maybe works... I don't have a high DPI monitor to test on...
10 years ago
Steven Kirk
d8725286aa
Fix layout bug with ScrollViewer.
When calling Measure from Arrange, use previous measure constraint if
available.
10 years ago
Steven Kirk
f7f2fc65b7
Make Arrange call Measure if !IsMeasureValid.
To follow WPF. Also removed force parameter from Arrange and fixed
Decorator measure invalidation.
10 years ago
Steven Kirk
5489487131
Make LayoutManager global.
Also made a few other changes along the way:
- Add MaxClientSize to ILayoutRoot
- Store IRenderRoot in Visual and use that to calculate
IsAttachedToVisualTree
- Make Affects* methods take multiple properties
10 years ago
Steven Kirk
72baba2f0e
Removed 'force' parameter from Measure.
10 years ago
Steven Kirk
b310ead6a1
Removed 'distance' argument to LayoutManager.
No longer needed.
10 years ago
Steven Kirk
0e2cee8810
Overhauled layout system.
From lessons learnt from porting moonlight's Grid tests. Instead of
making a child invalidate its parents directly, send a message from the
child to the parent when its DesiredSize changes. LayoutManager also
needed rewriting to allow this.
10 years ago
Steven Kirk
1202eaa876
Updated PerspexProperties to new classes
i.e. AttachedProperty, DirectProperty or StyledProperty.
10 years ago
Steven Kirk
928e159aba
Added DesiredSize as a readonly PP.
10 years ago
Steven Kirk
7925fa8c65
Cache Margin in MeasureCore.
10 years ago
Steven Kirk
4ef9639f3e
Removed LINQ from MeasureOverride.
And removed empty MeasureOverride methods.
10 years ago
Steven Kirk
9ad94743c0
Fix small layout bug with UseLayoutRounding.
10 years ago
Steven Kirk
8e2830ad05
Don't return negative size from Measure.
In the case of a negative margin larger than the available size.
10 years ago
Steven Kirk
67835cc09b
Applied a bunch of resharper suggestions.
10 years ago