These are chat archives for AvaloniaUI/Avalonia

6th
May 2018
walterlv
@walterlv
May 06 2018 00:00
I always discuss about the algorithm with him.
image.png
This is the TreeView fixing commit.
walterlv
@walterlv
May 06 2018 00:40
I still have to fix the AggregateAdditionalConventionsForStars method.
I'm trying to figure out an algorithm for it. If I fails, I may have another discussion with @lindexi when he is online.
walterlv
@walterlv
May 06 2018 01:37
@grokys I've finished the AggregateAdditionalConventionsForStars method.
So all the known bugs are fixed.
Steven Kirk
@grokys
May 06 2018 04:11
ok great @walterlv! going to do a review now
first thing is i've noticed a few grammar/spelling errors in the comments. i know that english isn't your first language - would you like me to just leave comments where it's wrong, or commit changes fixing them myself?
walterlv
@walterlv
May 06 2018 04:22
Of course
Steven Kirk
@grokys
May 06 2018 04:23
should I leave comments for you to fix them, or fix them myself?
walterlv
@walterlv
May 06 2018 04:24
Let me fix them, so that I can improve my English skill.
Steven Kirk
@grokys
May 06 2018 04:25
sure :D
Steven Kirk
@grokys
May 06 2018 04:41
ok, i'm going to do a first pass with just corrections to grammar/spelling. i hope it doesn't seem like I'm criticizing! i will continue to try to understand the code, but that is harder to do :)
in general though it looks a lot easier to understand than the old code
Steven Kirk
@grokys
May 06 2018 04:50
the reason i want to correct the english is that you were saying that the documentation needs to be good ;) so just trying to make sure i understand it
walterlv
@walterlv
May 06 2018 04:54
I'm glad to.
Steven Kirk
@grokys
May 06 2018 05:02
ok, done that review
i can't say I 100% understand the code still, but I think I could work it out if I need to
which is the important part
walterlv
@walterlv
May 06 2018 05:16
image.png
walterlv
@walterlv
May 06 2018 06:18
@grokys I pushed a new commit fixing the spelling and grammar errors except those we were not sure.
Steven Kirk
@grokys
May 06 2018 06:18
thanks!
which weren't you sure about?
walterlv
@walterlv
May 06 2018 06:21
Those conversations that I answered you without your reply.
Steven Kirk
@grokys
May 06 2018 06:27
ah ok, sorry, i thought the replies were what you were going to write in the comments
let me take another look
walterlv
@walterlv
May 06 2018 06:27
Thanks for helping me a lot.
Steven Kirk
@grokys
May 06 2018 06:29
no problem! thanks for the PR - it's amazing. i can't imagine how much work it took
i've replied to the comments
walterlv
@walterlv
May 06 2018 06:31
ok
walterlv
@walterlv
May 06 2018 06:42
image.png
This is the last one that I'm not sure how to write.
walterlv
@walterlv
May 06 2018 06:50
I pushed a new commit with all grammar issues fixed.
Steven Kirk
@grokys
May 06 2018 07:07
hmm yeah, i'm still not sure i understand what you mean there
can you try to explain a bit more?
danwalmsley
@danwalmsley
May 06 2018 08:50
@grokys regarding stopping the renderer when minimized I added a review
was wondering if you can go directly from minimized to maximized?
It will be interesting to see how this affects my issue
danwalmsley
@danwalmsley
May 06 2018 08:58
@walterlv trying your PR
<Controls:ToolBar DataContext="{Binding ToolBar}" Grid.Row="1" Margin="15 4 0 4" />
Grid.Row="1" now throws an exception in the XAML parser
seems RowSpan also
Portable.Xaml.XamlObjectWriterException: 'Cannot set unknown member '{clr-namespace:AvalonStudio.Controls;assembly=AvalonStudio}QuickCommander.Grid.RowSpan''
perhaps attached properties for Grid got broken?
@grokys do you know what might have happened here?
Wiesław Šoltés
@wieslawsoltes
May 06 2018 09:25
It's known issue
AvaloniaUI/Avalonia#1548
And has PR with fix AvaloniaUI/Avalonia#1552
Wiesław Šoltés
@wieslawsoltes
May 06 2018 11:44
@jmacato CoreRT is currently broken for AvaloniaUI dotnet/corert#5776
At least when using latest master builds with drag & drop functionality :worried:
Jumar Macato
@jmacato
May 06 2018 12:06
hey,
it's a touchy subject when STA is involved. I hope the CoreRT guys has a fix for it :(
Wiesław Šoltés
@wieslawsoltes
May 06 2018 12:13
Yeah I hope so it will be possible.
Wiesław Šoltés
@wieslawsoltes
May 06 2018 12:35

