-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Apply Panel-Orientation of DRM-Output #14241
Comments
As a temporary workaround, you can listen for |
Thank you very much for the suggestion. protected override void OnAttachedToVisualTree(VisualTreeAttachmentEventArgs e)
{
base.OnAttachedToVisualTree(e);
var root = (EmbeddableControlRoot)e.Root;
root.RenderTransform = new RotateTransform(270);
} Unfortunately this only affects rendering and therefore the layout is wrong. For a layout-transform I would need to add a If I try to apply both (rotate using Perhaps I have misunderstood something? |
You can change the default template for EmbeddableControlRoot. |
Tried the new suggestion. <ResourceDictionary xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<ControlTheme x:Key="{x:Type EmbeddableControlRoot}" TargetType="EmbeddableControlRoot">
<Setter Property="Foreground" Value="{DynamicResource SystemControlForegroundBaseHighBrush}"/>
<Setter Property="Background" Value="{DynamicResource SystemRegionBrush}"/>
<Setter Property="TopLevel.SystemBarColor" Value="{DynamicResource SystemControlBackgroundAltHighBrush}"/>
<Setter Property="FontSize" Value="{DynamicResource ControlContentThemeFontSize}"/>
<Setter Property="FontFamily" Value="{DynamicResource ContentControlThemeFontFamily}" />
<Setter Property="Template">
<ControlTemplate>
<LayoutTransformControl>
<LayoutTransformControl.LayoutTransform>
<RotateTransform Angle="270" />
</LayoutTransformControl.LayoutTransform>
<Panel>
<Border Name="PART_TransparencyFallback" IsHitTestVisible="False" />
<Border Background="{TemplateBinding Background}">
<VisualLayerManager>
<ContentPresenter Name="PART_ContentPresenter"
ContentTemplate="{TemplateBinding ContentTemplate}"
Content="{TemplateBinding Content}"
Margin="{TemplateBinding Padding}"/>
</VisualLayerManager>
</Border>
</Panel>
</LayoutTransformControl>
</ControlTemplate>
</Setter>
</ControlTheme>
</ResourceDictionary> And changed App.axaml to include it: <Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceInclude Source='/EmbeddableControlRootTemplate.axaml'/>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Application.Resources> It seems to be the right track, but still not completly correct: |
Scroll-Gesture-Recognition is also not working properly (X/Y flipped) with the latest workaround-approach (LayoutTransformControl directly inside of EmbeddableControlRoot). I tried to find the right place inside the code of Avalonia to be fix the problem at the root. But there are many moving parts and the complexity is high. Can you point me in a direction so that I can try to fix it? |
I need also a solution for this issue. |
I met the same problem in Scroll-Gesture-Recognition. BTW, have you solved this problem or found any other new solution? |
I disabled scroll gestures for now. |
But if you do this, won't the scrollviewer be able to slide up and down? In other words, won't the scrollviewer be unusable? |
I have a custom scrollbar which is clickable. |
Is your feature request related to a problem? Please describe.
When using DRM-Output, currently Avalonia doesn't seem to respect the panel_orientation property of DRM/KMS which indicates how the panel is mounted inside the casing. Because of this the UI is rendered 270° rotated in my case.
(side-note: touch-input aligns with the rendered output)
Describe the solution you'd like
Describe alternatives you've considered
Additional context
The text was updated successfully, but these errors were encountered: