+ scroll
This commit is contained in:
parent
7e9e7613ba
commit
bba5fe093c
6 changed files with 74 additions and 75 deletions
34
src/PostIt/PostIt.Tests/MD/le-chant-1.md
Normal file
34
src/PostIt/PostIt.Tests/MD/le-chant-1.md
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
|
||||
Loin vers l'infini s'étendent
|
||||
Les grands prés marécageux .
|
||||
Pas un seul oiseau ne chante
|
||||
Sur les arbres secs et creux !
|
||||
|
||||
*(Refrain)*
|
||||
|
||||
Ô terre de détresse,
|
||||
Où nous devons sans cesse,
|
||||
Piocher, piocher .
|
||||
|
||||
Dans ce camp morne et sauvage
|
||||
Entouré de murs de fer,
|
||||
Il nous semble vivre en cage
|
||||
Au milieu d'un grand désert .
|
||||
|
||||
Bruit des pas et bruit des armes,
|
||||
Sentinelles jours et nuits,
|
||||
Et du sang, et des cris, des larmes,
|
||||
La mort pour celui qui fuit .
|
||||
|
||||
Mais un jour dans notre vie,
|
||||
Le printemps refleurira .
|
||||
Liberté, liberté chérie
|
||||
Je dirai : « Tu es à moi ! »
|
||||
|
||||
*(Dernier refrain)*
|
||||
|
||||
Ô terre d'allégresse,
|
||||
Où nous pourrons sans cesse,
|
||||
Aimer, aimer !
|
||||
|
||||
[audio : Mario Hacquard - Youtube](https://www.youtube.com/watch?v=ogw_mgk1pFs)
|
||||
|
|
@ -7,13 +7,20 @@
|
|||
x:Name="Root"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Stretch">
|
||||
<Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
|
||||
<Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch" MinHeight="260">
|
||||
<Border
|
||||
BorderBrush="LightGray"
|
||||
BorderThickness="1"
|
||||
CornerRadius="5"
|
||||
IsVisible="{Binding !IsPreviewVisible, ElementName=Root}"
|
||||
Padding="0">
|
||||
Padding="0"
|
||||
MinHeight="260">
|
||||
<ScrollViewer
|
||||
BringIntoViewOnFocusChange="False"
|
||||
HorizontalScrollBarVisibility="Disabled"
|
||||
VerticalScrollBarVisibility="Auto"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Stretch">
|
||||
<AvaloniaEdit:TextEditor
|
||||
x:Name="SourceEditor"
|
||||
Document="{Binding Document, ElementName=Root, Mode=TwoWay}"
|
||||
|
|
@ -25,8 +32,10 @@
|
|||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Stretch"
|
||||
HorizontalScrollBarVisibility="Disabled"
|
||||
VerticalScrollBarVisibility="Auto"
|
||||
TextInputOptions.Multiline="True"
|
||||
TextInputOptions.ReturnKeyType="Default" />
|
||||
</ScrollViewer>
|
||||
</Border>
|
||||
|
||||
<Border
|
||||
|
|
@ -34,7 +43,8 @@
|
|||
BorderThickness="1"
|
||||
CornerRadius="5"
|
||||
IsVisible="{Binding IsPreviewVisible, ElementName=Root}"
|
||||
Padding="8">
|
||||
Padding="8"
|
||||
MinHeight="260">
|
||||
<ScrollViewer
|
||||
BringIntoViewOnFocusChange="False"
|
||||
HorizontalScrollBarVisibility="Disabled"
|
||||
|
|
|
|||
|
|
@ -17,7 +17,14 @@
|
|||
<Design.DataContext>
|
||||
<vm:BlogsViewModel />
|
||||
</Design.DataContext>
|
||||
<StackPanel Margin="5,5,10,5" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
|
||||
<ScrollViewer
|
||||
Margin="5,5,10,5"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Stretch"
|
||||
HorizontalScrollBarVisibility="Disabled"
|
||||
VerticalScrollBarVisibility="Auto"
|
||||
BringIntoViewOnFocusChange="False">
|
||||
<StackPanel HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
|
||||
|
||||
<WrapPanel x:Name="BlogsHeaderPanel"
|
||||
Margin="5"
|
||||
|
|
@ -100,7 +107,7 @@
|
|||
</CommandBar.PrimaryCommands>
|
||||
</CommandBar>
|
||||
|
||||
<Grid Margin="12" RowSpacing="12" x:Name="MainGrid">
|
||||
<Grid Margin="12" RowSpacing="12" x:Name="MainGrid" MinHeight="500">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
|
|
@ -191,4 +198,5 @@
|
|||
</Grid>
|
||||
</Grid>
|
||||
</StackPanel>
|
||||
</ScrollViewer>
|
||||
</ContentPage>
|
||||
|
|
|
|||
|
|
@ -4,69 +4,16 @@ using Avalonia.Controls;
|
|||
using Avalonia.Platform.Storage;
|
||||
using Avalonia.Controls.Primitives;
|
||||
using Avalonia.Interactivity;
|
||||
using Avalonia.Controls.Platform;
|
||||
|
||||
namespace PostIt.Views.Blogs;
|
||||
|
||||
public partial class BlogsPage : ContentPage
|
||||
{
|
||||
private IInputPane? _inputPane;
|
||||
|
||||
public BlogsPage()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
protected override void OnLoaded(RoutedEventArgs e)
|
||||
{
|
||||
base.OnLoaded(e);
|
||||
|
||||
// Récupère l'accès au TopLevel de la fenêtre/application
|
||||
var topLevel = TopLevel.GetTopLevel(this);
|
||||
if (topLevel != null)
|
||||
{
|
||||
_inputPane = topLevel!.InputPane;
|
||||
if (_inputPane != null)
|
||||
{
|
||||
// S'abonne aux changements d'état du clavier virtuel
|
||||
_inputPane.StateChanged += OnInputPaneStateChanged;
|
||||
|
||||
// Applique la configuration initiale si le clavier est déjà présent
|
||||
UpdateLayoutForKeyboard(_inputPane.OccludedRect.Height);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected override void OnUnloaded(RoutedEventArgs e)
|
||||
{
|
||||
if (_inputPane != null)
|
||||
{
|
||||
_inputPane.StateChanged -= OnInputPaneStateChanged;
|
||||
}
|
||||
base.OnUnloaded(e);
|
||||
}
|
||||
|
||||
|
||||
private void UpdateLayoutForKeyboard(double keyboardHeight)
|
||||
{
|
||||
double visibleHeight = this.Bounds.Height - keyboardHeight;
|
||||
if (keyboardHeight > 0)
|
||||
{
|
||||
DraftArticleTextEditor.MaxHeight = visibleHeight;
|
||||
}
|
||||
else
|
||||
{
|
||||
DraftArticleTextEditor.MaxHeight = double.PositiveInfinity;
|
||||
}
|
||||
}
|
||||
|
||||
private void OnInputPaneStateChanged(object? sender, InputPaneStateEventArgs e)
|
||||
{
|
||||
// e.EndRect contient le rectangle final du clavier virtuel
|
||||
// e.EndRect.Height vous donne sa hauteur exacte en pixels indépendants du périphérique (pixels logiques)
|
||||
UpdateLayoutForKeyboard(e.EndRect.Height);
|
||||
}
|
||||
|
||||
protected override void OnApplyTemplate(TemplateAppliedEventArgs e)
|
||||
{
|
||||
base.OnApplyTemplate(e);
|
||||
|
|
|
|||
|
|
@ -1,4 +1 @@
|
|||
.user-icon {
|
||||
max-width: 1.5em;
|
||||
max-height: 1.5em;
|
||||
}
|
||||
.user-icon{max-width:1.5em;max-height:1.5em}.card{padding:.5em}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,7 @@
|
|||
user-icon {
|
||||
.user-icon {
|
||||
max-width: 1.5em;
|
||||
max-height: 1.5em;
|
||||
}
|
||||
.card {
|
||||
padding: .5em;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue