These are chat archives for AvaloniaUI/Avalonia

16th
Aug 2017
Matthijs ter Woord
@mterwoord
Aug 16 2017 06:06
So, it the styling of the button a known thing? (I can make a custom "ROund" style for :pointerover, for normal, but presssed behaves differently)
Nikita Tsukanov
@kekekeks
Aug 16 2017 06:35
I think, there is currently a bug that prevents doing that in easy way
We should be able to write something like
<Style Selector = "Button:pointerover /template/ Border">
     <Setter Property="CornerRadius" Value="15"/>
</Style>
But there was an issue with property values from templates having wrong priority (LocalValue, I think)
So styles only work if property wasn't set from the template
I. e. this style should work with our default theme
But if you'll try to change something else it might fail
Matthijs ter Woord
@mterwoord
Aug 16 2017 07:08
but things work differently based on the selector
if i use the same style i use as pointerover for pressed, i get errors
i could make a sample project....
danwalmsley
@danwalmsley
Aug 16 2017 15:06
@grokys is there anything we can do to workaround the high cpu usage for now? when Avalon studio is sat idling, its like 40% cpu usage
Steven Kirk
@grokys
Aug 16 2017 15:06
on what backend?
danwalmsley
@danwalmsley
Aug 16 2017 15:07
netcore + win32 + skia
its since scenegraph was merged
image.png
never goes below 30%
I tried profiling it, and it said it was spending most time in libskia
so I guess its basically constantly rendering
Steven Kirk
@grokys
Aug 16 2017 15:09
yeah, probably due to the fact it's having to composite on every frame
danwalmsley
@danwalmsley
Aug 16 2017 15:10
what does that mean :) ?
draw all the bitmaps into a single screen buffer at the end?
Steven Kirk
@grokys
Aug 16 2017 15:11

from AvaloniaUI/Avalonia#827:

All layers are still composited on every frame, whether there is something to draw or not. This is beacuse D2D is double buffered and we need to be sure both buffers are updated. We need to provide dirty rects when flipping the swap chain to fix this.

you can try fixing that if you want!
i'm taking a break from avalonia because i'm sick of VS2017's shit
danwalmsley
@danwalmsley
Aug 16 2017 15:12
its worrying how bad its got
Steven Kirk
@grokys
Aug 16 2017 15:12
i'll be back soon though
assuming i can actually get anything done
danwalmsley
@danwalmsley
Aug 16 2017 15:12
vscode isn't usable either for anything other than a small project iv found
have your tried rider?
Steven Kirk
@grokys
Aug 16 2017 15:15
not yet no, not got much time atm
danwalmsley
@danwalmsley
Aug 16 2017 15:16

you can try fixing that if you want!

where would I start?

Steven Kirk
@grokys
Aug 16 2017 15:33
good question
it only really needs to be called if scene.Generation != _lastSceneId and the overlay (FPS, dirty rects display) hasn't changed
however if you move it into the if above then you'll see flickering
that's because only one of the dual buffers has been updated
you should be able to use https://msdn.microsoft.com/en-us/library/windows/desktop/hh446797(v=vs.85).aspx to get around that but i didn't manage to get it working
Nikita Tsukanov
@kekekeks
Aug 16 2017 16:27

i'm taking a break from avalonia because i'm sick of VS2017's shit

Rider is now able to open our solution

Mostly without issues
On Linux it complains about iOS/Android projects, but that's it
Nikita Tsukanov
@kekekeks
Aug 16 2017 16:33
BTW
@grokys
we really should clear the viewport before rendering
With black color
if we leave it transparent
Weird rendering artifacts happen during resize
Steven Kirk
@grokys
Aug 16 2017 16:35
ok
Nikita Tsukanov
@kekekeks
Aug 16 2017 16:35
Hm
It might be actually unrelated
I've checked with the old version and still seeing that
You should really try rider
After merging skia-merge it no longer shows weird errors
Nikita Tsukanov
@kekekeks
Aug 16 2017 16:40
It should be included to that All Products Pack we've got from JB in October last year
Matthijs ter Woord
@mterwoord
Aug 16 2017 17:04
is there a known bug in templating?
The following set of templates doesn't work:
meaning, normal and pointerover work fine, but pressed crashes
InvalidOperationException: The control already has a visual parent
Nikita Tsukanov
@kekekeks
Aug 16 2017 17:16
It's probably a bad idea to change the whole template anyways
That will recreate controls, cause layout pass
Matthijs ter Woord
@mterwoord
Aug 16 2017 17:16
you mean the :pressed template?
shoot
:pressed
?
if i make it similar to :pointerover it doesn't get used
so my listed template for pressed is aready a work around.
sorry for that
Nikita Tsukanov
@kekekeks
Aug 16 2017 17:18
Just change property values using selectors
That should be fine
Matthijs ter Woord
@mterwoord
Aug 16 2017 17:18
you mean like the pointerover one?
thing is the pressed selector behaves differently than the pointerover one
danwalmsley
@danwalmsley
Aug 16 2017 18:00
@mterwoord what's the effect / control you are trying to implement?
Nikita Tsukanov
@kekekeks
Aug 16 2017 18:06
CornerRadius/Background changes on pointerover/press, I guess
But for some reason he tries to completely change control template
for \:pressed state
Steven Kirk
@grokys
Aug 16 2017 18:11
to be fair you should be able to completely change the control template there. doesn't mean it's a good idea though ;)
we use that technique for certain other controls i think
I want this effect in avalonia