Fixed #55 - AvaloniaEdit control accessibility
This commit is contained in:
parent
c1f447636b
commit
46fa53c513
2 changed files with 32 additions and 32 deletions
|
|
@ -17,18 +17,14 @@
|
|||
<Design.DataContext>
|
||||
<vm:BlogsViewModel />
|
||||
</Design.DataContext>
|
||||
<ScrollViewer
|
||||
Margin="5"
|
||||
Padding="5"
|
||||
HorizontalScrollBarVisibility="Disabled"
|
||||
VerticalScrollBarVisibility="Visible">
|
||||
<ScrollViewer HorizontalScrollBarVisibility="Disabled"
|
||||
Margin="5,5,10,5" HorizontalAlignment="Stretch" BringIntoViewOnFocusChange="False"
|
||||
VerticalAlignment="Stretch">
|
||||
<StackPanel>
|
||||
|
||||
|
||||
<StackPanel HorizontalAlignment="Stretch">
|
||||
<StackPanel
|
||||
<WrapPanel x:Name="BlogsHeaderPanel"
|
||||
Margin="5"
|
||||
Orientation="Horizontal"
|
||||
Spacing="10">
|
||||
Orientation="Horizontal">
|
||||
<TextBlock
|
||||
FontSize="20"
|
||||
FontWeight="SemiBold"
|
||||
|
|
@ -37,8 +33,9 @@
|
|||
HorizontalAlignment="Right"
|
||||
PlaceholderText="Filter by title or author..."
|
||||
Text="{Binding SearchText, Mode=TwoWay}" />
|
||||
</StackPanel>
|
||||
<CommandBar HorizontalAlignment="Right" IsDynamicOverflowEnabled="True">
|
||||
</WrapPanel>
|
||||
<CommandBar x:Name="BlogsCommandBar"
|
||||
HorizontalAlignment="Right" IsDynamicOverflowEnabled="True">
|
||||
<CommandBar.PrimaryCommands>
|
||||
<CommandBarButton Command="{Binding RefreshAsync}" Label="Refresh">
|
||||
<CommandBarButton.Icon>
|
||||
|
|
@ -106,18 +103,22 @@
|
|||
</CommandBar.PrimaryCommands>
|
||||
</CommandBar>
|
||||
|
||||
<Grid Margin="12" RowSpacing="12">
|
||||
<Grid Margin="12" RowSpacing="12" x:Name="MainGrid">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="*" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
<Border
|
||||
Grid.Row="1"
|
||||
Padding="8"
|
||||
BorderBrush="Gray"
|
||||
BorderThickness="1">
|
||||
<ListBox ItemsSource="{Binding FilteredPosts}" SelectedItem="{Binding SelectedPost, Mode=TwoWay}">
|
||||
<ListBox
|
||||
x:Name="PostsListBox"
|
||||
ItemsSource="{Binding FilteredPosts}" SelectedItem="{Binding SelectedPost, Mode=TwoWay}">
|
||||
<ListBox.ItemTemplate>
|
||||
<DataTemplate x:DataType="models:BlogPostDto">
|
||||
<StackPanel Spacing="4">
|
||||
|
|
@ -139,6 +140,8 @@
|
|||
<Border
|
||||
Grid.Row="2"
|
||||
Padding="8"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Stretch"
|
||||
BorderBrush="Gray"
|
||||
BorderThickness="1"
|
||||
IsVisible="{Binding IsMarkdownViewerVisible}">
|
||||
|
|
@ -150,6 +153,8 @@
|
|||
Padding="8"
|
||||
BorderBrush="Gray"
|
||||
BorderThickness="1"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Stretch"
|
||||
IsVisible="{Binding !IsMarkdownViewerVisible}">
|
||||
<Grid
|
||||
HorizontalAlignment="Stretch"
|
||||
|
|
@ -177,6 +182,7 @@
|
|||
|
||||
|
||||
<AvaloniaEdit:TextEditor
|
||||
x:Name="DraftArticleTextEditor"
|
||||
Grid.Row="2"
|
||||
VerticalAlignment="Stretch"
|
||||
Document="{Binding DraftArticleDocument, Mode=TwoWay}"
|
||||
|
|
@ -190,14 +196,15 @@
|
|||
HorizontalScrollBarVisibility="Disabled"
|
||||
TextInputOptions.Multiline="True"
|
||||
TextInputOptions.ReturnKeyType="Default"
|
||||
ClipToBounds="True"
|
||||
/>
|
||||
|
||||
<Border
|
||||
<Border x:Name="AttachmentsBorder"
|
||||
Grid.Row="3"
|
||||
Padding="8"
|
||||
BorderBrush="LightGray"
|
||||
BorderThickness="1">
|
||||
BorderThickness="1"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Stretch">
|
||||
<StackPanel Spacing="4">
|
||||
<TextBlock FontWeight="SemiBold" Text="Pièces jointes" />
|
||||
<ItemsControl ItemsSource="{Binding DraftAttachments}">
|
||||
|
|
@ -210,7 +217,7 @@
|
|||
</StackPanel>
|
||||
</Border>
|
||||
|
||||
<postitControls:StatusBar Grid.Row="4" DataContext="{Binding ActionStatus}" />
|
||||
<postitControls:StatusBar Grid.Row="4" DataContext="{Binding ActionStatus}" x:Name="StatusBar" />
|
||||
|
||||
</Grid>
|
||||
</Border>
|
||||
|
|
|
|||
|
|
@ -5,6 +5,9 @@ using Avalonia.Platform.Storage;
|
|||
using Avalonia.Controls.Primitives;
|
||||
using Avalonia.Interactivity;
|
||||
using Avalonia.Controls.Platform;
|
||||
using Avalonia.Input;
|
||||
using System;
|
||||
using Avalonia;
|
||||
|
||||
namespace PostIt.Views.Blogs;
|
||||
|
||||
|
|
@ -17,7 +20,7 @@ public partial class BlogsPage : ContentPage
|
|||
InitializeComponent();
|
||||
}
|
||||
|
||||
protected override void OnLoaded(RoutedEventArgs e)
|
||||
protected override void OnLoaded(RoutedEventArgs e)
|
||||
{
|
||||
base.OnLoaded(e);
|
||||
|
||||
|
|
@ -49,25 +52,15 @@ public partial class BlogsPage : ContentPage
|
|||
|
||||
private void UpdateLayoutForKeyboard(double keyboardHeight)
|
||||
{
|
||||
var app = App.Current as App;
|
||||
|
||||
app.View.Margin = new Avalonia.Thickness(0, 0, 0, keyboardHeight);
|
||||
// OPTION B : Si vous devez explicitement appliquer un masque de découpage (Clip) basé sur la hauteur :
|
||||
/*
|
||||
double visibleHeight = this.Bounds.Height - keyboardHeight;
|
||||
if (keyboardHeight > 0)
|
||||
{
|
||||
double visibleHeight = this.Bounds.Height - keyboardHeight;
|
||||
if (visibleHeight > 0)
|
||||
{
|
||||
MainContainer.Clip = new Avalonia.Media.RectangleGeometry(
|
||||
new Avalonia.Rect(0, 0, this.Bounds.Width, visibleHeight));
|
||||
}
|
||||
DraftArticleTextEditor.MaxHeight = visibleHeight;
|
||||
}
|
||||
else
|
||||
{
|
||||
MainContainer.Clip = null; // Réinitialise le clip quand le clavier se ferme
|
||||
DraftArticleTextEditor.MaxHeight = double.PositiveInfinity;
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
private void OnInputPaneStateChanged(object? sender, InputPaneStateEventArgs e)
|
||||
|
|
|
|||
Loading…
Reference in a new issue