-
Notifications
You must be signed in to change notification settings - Fork 6.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Settings > Color Picker] strange effect Toggle Switches when moving items #11087
Comments
@niels9001 |
I've seen that argument used before - also by you, but usually it's a result of shady coding. Really. |
@Jay-o-Way I don't say by general that every strange behavior is a xaml bug. But here my intention was that it isn't on every item. 🤔 |
@Jay-o-Way Let's keep feedback constructive! Most of the visual glitches are related to XAML Islands - either due to a bug, or a non-optimized way of coding around a bug or limitation. WinUI 3 support for unpackaged apps will hopefully get rid of most of these bugs, and will make the implementation easier. That said - in this case, it seems that the list gets reloaded everytime the order gets changed. As a result, the default ToggleSwitch animation kicks in and I think that's what we see here. Once we move to WinUI 3, we can (hopefully) go back to the previous solution (drag to re-order) solving all of the issues in one go. As it's a minor visual glitch (not resulting in a crash or blocking a setting), I'd wait for WinUI 3 to resolve it and not spend time on it now to get it fixed. |
I just wanted to say it's easy and unfair to say "must be XAML" when it might as well be a result of unnecessary or "creative" code.
Then why does it only apply to one other item and not all of them? |
I only want to mention that I wrote "Is it?". This means I asked if my idea can be correct. - So, I don't say in general it must be a xaml bug.
Strange things happen sometimes. And we can think the other way too: Why should we create different code for updating some of the listview items? |
I'm thinking it's because the whole list is re-built every single time. private void UpdateColorFormats()
{
_colorPickerSettings.Properties.VisibleColorFormats.Clear();
foreach (var colorFormat in ColorFormats)
{
_colorPickerSettings.Properties.VisibleColorFormats.Add(colorFormat.Name, colorFormat.IsShown);
}
} Can't we just move list-items, by giving them a new index? |
@Jay-o-Way I looked at this a bit more, and I think this is expected behavior. This is what happens if I'm correct: if the status of the item that gets moved is different than the new index, the ToggleSwitch animations shows. (You can see that this doesn't happen if you e.g. turn all formats on and start moving items around.). That means that the item template doesn't get re-rendered, just new data that gets bind to it. If the status is now different, the ToggleSwitch.IsOn property gets updated - and its animation will be shown. Only way to fix it is to remove the animation from the ToggleSwitch visual style. Therefore.. you could conclude that it's expected behavior. I agree it's not perfect, but also not a huge issue. Once we move to WinUI3 we can hopefully go back to using the drag-to-reorder functionality that doesn't have this visual "glitch". IMO we can mark this issue as "Won't fix" and close it. But let me know what you think. |
The different status of Toggle Switches inside of list items should not affect each other, if the entire list item is moved and no more actions are performed in the background. Again: it also affects list items that are not related to the actually moved items by index number. In a rare occation I even spotted a tiny animation (maybe a millisecond or so) on (the text of) one or two list items - which tells me something is acting on (or regenerating) the entire list every single time. I did some more looking and in some occasions it seems that (at least on my Surface Pro 4) it envolves either exactly one or two pairs of switches that are both "on" and "off" - for every permutation. It is too specific for me to be a general result of controls. I'm still diggin tho. Right now I'm suspecting functions like Maybe @SeraphimaZ might have an idea? She worked on this before? |
Now that we're going for WinUI3, will the drag-to-reorder property be enabled again? |
if you want to give it a shot, sure. We're heads down on new stuff right now / fixing bugs |
Duplicate of #19080 |
Microsoft PowerToys version
0.37
Running as admin
Area(s) with issue?
ColorPicker, Settings
Steps to reproduce
Open the Settings > Color Picker,
Click the Up and Down arrows on the right side of the items in the list.
✔️ Expected Behavior
Smooth re-positioning.
❌ Actual Behavior
Items get new position, but there's a short effect on on of the Toggle Switches from a different item.
2021-05-03.22-48-23.mp4
It's because the whole list is re-built every single time.
The text was updated successfully, but these errors were encountered: