Files
quiver-launcher/Views/AndroidLauncherUpdateView.axaml
T

46 lines
3.2 KiB
XML

<UserControl xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:services="clr-namespace:QuiverLauncher.Services"
x:Class="QuiverLauncher.Views.AndroidLauncherUpdateView"
x:Name="UpdateRoot" x:DataType="services:AndroidLauncherUpdater" x:CompileBindings="True">
<UserControl.Styles>
<Style Selector="Button">
<Setter Property="VerticalContentAlignment" Value="Center"/>
<Setter Property="HorizontalContentAlignment" Value="Center"/>
<Setter Property="HorizontalAlignment" Value="Stretch"/>
<Setter Property="MinHeight" Value="44"/>
<Setter Property="Padding" Value="12,8"/>
<Setter Property="FontSize" Value="12"/>
</Style>
</UserControl.Styles>
<Border Padding="12,8" Background="{DynamicResource ThemeBase}" BorderBrush="{DynamicResource ThemeBorder}" BorderThickness="0,0,0,1">
<StackPanel Spacing="6">
<StackPanel Spacing="4" IsVisible="{Binding !IsBanner, ElementName=UpdateRoot}">
<TextBlock Text="Quiver updates" FontWeight="SemiBold" Foreground="{DynamicResource ThemeText}"/>
<TextBlock Text="{Binding InstalledText}" TextWrapping="Wrap" Foreground="{DynamicResource ThemeTextSecondary}"/>
<TextBlock Text="{Binding LastCheckedText}" TextWrapping="Wrap" FontSize="12" Foreground="{DynamicResource ThemeTextSecondary}"/>
</StackPanel>
<TextBlock Text="{Binding AvailableText}" TextWrapping="Wrap" Foreground="{DynamicResource ThemeText}"/>
<TextBlock Text="{Binding StatusText}" IsVisible="{Binding HasStatus}" TextWrapping="Wrap" Foreground="{DynamicResource ThemeTextSecondary}"/>
<ProgressBar IsVisible="{Binding IsDownloading}" Value="{Binding Progress}" Minimum="0" Maximum="100" Height="4"/>
<TextBlock Text="{Binding Error}" IsVisible="{Binding HasError}" TextWrapping="Wrap" Foreground="{DynamicResource ThemeTextSecondary}"/>
<StackPanel Spacing="8" Margin="0,2,0,0">
<Grid ColumnDefinitions="*,Auto" IsVisible="{Binding HasUpdate}">
<Button x:Name="UpdateButton" Classes="options catalog-review-pending" Content="{Binding ActionText}" IsEnabled="{Binding CanUpdate}" Click="Update_Click"/>
<Button Grid.Column="1" Classes="options" Content="Dismiss" IsVisible="{Binding IsBanner, ElementName=UpdateRoot}" Click="Dismiss_Click" Margin="8,0,0,0"/>
</Grid>
<Button Classes="options" Content="Cancel download" IsVisible="{Binding IsDownloading}" Click="Cancel_Click"/>
<Button Classes="options" Content="Retry" IsVisible="{Binding HasError}" IsEnabled="{Binding CanCheck}" Click="Retry_Click"/>
<UniformGrid Rows="1" Margin="-4,0" IsVisible="{Binding !IsBanner, ElementName=UpdateRoot}">
<Button Classes="options" IsEnabled="{Binding CanCheck}" Click="Check_Click" Margin="4,0">
<TextBlock Text="Check for updates" TextWrapping="Wrap" TextAlignment="Center"/>
</Button>
<Button Classes="options" IsVisible="{Binding HasNotes}" Click="Notes_Click" Margin="4,0">
<TextBlock Text="Release notes" TextWrapping="Wrap" TextAlignment="Center"/>
</Button>
</UniformGrid>
</StackPanel>
</StackPanel>
</Border>
</UserControl>