-
Notifications
You must be signed in to change notification settings - Fork 689
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
Fixes #3777 - HexView
Focus Issue - Adds View.AdvancingFocus
events
#3783
Conversation
The HexView is the only focusable view in the HexView scenario and it has two focusable subviews. Isn't possible to navigate between them with only tabbing, without forcing pressing Shift-Tab to go from the text view to the hexa view? |
If you paste this glyph 🦱https://www.compart.com/en/unicode/U+1F9B1 it will throw this exception. But is a surrogate pair and |
When have edited changes the text stays selected. That's ok but the cursor is invisible and it's more harder to know where is it. |
HexView
Focus Issue - Adds View.AdvanceingFocus
eventsHexView
Focus Issue - Adds View.AdvancingFocus
events
Sorry, but I don't understand. The HexEDITOR scenario has only ONE focusable view. |
This happen with TextField and TextView too. Please raise a separate issue for this. |
Sorry @tig, I made confusing because I though it was using a |
Whoooo. You already did that. Thanks. |
When we don't edit anything, navigating in the hex side will highlight the text side at the hex side position, so the highlighting is always visible. When we are navigating on edited values the text are already highlighted and doesn't highlight the current hex position on the text side, because the attribute is the same, no matter the values was or wasn't edited. I think that if the text was edited then the current position should have a different attribute, because if we are navigating in the text side on edited values, the hex side doesn't highlight the current text position. Thus, we don't know where the current position of the other side is, if the side that have the cursor is navigating, if the values were edited. |
Yeah, this is why this PR aslo adds The idea is, if someone wants to override the behavior of /// <inheritdoc />
protected override bool OnAdvancingFocus (NavigationDirection direction, TabBehavior? behavior)
{
if (behavior is { } && behavior != TabStop)
{
return false;
}
if ((direction == NavigationDirection.Forward && _leftSideHasFocus)
|| (direction == NavigationDirection.Backward && !_leftSideHasFocus))
{
_leftSideHasFocus = !_leftSideHasFocus;
RedisplayLine (Address);
_firstNibble = true;
return true;
}
return false;
} |
How's this? |
Wonderful. Thanks. |
This is ready to review again. |
Oops. I pushed my fix to #3757 to a different branch. Just fixed here too. |
Fixes
HexEditor
right side editing is broken #3777PositionCursor
gets confused becauseHasFocus
is settingApplication.GetFocused
incorrectly #3786Proposed Changes/Todos
View.AdvancingFocus
Pull Request checklist:
CTRL-K-D
to automatically reformat your files before committing.dotnet test
before commit///
style comments)