@boombuler Seems something has changed in master, previously I could get mouse cursor position using:

            var root = sender as IControl;
            var point = (root.VisualRoot as IInputRoot)?.MouseDevice?.GetPosition(root) ?? default(Point);

but currently I can not get any valid mouse position.

My current code:
           var control = sender as IControl;
            var point = (control.GetVisualRoot() as IInputRoot)?.MouseDevice?.GetPosition(control) ?? default(Point);
The issue in only present during drag and drop.
Drag and drop also halts all mouse events.
In WPF I could just call in Drop(object sender, DragEventArgs e) handler e.GetPosition(...)
Florian
@boombuler
May 06 2018 12:44
This ist due to The fact that The Windows native dragging ist used. But zur drag Events should have coordinates too
Wiesław Šoltés
@wieslawsoltes
May 06 2018 12:49
So its is possible to add GetPosition method to DragEventArgs ?
Wiesław Šoltés
@wieslawsoltes
May 06 2018 12:55
AvaloniaUI/Avalonia#1555
The RAW Events know The Location... So it needs to be dispatched
Wiesław Šoltés
@wieslawsoltes
May 06 2018 13:45
@boombuler Submited PR AvaloniaUI/Avalonia#1556, feedback is welcome :smile:
Florian
@boombuler
May 06 2018 14:05
Looks fine to me
Wiesław Šoltés
@wieslawsoltes
May 06 2018 14:07
@grokys @danwalmsley Could you review AvaloniaUI/Avalonia#1556 when you have time :smile:
Steven Kirk
@grokys
May 06 2018 14:09
@wieslawsoltes will do!
Florian
@boombuler
May 06 2018 14:10
Sorry does Not Look fine... I leave a comment
Steven Kirk
@grokys
May 06 2018 14:11
@wieslawsoltes got a question
Florian
@boombuler
May 06 2018 14:14
November The Argument Determination to Raisedragevent. This will remove Code duplication
Sorry mobile Keyboard...
Steven Kirk
@grokys
May 06 2018 14:16
reads like poetry
Florian
@boombuler
May 06 2018 14:21
Should be "move" Not November
Wiesław Šoltés
@wieslawsoltes
May 06 2018 14:21
Move to RaiseDragEvent method
_lastTarget != null ? inputRoot.TranslatePoint(point, _lastTarget) : point
Florian
@boombuler
May 06 2018 14:22
Exactly. You could also use "target" there imho
Wiesław Šoltés
@wieslawsoltes
May 06 2018 14:28
@boombuler Pushed fix for code duplication to PR
Wiesław Šoltés
@wieslawsoltes
May 06 2018 14:36
@grokys Pushed some fixes and added comments to your review.
Steven Kirk
@grokys
May 06 2018 14:38
@wieslawsoltes added another comment :)
Wiesław Šoltés
@wieslawsoltes
May 06 2018 14:43
Pushed fix :smile: and added reply
Florian
@boombuler
May 06 2018 14:46
Target should only bei null If Something ist wrong with hittesting
Steven Kirk
@grokys
May 06 2018 14:51
approved!
Wiesław Šoltés
@wieslawsoltes
May 06 2018 14:52
:sparkles:
@boombuler Is the PR ok to be merged ?
Florian
@boombuler
May 06 2018 14:53
Yes
Wiesław Šoltés
@wieslawsoltes
May 06 2018 14:55
Great! Thanks for your help @boombuler @grokys !
Florian
@boombuler
May 06 2018 14:56
You're welcome. 😎
Wiesław Šoltés
@wieslawsoltes
May 06 2018 15:24
Is there a way to obtain keyboard modifiers or key status from other code that key event?
Steven Kirk
@grokys
May 06 2018 15:30
there used to be but i think it was removed
Wiesław Šoltés
@wieslawsoltes
May 06 2018 15:31
I want to check for Ctrl key when I do Drag & Drop in TreeView :fire:
useful commit message there
Wiesław Šoltés
@wieslawsoltes
May 06 2018 15:35
Yes indeed :smile:
Steven Kirk
@grokys
May 06 2018 15:35
AvaloniaUI/Avalonia#102 i think might be the related issue?
i guess modifier keys need to be passed to the drag/drop events too
Wiesław Šoltés
@wieslawsoltes
May 06 2018 15:36
Yep
Added issue to not forget : AvaloniaUI/Avalonia#1557
Steven Kirk
@grokys
May 06 2018 15:39
i guess so?
Wiesław Šoltés
@wieslawsoltes
May 06 2018 15:41
@boombuler What would it take to implement #1557 ?
This is now possible :smile:
Still need small hack:
        public Point FixInvalidPointPosition(IControl control, Point point)
        {
            var matrix = control?.RenderTransform?.Value;
            return matrix != null ? MatrixHelper.TransformPoint(matrix.Value.Invert(), point) : point;
        }
