这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@dgosbell
Copy link
Contributor

The current logic in the Ctrl-Tab processing in the Navigator window expects there to be a mixture of both LayoutAnchorables and LayoutDocuments. But if you only have a list of one or the other type the Ctrl-Tab selection does not loop to the top of the list, it stays stuck on the last item as it is expecting to jump across to the other list (you can see this behaviour in MLibTest app which only has LayoutAnchorables, once you ctrl-tab to the bottom of the list the blue highlight stays stuck there and that last Anchorable will get focus once you release the ctrl-tab. (note you need to keep the ctrl key held down and tap on the tab key to cycle the selected item)

This pull request adds a check in each set of conditions so that the selected item will loop to the top of the current list (either Anchorables or Documents) if the other list has 0 items.

I had a go at trying to build a Unit Test for this, but I could not see how to make this work. I believe I need to be on the UI thread to interact with the UI elements, but the NavigatorWindow calls ShowDialog which seems to block the test... But in my manual testing this works fine.

@dgosbell
Copy link
Contributor Author

Below is a screenshot of the current behaviour, if you look closely you can see a grey focus rectangle cycling around the this, but the blue selected item stays stuck on "Tool 3" and this is the anchorable that will get focus when the ctrl key is released
AvalonDock ctrl-tab issue

Below is the behaviour after applying this pull request
AvalonDock ctrl-tab fix

@Dirkster99 Dirkster99 merged commit 4152aea into Dirkster99:master Aug 19, 2019
@Dirkster99
Copy link
Owner

I can verify the problem - thanks for the fix.

A unit test is not strictly required or always needed because you cannot (or have a lot of effort to invest) to simulate all possible actions like drag & drop on different resolution (1K, 4K) screens. But a verifyable test description has the charm that anyone understands the problem to be fixed and it can be verified later on again (when we might look at this again and are scratching our heads wondering what this was about again) ... so, thank you very much for the detailled description and good fix :-)

@Dirkster99 Dirkster99 mentioned this pull request Oct 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants