Skip to content
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

GridSplitter ShowPreview doesn't work #10700

Closed
rabbitism opened this issue Mar 18, 2023 · 3 comments · Fixed by #13921
Closed

GridSplitter ShowPreview doesn't work #10700

rabbitism opened this issue Mar 18, 2023 · 3 comments · Fixed by #13921
Labels

Comments

@rabbitism
Copy link
Contributor

rabbitism commented Mar 18, 2023

Describe the bug
GridSplitter should show a preview line, but the preview line disappear after mouse leaving the original area.

To Reproduce
Steps to reproduce the behavior:

Add below xaml code in sandbox

  <Grid Width="200" Height="200" RowDefinitions="*, Auto, *">
    <Border Background="Transparent"></Border>
    <GridSplitter Grid.Row="1" ShowsPreview="True" Background="Red"/>
    <Border Background="Transparent" Grid.Row="2"></Border>
  </Grid>

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: Windows 11
  • Version: latest master (cbbc27f)

Additional context
I think the root cause is that preview content in AdornerLayer is not rendered outside GridSplitter clip.

@rabbitism rabbitism added the bug label Mar 18, 2023
@rabbitism
Copy link
Contributor Author

rabbitism commented Mar 18, 2023

Oh nvm, I figured it out as soon as I posted this issue. We have to set ClipToBounds explicitly, but I think it should not be clipped by default?


Some updates on my thought:
The actual adorner layer for displaying this preview content is parent grid. Thou setting ClipToBounds=False can solve this issue, theoretically an adorner of parent control should not be clipped by GridSplitter itself.

image

@rabbitism
Copy link
Contributor Author

More updates:
when checking the adorner layout demo, I found the lines are frozen on the region outside content area.

1679153739399

@robloo
Copy link
Contributor

robloo commented Mar 18, 2023

I just saw the adorner layer issue too and filed a new bug for it.

grokys added a commit that referenced this issue Dec 12, 2023
maxkatz6 pushed a commit that referenced this issue Jan 17, 2024
* Don't overwrite IsClipEnabled.

The user should be able to set this on an adorner themselves.

* Use correct clip bounds for adorners.

Only take the adorned visual's clip bounds into account if the adorner is clipped to these bounds.

* Disable clipping on GridSplitter adorner.

Fixes #10700

* Don't clip adorners in ControlCatalog.

Default setting is `true`, but this was being overridden in `AdornerLayer.AddVisualAdorner`. That was fixed by an earlier commit in this PR, so property needs to be set explicitly to false in ControlCatalog.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants