mirror of
https://github.com/claunia/marechai.git
synced 2026-07-08 17:57:08 +00:00
Fix missing scrollbars in admin description edit/preview panes
StackPanel gives its children infinite height during measurement, so the inner ScrollViewer/TextBox never received a finite height to scroll against and the boxes just grew unbounded instead of scrolling. Replace the StackPanel wrappers with Grid (Auto/*) rows across all admin description editors, and add a matching edit+preview pane to AdminSoftwarePage, which previously had no preview and no scrolling.
This commit is contained in:
@@ -569,11 +569,17 @@
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<StackPanel Grid.Row="0"
|
||||
Spacing="6">
|
||||
<TextBlock Text="{Binding Source={StaticResource Strings}, Path=MarkdownSourceLabel}"
|
||||
<Grid Grid.Row="0"
|
||||
RowSpacing="6">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
<TextBlock Grid.Row="0"
|
||||
Text="{Binding Source={StaticResource Strings}, Path=MarkdownSourceLabel}"
|
||||
FontWeight="SemiBold" />
|
||||
<Border MinHeight="180"
|
||||
<Border Grid.Row="1"
|
||||
MinHeight="180"
|
||||
Padding="1"
|
||||
Background="{ThemeResource LayerFillColorDefaultBrush}"
|
||||
BorderBrush="{ThemeResource DividerStrokeColorDefaultBrush}"
|
||||
@@ -588,13 +594,19 @@
|
||||
BorderThickness="0"
|
||||
ScrollViewer.VerticalScrollBarVisibility="Auto" />
|
||||
</Border>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
|
||||
<StackPanel Grid.Row="1"
|
||||
Spacing="6">
|
||||
<TextBlock Text="{Binding Source={StaticResource Strings}, Path=MarkdownPreviewLabel}"
|
||||
<Grid Grid.Row="1"
|
||||
RowSpacing="6">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
<TextBlock Grid.Row="0"
|
||||
Text="{Binding Source={StaticResource Strings}, Path=MarkdownPreviewLabel}"
|
||||
FontWeight="SemiBold" />
|
||||
<Border MinHeight="180"
|
||||
<Border Grid.Row="1"
|
||||
MinHeight="180"
|
||||
Padding="12"
|
||||
Background="{ThemeResource LayerFillColorDefaultBrush}"
|
||||
BorderBrush="{ThemeResource DividerStrokeColorDefaultBrush}"
|
||||
@@ -604,7 +616,7 @@
|
||||
<local:MessageMarkdownView Markdown="{Binding DescriptionMarkdown}" />
|
||||
</ScrollViewer>
|
||||
</Border>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Grid>
|
||||
|
||||
<!-- Description footer -->
|
||||
|
||||
@@ -495,11 +495,17 @@
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<StackPanel Grid.Row="0"
|
||||
Spacing="6">
|
||||
<TextBlock Text="{Binding Source={StaticResource Strings}, Path=MarkdownSourceLabel}"
|
||||
<Grid Grid.Row="0"
|
||||
RowSpacing="6">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
<TextBlock Grid.Row="0"
|
||||
Text="{Binding Source={StaticResource Strings}, Path=MarkdownSourceLabel}"
|
||||
FontWeight="SemiBold" />
|
||||
<Border MinHeight="180"
|
||||
<Border Grid.Row="1"
|
||||
MinHeight="180"
|
||||
Padding="1"
|
||||
Background="{ThemeResource LayerFillColorDefaultBrush}"
|
||||
BorderBrush="{ThemeResource DividerStrokeColorDefaultBrush}"
|
||||
@@ -514,13 +520,19 @@
|
||||
BorderThickness="0"
|
||||
ScrollViewer.VerticalScrollBarVisibility="Auto" />
|
||||
</Border>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
|
||||
<StackPanel Grid.Row="1"
|
||||
Spacing="6">
|
||||
<TextBlock Text="{Binding Source={StaticResource Strings}, Path=MarkdownPreviewLabel}"
|
||||
<Grid Grid.Row="1"
|
||||
RowSpacing="6">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
<TextBlock Grid.Row="0"
|
||||
Text="{Binding Source={StaticResource Strings}, Path=MarkdownPreviewLabel}"
|
||||
FontWeight="SemiBold" />
|
||||
<Border MinHeight="180"
|
||||
<Border Grid.Row="1"
|
||||
MinHeight="180"
|
||||
Padding="12"
|
||||
Background="{ThemeResource LayerFillColorDefaultBrush}"
|
||||
BorderBrush="{ThemeResource DividerStrokeColorDefaultBrush}"
|
||||
@@ -530,7 +542,7 @@
|
||||
<local:MessageMarkdownView Markdown="{Binding DescriptionMarkdown}" />
|
||||
</ScrollViewer>
|
||||
</Border>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Grid>
|
||||
|
||||
<Grid Grid.Row="4"
|
||||
|
||||
@@ -281,11 +281,17 @@
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<StackPanel Grid.Row="0"
|
||||
Spacing="6">
|
||||
<TextBlock Text="{Binding Source={StaticResource Strings}, Path=MarkdownSourceLabel}"
|
||||
<Grid Grid.Row="0"
|
||||
RowSpacing="6">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
<TextBlock Grid.Row="0"
|
||||
Text="{Binding Source={StaticResource Strings}, Path=MarkdownSourceLabel}"
|
||||
FontWeight="SemiBold" />
|
||||
<Border MinHeight="180"
|
||||
<Border Grid.Row="1"
|
||||
MinHeight="180"
|
||||
Padding="1"
|
||||
Background="{ThemeResource LayerFillColorDefaultBrush}"
|
||||
BorderBrush="{ThemeResource DividerStrokeColorDefaultBrush}"
|
||||
@@ -300,13 +306,19 @@
|
||||
BorderThickness="0"
|
||||
ScrollViewer.VerticalScrollBarVisibility="Auto" />
|
||||
</Border>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
|
||||
<StackPanel Grid.Row="1"
|
||||
Spacing="6">
|
||||
<TextBlock Text="{Binding Source={StaticResource Strings}, Path=MarkdownPreviewLabel}"
|
||||
<Grid Grid.Row="1"
|
||||
RowSpacing="6">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
<TextBlock Grid.Row="0"
|
||||
Text="{Binding Source={StaticResource Strings}, Path=MarkdownPreviewLabel}"
|
||||
FontWeight="SemiBold" />
|
||||
<Border MinHeight="180"
|
||||
<Border Grid.Row="1"
|
||||
MinHeight="180"
|
||||
Padding="12"
|
||||
Background="{ThemeResource LayerFillColorDefaultBrush}"
|
||||
BorderBrush="{ThemeResource DividerStrokeColorDefaultBrush}"
|
||||
@@ -316,7 +328,7 @@
|
||||
<local:MessageMarkdownView Markdown="{Binding DescriptionMarkdown}" />
|
||||
</ScrollViewer>
|
||||
</Border>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Grid>
|
||||
|
||||
<Grid Grid.Row="4"
|
||||
|
||||
@@ -409,11 +409,17 @@
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<StackPanel Grid.Row="0"
|
||||
Spacing="6">
|
||||
<TextBlock Text="{Binding Source={StaticResource Strings}, Path=MarkdownSourceLabel}"
|
||||
<Grid Grid.Row="0"
|
||||
RowSpacing="6">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
<TextBlock Grid.Row="0"
|
||||
Text="{Binding Source={StaticResource Strings}, Path=MarkdownSourceLabel}"
|
||||
FontWeight="SemiBold" />
|
||||
<Border MinHeight="180"
|
||||
<Border Grid.Row="1"
|
||||
MinHeight="180"
|
||||
Padding="1"
|
||||
Background="{ThemeResource LayerFillColorDefaultBrush}"
|
||||
BorderBrush="{ThemeResource DividerStrokeColorDefaultBrush}"
|
||||
@@ -428,13 +434,19 @@
|
||||
BorderThickness="0"
|
||||
ScrollViewer.VerticalScrollBarVisibility="Auto" />
|
||||
</Border>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
|
||||
<StackPanel Grid.Row="1"
|
||||
Spacing="6">
|
||||
<TextBlock Text="{Binding Source={StaticResource Strings}, Path=MarkdownPreviewLabel}"
|
||||
<Grid Grid.Row="1"
|
||||
RowSpacing="6">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
<TextBlock Grid.Row="0"
|
||||
Text="{Binding Source={StaticResource Strings}, Path=MarkdownPreviewLabel}"
|
||||
FontWeight="SemiBold" />
|
||||
<Border MinHeight="180"
|
||||
<Border Grid.Row="1"
|
||||
MinHeight="180"
|
||||
Padding="12"
|
||||
Background="{ThemeResource LayerFillColorDefaultBrush}"
|
||||
BorderBrush="{ThemeResource DividerStrokeColorDefaultBrush}"
|
||||
@@ -444,7 +456,7 @@
|
||||
<local:MessageMarkdownView Markdown="{Binding DescriptionMarkdown}" />
|
||||
</ScrollViewer>
|
||||
</Border>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Grid>
|
||||
|
||||
<!-- Description footer -->
|
||||
|
||||
@@ -617,11 +617,17 @@
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<StackPanel Grid.Row="0"
|
||||
Spacing="6">
|
||||
<TextBlock Text="{Binding Source={StaticResource Strings}, Path=MarkdownSourceLabel}"
|
||||
<Grid Grid.Row="0"
|
||||
RowSpacing="6">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
<TextBlock Grid.Row="0"
|
||||
Text="{Binding Source={StaticResource Strings}, Path=MarkdownSourceLabel}"
|
||||
FontWeight="SemiBold" />
|
||||
<Border MinHeight="180"
|
||||
<Border Grid.Row="1"
|
||||
MinHeight="180"
|
||||
Padding="1"
|
||||
Background="{ThemeResource LayerFillColorDefaultBrush}"
|
||||
BorderBrush="{ThemeResource DividerStrokeColorDefaultBrush}"
|
||||
@@ -636,13 +642,19 @@
|
||||
BorderThickness="0"
|
||||
ScrollViewer.VerticalScrollBarVisibility="Auto" />
|
||||
</Border>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
|
||||
<StackPanel Grid.Row="1"
|
||||
Spacing="6">
|
||||
<TextBlock Text="{Binding Source={StaticResource Strings}, Path=MarkdownPreviewLabel}"
|
||||
<Grid Grid.Row="1"
|
||||
RowSpacing="6">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
<TextBlock Grid.Row="0"
|
||||
Text="{Binding Source={StaticResource Strings}, Path=MarkdownPreviewLabel}"
|
||||
FontWeight="SemiBold" />
|
||||
<Border MinHeight="180"
|
||||
<Border Grid.Row="1"
|
||||
MinHeight="180"
|
||||
Padding="12"
|
||||
Background="{ThemeResource LayerFillColorDefaultBrush}"
|
||||
BorderBrush="{ThemeResource DividerStrokeColorDefaultBrush}"
|
||||
@@ -652,7 +664,7 @@
|
||||
<local:MessageMarkdownView Markdown="{Binding DescriptionMarkdown}" />
|
||||
</ScrollViewer>
|
||||
</Border>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Grid>
|
||||
|
||||
<Grid Grid.Row="4"
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:controls="using:CommunityToolkit.WinUI.UI.Controls"
|
||||
xmlns:local="using:Marechai.App.Presentation.Views"
|
||||
x:Name="PageRoot" NavigationCacheMode="Required"
|
||||
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
|
||||
|
||||
@@ -374,11 +375,63 @@
|
||||
</ItemsRepeater.ItemTemplate>
|
||||
</ItemsRepeater>
|
||||
|
||||
<TextBox Grid.Row="3" Margin="16" AcceptsReturn="True" TextWrapping="Wrap"
|
||||
Text="{Binding DescriptionMarkdown, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
|
||||
PlaceholderText="Markdown"
|
||||
MinHeight="200"
|
||||
VerticalAlignment="Stretch" />
|
||||
<Grid Grid.Row="3"
|
||||
Margin="16"
|
||||
RowSpacing="12">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="*" />
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Grid Grid.Row="0"
|
||||
RowSpacing="6">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
<TextBlock Grid.Row="0"
|
||||
Text="{Binding Source={StaticResource Strings}, Path=MarkdownSourceLabel}"
|
||||
FontWeight="SemiBold" />
|
||||
<Border Grid.Row="1"
|
||||
MinHeight="180"
|
||||
Padding="1"
|
||||
Background="{ThemeResource LayerFillColorDefaultBrush}"
|
||||
BorderBrush="{ThemeResource DividerStrokeColorDefaultBrush}"
|
||||
BorderThickness="1"
|
||||
CornerRadius="8">
|
||||
<TextBox Text="{Binding DescriptionMarkdown, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
|
||||
AcceptsReturn="True"
|
||||
TextWrapping="Wrap"
|
||||
PlaceholderText="{Binding Source={StaticResource Strings}, Path=DescriptionMarkdownPlaceholder}"
|
||||
VerticalAlignment="Stretch"
|
||||
HorizontalAlignment="Stretch"
|
||||
BorderThickness="0"
|
||||
ScrollViewer.VerticalScrollBarVisibility="Auto" />
|
||||
</Border>
|
||||
</Grid>
|
||||
|
||||
<Grid Grid.Row="1"
|
||||
RowSpacing="6">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
<TextBlock Grid.Row="0"
|
||||
Text="{Binding Source={StaticResource Strings}, Path=MarkdownPreviewLabel}"
|
||||
FontWeight="SemiBold" />
|
||||
<Border Grid.Row="1"
|
||||
MinHeight="180"
|
||||
Padding="12"
|
||||
Background="{ThemeResource LayerFillColorDefaultBrush}"
|
||||
BorderBrush="{ThemeResource DividerStrokeColorDefaultBrush}"
|
||||
BorderThickness="1"
|
||||
CornerRadius="8">
|
||||
<ScrollViewer VerticalScrollBarVisibility="Auto">
|
||||
<local:MessageMarkdownView Markdown="{Binding DescriptionMarkdown}" />
|
||||
</ScrollViewer>
|
||||
</Border>
|
||||
</Grid>
|
||||
</Grid>
|
||||
|
||||
<Grid Grid.Row="4" Padding="16,12" BorderBrush="{ThemeResource DividerStrokeColorDefaultBrush}" BorderThickness="0,1,0,0" ColumnSpacing="8">
|
||||
<Grid.ColumnDefinitions>
|
||||
|
||||
@@ -236,11 +236,17 @@
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<StackPanel Grid.Row="0"
|
||||
Spacing="6">
|
||||
<TextBlock Text="{Binding Source={StaticResource Strings}, Path=MarkdownSourceLabel}"
|
||||
<Grid Grid.Row="0"
|
||||
RowSpacing="6">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
<TextBlock Grid.Row="0"
|
||||
Text="{Binding Source={StaticResource Strings}, Path=MarkdownSourceLabel}"
|
||||
FontWeight="SemiBold" />
|
||||
<Border MinHeight="180"
|
||||
<Border Grid.Row="1"
|
||||
MinHeight="180"
|
||||
Padding="1"
|
||||
Background="{ThemeResource LayerFillColorDefaultBrush}"
|
||||
BorderBrush="{ThemeResource DividerStrokeColorDefaultBrush}"
|
||||
@@ -255,13 +261,19 @@
|
||||
BorderThickness="0"
|
||||
ScrollViewer.VerticalScrollBarVisibility="Auto" />
|
||||
</Border>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
|
||||
<StackPanel Grid.Row="1"
|
||||
Spacing="6">
|
||||
<TextBlock Text="{Binding Source={StaticResource Strings}, Path=MarkdownPreviewLabel}"
|
||||
<Grid Grid.Row="1"
|
||||
RowSpacing="6">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
<TextBlock Grid.Row="0"
|
||||
Text="{Binding Source={StaticResource Strings}, Path=MarkdownPreviewLabel}"
|
||||
FontWeight="SemiBold" />
|
||||
<Border MinHeight="180"
|
||||
<Border Grid.Row="1"
|
||||
MinHeight="180"
|
||||
Padding="12"
|
||||
Background="{ThemeResource LayerFillColorDefaultBrush}"
|
||||
BorderBrush="{ThemeResource DividerStrokeColorDefaultBrush}"
|
||||
@@ -271,7 +283,7 @@
|
||||
<local:MessageMarkdownView Markdown="{Binding DescriptionMarkdown}" />
|
||||
</ScrollViewer>
|
||||
</Border>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Grid>
|
||||
|
||||
<Grid Grid.Row="4"
|
||||
|
||||
Reference in New Issue
Block a user