feat(ui): Help overlay with Info/Donate tabs, fixed dimensions
Help button now shows a fixed-size two-tab overlay: Info tab: app name + version, one-line description, thin separator, © 2026 Davide Grilli — MIT License, Built with .NET 10 · Avalonia 12 · NBitcoin. Donate tab: dev address (plm1qdq3…) read-only display, free amount input, prepare-preview row, confirm-and-broadcast button. Overlay dimensions are stable across tabs and between desktop/mobile: - TabControl Height=320 (fixed, never resizes on tab switch) - HorizontalAlignment=Stretch + MaxWidth=440 on the card (always fills available width; previously Center caused the card to shrink to content width, which differed between Info and Donate) - Each tab content wrapped in ScrollViewer for safe overflow handling New MainWindowViewModel.Donate.cs: PrepareDonate / ConfirmDonate / ResetDonate (called on overlay close). Six-language Loc keys added for all donate strings.
This commit is contained in:
@@ -1373,71 +1373,86 @@
|
||||
<Border Background="{DynamicResource OverlayCardBrush}"
|
||||
BorderBrush="{DynamicResource BorderSubtleBrush}" BorderThickness="1" CornerRadius="8"
|
||||
MaxWidth="440" Margin="16"
|
||||
HorizontalAlignment="Center" VerticalAlignment="Center">
|
||||
HorizontalAlignment="Stretch" VerticalAlignment="Center">
|
||||
<StackPanel Margin="24" Spacing="16">
|
||||
<TextBlock Text="{Binding Loc[help.title]}"
|
||||
FontSize="18" FontWeight="Bold"/>
|
||||
|
||||
<TabControl>
|
||||
<!-- Fixed height so the overlay never resizes when switching tabs. -->
|
||||
<TabControl Height="320">
|
||||
<!-- Tab: Info -->
|
||||
<TabItem Header="{Binding Loc[help.tab.info]}">
|
||||
<StackPanel Spacing="12" Margin="0,12,0,0">
|
||||
<StackPanel Spacing="4">
|
||||
<TextBlock Text="Palladium Wallet" FontSize="16" FontWeight="Bold"/>
|
||||
<TextBlock Text="{Binding WindowTitle}" FontSize="12"
|
||||
Foreground="{DynamicResource TextSecondaryBrush}"/>
|
||||
<ScrollViewer VerticalScrollBarVisibility="Auto">
|
||||
<StackPanel Spacing="12" Margin="0,12,0,0">
|
||||
<StackPanel Spacing="4">
|
||||
<TextBlock Text="Palladium Wallet" FontSize="16" FontWeight="Bold"/>
|
||||
<TextBlock Text="{Binding WindowTitle}" FontSize="12"
|
||||
Foreground="{DynamicResource TextSecondaryBrush}"/>
|
||||
</StackPanel>
|
||||
<TextBlock Text="{Binding Loc[help.info]}" TextWrapping="Wrap"/>
|
||||
<Border BorderBrush="{DynamicResource BorderSubtleBrush}"
|
||||
BorderThickness="0,1,0,0" Margin="0,4,0,0"/>
|
||||
<StackPanel Spacing="4">
|
||||
<TextBlock Text="© 2026 Davide Grilli — MIT License"
|
||||
FontSize="12"
|
||||
Foreground="{DynamicResource TextSecondaryBrush}"/>
|
||||
<TextBlock Text="Built with .NET 10 · Avalonia 12 · NBitcoin"
|
||||
FontSize="11"
|
||||
Foreground="{DynamicResource TextSecondaryBrush}"/>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
<TextBlock Text="{Binding Loc[help.info]}" TextWrapping="Wrap"/>
|
||||
</StackPanel>
|
||||
</ScrollViewer>
|
||||
</TabItem>
|
||||
|
||||
<!-- Tab: Donate -->
|
||||
<TabItem Header="{Binding Loc[help.tab.donate]}">
|
||||
<StackPanel Spacing="12" Margin="0,12,0,0">
|
||||
<TextBlock Text="{Binding Loc[donate.desc]}" TextWrapping="Wrap"
|
||||
Foreground="{DynamicResource TextSecondaryBrush}"/>
|
||||
|
||||
<!-- Dev address (read-only) -->
|
||||
<StackPanel Spacing="4">
|
||||
<TextBlock Text="{Binding Loc[donate.dev.address]}" FontSize="11"
|
||||
<ScrollViewer VerticalScrollBarVisibility="Auto">
|
||||
<StackPanel Spacing="12" Margin="0,12,0,0">
|
||||
<TextBlock Text="{Binding Loc[donate.desc]}" TextWrapping="Wrap"
|
||||
Foreground="{DynamicResource TextSecondaryBrush}"/>
|
||||
<SelectableTextBlock Text="{x:Static vm:MainWindowViewModel.DevAddress}"
|
||||
FontFamily="monospace" FontSize="11"
|
||||
TextWrapping="Wrap"/>
|
||||
</StackPanel>
|
||||
|
||||
<!-- Amount input -->
|
||||
<StackPanel Spacing="4">
|
||||
<TextBlock Text="{Binding Loc[donate.amount]}" FontSize="11"
|
||||
Foreground="{DynamicResource TextSecondaryBrush}"/>
|
||||
<Grid ColumnDefinitions="*,Auto">
|
||||
<TextBox Grid.Column="0"
|
||||
Text="{Binding DonateAmount}"
|
||||
PlaceholderText="{Binding UnitLabel}"/>
|
||||
<TextBlock Grid.Column="1" Text="{Binding UnitLabel}"
|
||||
VerticalAlignment="Center" Margin="8,0,0,0"
|
||||
<!-- Dev address (read-only) -->
|
||||
<StackPanel Spacing="4">
|
||||
<TextBlock Text="{Binding Loc[donate.dev.address]}" FontSize="11"
|
||||
Foreground="{DynamicResource TextSecondaryBrush}"/>
|
||||
</Grid>
|
||||
</StackPanel>
|
||||
<SelectableTextBlock Text="{x:Static vm:MainWindowViewModel.DevAddress}"
|
||||
FontFamily="monospace" FontSize="11"
|
||||
TextWrapping="Wrap"/>
|
||||
</StackPanel>
|
||||
|
||||
<!-- Preview -->
|
||||
<SelectableTextBlock Text="{Binding DonatePreview}"
|
||||
IsVisible="{Binding DonatePreview,
|
||||
Converter={x:Static StringConverters.IsNotNullOrEmpty}}"
|
||||
FontFamily="monospace" FontSize="11"
|
||||
TextWrapping="Wrap"
|
||||
Foreground="{DynamicResource TextSecondaryBrush}"/>
|
||||
<!-- Amount input -->
|
||||
<StackPanel Spacing="4">
|
||||
<TextBlock Text="{Binding Loc[donate.amount]}" FontSize="11"
|
||||
Foreground="{DynamicResource TextSecondaryBrush}"/>
|
||||
<Grid ColumnDefinitions="*,Auto">
|
||||
<TextBox Grid.Column="0"
|
||||
Text="{Binding DonateAmount}"
|
||||
PlaceholderText="{Binding UnitLabel}"/>
|
||||
<TextBlock Grid.Column="1" Text="{Binding UnitLabel}"
|
||||
VerticalAlignment="Center" Margin="8,0,0,0"
|
||||
Foreground="{DynamicResource TextSecondaryBrush}"/>
|
||||
</Grid>
|
||||
</StackPanel>
|
||||
|
||||
<!-- Buttons -->
|
||||
<StackPanel Orientation="Horizontal" Spacing="8" HorizontalAlignment="Right">
|
||||
<Button Content="{Binding Loc[donate.confirm]}"
|
||||
Classes="accent"
|
||||
IsEnabled="{Binding HasPendingDonate}"
|
||||
Command="{Binding ConfirmDonateCommand}"/>
|
||||
<Button Content="{Binding Loc[donate.prepare]}"
|
||||
Command="{Binding PrepareDonateCommand}"/>
|
||||
<!-- Preview -->
|
||||
<SelectableTextBlock Text="{Binding DonatePreview}"
|
||||
IsVisible="{Binding DonatePreview,
|
||||
Converter={x:Static StringConverters.IsNotNullOrEmpty}}"
|
||||
FontFamily="monospace" FontSize="11"
|
||||
TextWrapping="Wrap"
|
||||
Foreground="{DynamicResource TextSecondaryBrush}"/>
|
||||
|
||||
<!-- Buttons -->
|
||||
<StackPanel Orientation="Horizontal" Spacing="8" HorizontalAlignment="Right">
|
||||
<Button Content="{Binding Loc[donate.confirm]}"
|
||||
Classes="accent"
|
||||
IsEnabled="{Binding HasPendingDonate}"
|
||||
Command="{Binding ConfirmDonateCommand}"/>
|
||||
<Button Content="{Binding Loc[donate.prepare]}"
|
||||
Command="{Binding PrepareDonateCommand}"/>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</ScrollViewer>
|
||||
</TabItem>
|
||||
</TabControl>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user