When I use transforms, in my case in form of pan & zoom control.
Steven Kirk
@grokys
May 06 2018 15:43
why is that hack needed?
Florian
@boombuler
May 06 2018 15:44
The default drag action should already be determined by the keyboard control states
Wiesław Šoltés
@wieslawsoltes
May 06 2018 15:51

why is that hack needed?

The render transform is not taken into account when processing pointer events.

So I have to translate them myself.
Wiesław Šoltés
@wieslawsoltes
May 06 2018 15:56
Oh
I have found solution :fire:
I initiate my drag in PointerMoved event :smile:
My issues is solved.
Currently I don't need #1557
Florian
@boombuler
May 06 2018 16:02
for the InProcessDragSource it would be easy to send the modifier keys with the drag event
For windows I guess the answer is within the grfKeyState argument of
https://github.com/AvaloniaUI/Avalonia/blob/master/src/Windows/Avalonia.Win32/OleDropTarget.cs#L48
and the other methods
Steven Kirk
@grokys
May 06 2018 16:12

The render transform is not taken into account when processing pointer events.

hmm, sounds like a bug

Wiesław Šoltés
@wieslawsoltes
May 06 2018 17:34
@grokys Submited issue with small repro AvaloniaUI/Avalonia#1558
Steven Kirk
@grokys
May 06 2018 17:34
awesome! thanks
Wiesław Šoltés
@wieslawsoltes
May 06 2018 17:45
Drag & drop using AvaloniaUI in Core2D: https://youtu.be/iTm9_0oop-0 :fire:
Steven Kirk
@grokys
May 06 2018 18:00
niiiiceee!
so have you removed the WPF version of Core2D?
Wiesław Šoltés
@wieslawsoltes
May 06 2018 18:01
Only in working branches, master still has WPF
But testing CoreRT stuff was not possible using WPF as I have removed commands and using binding to methods.
But addition of drag & drop is one big step closer of dumping WPF version.
danwalmsley
@danwalmsley
May 06 2018 18:08
my brother was out walking with someone yesterday that he'd never met before, was a dotnet guy. He mentioned Avalonia, they guy already knew about it!
Steven Kirk
@grokys
May 06 2018 18:08
hehe :)
@wieslawsoltes @danwalmsley don't know if this interests you: #1560
danwalmsley
@danwalmsley
May 06 2018 18:09
some recent PR broke something either with spacings, or styles not getting applied, I'm investigating which PR did it, will update soon
@grokys if you see the comments I left on the Grid PR, those screenshots are related to some change in master recently
Wiesław Šoltés
@wieslawsoltes
May 06 2018 18:10
@grokys Not sure how this will affect out code base
danwalmsley
@danwalmsley
May 06 2018 18:10
but I assumed it was the grid pr at first
don't know if you know of anything recent that could have changed things like that
Steven Kirk
@grokys
May 06 2018 18:11
nothing comes to mind
maybe AvaloniaUI/Avalonia#1513 or AvaloniaUI/Avalonia#1499 ?
@wieslawsoltes do you think it will cause problems?
Wiesław Šoltés
@wieslawsoltes
May 06 2018 18:13
No idea
Hard to predict what will break :smile:
But no worries, if that simplifies code, than I will fix mine too :fire:
Steven Kirk
@grokys
May 06 2018 18:14
if you have type converters registered using [TypeConverter(typeof(T))] it should still use those
Wiesław Šoltés
@wieslawsoltes
May 06 2018 18:14
Did not find any TypeConverter in my code.
Wiesław Šoltés
@wieslawsoltes
May 06 2018 19:02
@grokys Actually I think I can remove WPF pretty soon. I did some tests and I can use some windows stuff that was WPF only from Avalonia app.
I just need to use multi-targeting and run AvaloniaUI app on net461 target framework.
Wiesław Šoltés
@wieslawsoltes
May 06 2018 19:07
I have WinForms renderer for Metafile (EMF) and .PDF exporter (PdfSharp) that target only net461 only. I can use them now from AvaloniaUI app using net461 target :fire:
JezielMoura
@JezielMoura
May 06 2018 22:13
I am from Brazil and I have been following the project for some time. I'm finding your work amazing. I will do my best to publicize this project here. Thank you for this beautiful initiative. (Sorry for my English)