These are chat archives for AvaloniaUI/Avalonia

25th
May 2016
Jeremy Koritzinsky
@jkoritzinsky
May 25 2016 02:45
@grokys After a cursory glance through the code it looks good. I think the reason it seems too simple is because of the hard problems that you have as the checkbox items in the PR. Some of those might be why this implementation is so much smaller. Another reason could be technical debt within WPF that made it so difficult. Virtualization was probably added towards the end of development for the first version, and we know that the first release took forever to be completed.
This message was deleted
@danwalmsley Let me know when you get a chance to test #544 and if it does what you need. I want to merge it before I create a pr for #485.
danwalmsley
@danwalmsley
May 25 2016 16:03
@jkoritzinsky will give this a try very soon
Wiesław Šoltés
@wieslawsoltes
May 25 2016 18:53
Hit-testing works very nice !
https://www.youtube.com/watch?v=M5eaA88n_0c
Wiesław Šoltés
@wieslawsoltes
May 25 2016 19:00
One issue I have found is that when I get point from e.g.: PointerPressedEventArgs.GetPosition(...) the point invalid, it should be corrected by used transforms, this is how WPF is doing things.
danwalmsley
@danwalmsley
May 25 2016 19:56
@jkoritzinsky @grokys iv tested #359 I think it can be merged to master, seems to work well for me :)
Steven Kirk
@grokys
May 25 2016 19:56
great! "Works On My Machine (tm)" ;)
will take a final look through the code later and merge
danwalmsley
@danwalmsley
May 25 2016 20:08
yeh
@grokys with the virtualized listbox
I my listbox has maxheight = x
then what determines how many items will get displayed?
before virtualization id get like 5 or 6 items say
but now I get just 1, perhaps it used to take into account maxheight / height, but now doesn't?
Steven Kirk
@grokys
May 25 2016 20:10
ah yeah... it will only display one because it'll virtualize the rest...
i wonder what WPF does there?
danwalmsley
@danwalmsley
May 25 2016 20:10
on wpf it showed as many as it can until maxheight is reached
then virtualize the rest
Steven Kirk
@grokys
May 25 2016 20:11
yeah, that makes more sense
ok, will do that
danwalmsley
@danwalmsley
May 25 2016 20:12
ok thanks
apart from that it seems to be working well now
still testing more
danwalmsley
@danwalmsley
May 25 2016 20:18
@grokys does BringIntoView work for the virtualized listbox yet?
I have this...
image.png
Steven Kirk
@grokys
May 25 2016 20:18
not yet, no
danwalmsley
@danwalmsley
May 25 2016 20:19
but when I use arrow keys to go down, the list doesn't scroll
Steven Kirk
@grokys
May 25 2016 20:19
there's no control for it, so there's nothing to bring into view
danwalmsley
@danwalmsley
May 25 2016 20:19
actually I think I saw your note about that
Steven Kirk
@grokys
May 25 2016 20:19
yeah, that's in the PR
danwalmsley
@danwalmsley
May 25 2016 20:19
ok cool
yeh I think I'm just doing SelectedIndex++
to move it down
ok cool, performance is good though even loading large data set :)
Steven Kirk
@grokys
May 25 2016 20:34
awesome! i know it can be better
danwalmsley
@danwalmsley
May 25 2016 20:35
will it work (not now but in future) settings SelectedItem
and auto scrolling to that item?
I have my own branch on Avalon studio with loads of changes ready to hit when this gets merged to master :)
its going to make a huge difference for me
danwalmsley
@danwalmsley
May 25 2016 22:02
@grokys, another think in Virtualize Listbox
you may have noticed
when its bound to an ObservableCollection
and you do a remove
it either doesn't remove from list
(or doesn't re-render)
for me
it looks like items are still in list, but I cant click on them
yeh its definitely not coping with INCC very well
when things get removed and then new items added, they look like the old ones
but the data backing them are new items, with different values
Steven Kirk
@grokys
May 25 2016 22:47
ok yeah - thinking about it, i don't handle that!
still some ways to go, obviously! ;)
danwalmsley
@danwalmsley
May 25 2016 22:49
getting close :)
@grokys with popup placementmode = pointer
how can I make it place a little off the pointer rather than directly on it?
ah, we need to implement vertical and horizontal offset properties, which wpf supports
I will try and nock up a PR for that ;)
Steven Kirk
@grokys
May 25 2016 22:58
yeah, our popup placement stuff is really lacking atm
danwalmsley
@danwalmsley
May 25 2016 23:17
@grokys is there a kind of PointToScreen method
where you don't need to pass it an ivisual?
just if you want to scale something from independent units to pixels?
Steven Kirk
@grokys
May 25 2016 23:18
well that scaling is based on the window, so you have to have something to base it on
danwalmsley
@danwalmsley
May 25 2016 23:19
its with popup when placement mode = mouse
I need to change the offsets to screen pixels
Steven Kirk
@grokys
May 25 2016 23:20
popup placement is already screen pixels
danwalmsley
@danwalmsley
May 25 2016 23:20
but I'm not sure if its guaranteed there would be a target in that place so not sure what to use to get pixels?
Steven Kirk
@grokys
May 25 2016 23:20
a target in what place?
danwalmsley
@danwalmsley
May 25 2016 23:21
I'm changing GetPosition in popup.cs
to take into account new properties vertical and horiz offsets
 switch (mode)
            {
                case PlacementMode.Pointer:
                    if(MouseDevice.Instance != null)
                    {
                        return MouseDevice.Instance.Position + target.PointToScreen(new Point(HorizontalOffset, VerticalOffset));
                    }
                    return default(Point);                                        

                case PlacementMode.Bottom:
                    return target?.PointToScreen(new Point(0 + HorizontalOffset, target.Bounds.Height + VerticalOffset)) ?? zero;

                case PlacementMode.Right:
                    return target?.PointToScreen(new Point(target.Bounds.Width + HorizontalOffset, 0 + VerticalOffset)) ?? zero;

                default:
                    throw new InvalidOperationException("Invalid value for Popup.PlacementMode");
            }
for bottom and right its really straight forward
but for mousedevice... is target valid to use?
Steven Kirk
@grokys
May 25 2016 23:22
i think i'd just expect the offsets to be in screen pixels for that
as it's not related to a window
or maybe 96dpi
not sure
but if you're saying "pop up at the mouse position" then there is no answer for current dpi
as dpi is per-window
i guess you could use the dpi of the popup itself?
danwalmsley
@danwalmsley
May 25 2016 23:24
wpf uses DIPs for the offsets
how can I get DPI of the popup?
actually no,
or just call PointToScreen on the popup root maybe
danwalmsley
@danwalmsley
May 25 2016 23:30
popup root would be the main window right?
Steven Kirk
@grokys
May 25 2016 23:30
popup root is the, uh, root of the popup
danwalmsley
@danwalmsley
May 25 2016 23:32
hmm
ok I'm trying the popup root method