Skip to content

Floating bar: the structures of the selection as the mini toolbar of Word [no-new-version] - #62

Merged
simonebortolin merged 1 commit into
mainfrom
ccr-b9b58be6-g7nugv-quickbar
Nov 14, 2026
Merged

simonebortolin merged 1 commit into
mainfrom
ccr-b9b58be6-g7nugv-quickbar

Conversation

@simonebortolin

Copy link
Copy Markdown
Owner

Stacked on #61.

When the selection was at the bottom of the editor, the floating bar opened under the equation and covered whatever lay under the editor. In the Avalonia demo it covered the Copy, Paste and Number buttons, so Build down with a selection could not be tested cleanly.

Change

The fix is in MathEditorView (Rendering), so it holds for Avalonia, WPF, Windows Forms and Uno alike. The structures of the selection now behave like Word's mini toolbar:

  • Opens only for a pointer selection: the bar appears when the button is released after selecting with the pointer. A selection made with Shift+arrows, Ctrl+A or Select all opens no bar.

  • Closes when the pointer goes away:

    • the pointer moves away from the selection (PointerMoved);
    • the pointer leaves the control anywhere other than towards the bar (PointerExited, new);
    • the pointer leaves the bar (QuickBarPointerExited, new).

    Once closed, the bar stays closed until the next pointer selection.

  • Unchanged: the completions (\alp → \alpha, used from the keyboard) and the table commands.

  • Windows Forms: the bar opens above the equation when there is no room under it on the screen. The popups of WPF and Avalonia already flip by themselves.

The controls wire the new calls through events (PointerExited/MouseLeave of the editor and of the bar), so their public API does not change. The Rendering API gains PointerExited(double, double) and QuickBarPointerExited().

Tests

  • New view tests:
    • a pointer selection opens the bar;
    • Ctrl+A or Shift+arrow does not;
    • the bar closes when the pointer goes far, leaves the control away from the bar, or leaves the bar;
    • it stays open when the pointer moves towards the bar.
  • The StructuresForTheSelection tests of WPF, Windows Forms and Uno now select with the pointer: press at the start, drag to the end, release.
  • On Linux: Avalonia 207/207 and Uno under Xvfb 14/14 pass. The CI runs the WPF and Windows Forms tests on Windows.

Generated by Claude Code

@github-actions

github-actions Bot commented Nov 14, 2026 •

Copy link
Copy Markdown

Pre-release 1.0.7-pr.62.248 is ready: https://github.com/simonebortolin/SharpEquations/releases/tag/pr-62-248-1

NuGet package of 8dd3186. Updated on every push, deleted when this PR is closed.

@simonebortolin
simonebortolin added this pull request to stack #63 November 14, 2026 22:30
Base automatically changed from ccr-b9b58be6-g7nugv to main November 14, 2026 22:35
…Word [no-new-version]

The bar of the structures opened for every selection and stayed under the
equation, over what is under the editor (the buttons of the demo). In
MathEditorView, for every toolkit: it opens only for a selection made with the
pointer, when the button is released (not for Shift+arrows nor Ctrl+A), and closes
when the pointer goes away from the selection, leaves the control elsewhere than
towards the bar, or leaves the bar (PointerExited, QuickBarPointerExited). The
completions and the commands of tables are as they were. On Windows Forms the bar
opens over the equation where there is no room under it on the screen, as the
popups of WPF and Avalonia do.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01SyVioB8cEKzWWZ7KQGzLfe
@simonebortolin
simonebortolin force-pushed the ccr-b9b58be6-g7nugv-quickbar branch from 21cca8c to 8dd3186 Compare November 14, 2026 22:35
@simonebortolin
simonebortolin merged commit 28bff34 into main Nov 14, 2026
5 checks passed
@simonebortolin
simonebortolin deleted the ccr-b9b58be6-g7nugv-quickbar branch November 14, 2026 22:38
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