finish patch client styling, remove test method

This commit is contained in:
IsWaffle 2021-12-21 10:21:55 -05:00
parent 3cb2b9cfae
commit c76e8329fc
9 changed files with 91 additions and 86 deletions

View File

@ -22,7 +22,7 @@
<SolidColorBrush x:Key="AKI_Foreground_Light" Color="{StaticResource AKI_White}"/> <SolidColorBrush x:Key="AKI_Foreground_Light" Color="{StaticResource AKI_White}"/>
<SolidColorBrush x:Key="AKI_Background_Light" Color="{StaticResource AKI_Gray}"/> <SolidColorBrush x:Key="AKI_Background_Light" Color="{StaticResource AKI_Gray}"/>
<SolidColorBrush x:Key="AKI_Background_Dark" Color="{StaticResource AKI_DarkGray}"/> <SolidColorBrush x:Key="AKI_Background_Dark" Color="{StaticResource AKI_DarkGray}"/>
<SolidColorBrush x:Key="AKI_Background_Yellow" Color="{StaticResource AKI_Yellow}"/> <SolidColorBrush x:Key="AKI_Brush_Yellow" Color="{StaticResource AKI_Yellow}"/>
<SolidColorBrush x:Key="AKI_Background_DarkGrayBlue" Color="{StaticResource AKI_DarkGrayBlue}"/> <SolidColorBrush x:Key="AKI_Brush_DarkGrayBlue" Color="{StaticResource AKI_DarkGrayBlue}"/>
</Application.Resources> </Application.Resources>
</Application> </Application>

View File

@ -2,8 +2,17 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:cc="using:PatchClient.CustomControls"> xmlns:cc="using:PatchClient.CustomControls">
<Design.PreviewWith> <Design.PreviewWith>
<Border Padding="20"> <Border Padding="20" Background="{StaticResource AKI_Background_Light}">
<!-- Add Controls for Previewer Here --> <!-- Add Controls for Previewer Here -->
<StackPanel Background="{StaticResource AKI_Background_Light}" Spacing="15" Margin="10">
<cc:TitleBar Title="Title Bar Text"/>
<Label Content="Normal label"/>
<Label Content="Yellow label" Classes="yellow"/>
<Label Content="Blue label" Classes="dark"/>
<ProgressBar Value="40"/>
<Separator Height="1"/>
<ProgressBar Value="60" Classes="done"/>
</StackPanel>
</Border> </Border>
</Design.PreviewWith> </Design.PreviewWith>
@ -12,13 +21,26 @@
<Style Selector="cc|TitleBar"> <Style Selector="cc|TitleBar">
<Setter Property="Background" Value="{StaticResource AKI_Background_Dark}"/> <Setter Property="Background" Value="{StaticResource AKI_Background_Dark}"/>
<Setter Property="Foreground" Value="{StaticResource AKI_Foreground_Light}"/> <Setter Property="Foreground" Value="{StaticResource AKI_Foreground_Light}"/>
<Setter Property="XButtonForeground" Value="{StaticResource AKI_Brush_DarkGrayBlue}"/>
</Style> </Style>
<Style Selector="Label.blue"> <Style Selector="Label">
<Setter Property="Foreground" Value="DodgerBlue"/> <Setter Property="Foreground" Value="{StaticResource AKI_Foreground_Light}"/>
</Style> </Style>
<Style Selector="ProgressBar.Done"> <Style Selector="Label.yellow">
<Setter Property="Foreground" Value="{StaticResource AKI_Brush_Yellow}"/>
</Style>
<Style Selector="Label.dark">
<Setter Property="Foreground" Value="DimGray"/>
</Style>
<Style Selector="ProgressBar">
<Setter Property="Foreground" Value="{StaticResource AKI_Brush_Yellow}"/>
</Style>
<Style Selector="ProgressBar.done">
<Setter Property="Foreground" Value="Green"/> <Setter Property="Foreground" Value="Green"/>
<Setter Property="Transitions"> <Setter Property="Transitions">
<Transitions> <Transitions>
@ -27,7 +49,7 @@
</Setter> </Setter>
</Style> </Style>
<Style Selector="ProgressBar.Done /template/ Border"> <Style Selector="ProgressBar.done /template/ Border">
<Setter Property="CornerRadius" Value="0"/> <Setter Property="CornerRadius" Value="0"/>
<Setter Property="Width" Value="5"/> <Setter Property="Width" Value="5"/>
<Setter Property="HorizontalAlignment" Value="Left"/> <Setter Property="HorizontalAlignment" Value="Left"/>
@ -42,4 +64,8 @@
</Animation> </Animation>
</Style.Animations> </Style.Animations>
</Style> </Style>
<Style Selector="Separator">
<Setter Property="Background" Value="{StaticResource AKI_Background_Dark}"/>
</Style>
</Styles> </Styles>

View File

@ -11,19 +11,18 @@
RelativeSource AncestorType=UserControl}}" RelativeSource AncestorType=UserControl}}"
/> />
<Label Content="{Binding Title, RelativeSource={ <Label Content="{Binding Title, RelativeSource={
RelativeSource RelativeSource AncestorType=UserControl}}"
AncestorType=UserControl}}"
IsHitTestVisible="False" IsHitTestVisible="False"
Foreground="{Binding Foreground, RelativeSource={ Foreground="{Binding Foreground, RelativeSource={
RelativeSource RelativeSource AncestorType=UserControl}}"
AncestorType=UserControl}}"
Background="Transparent" Background="Transparent"
VerticalContentAlignment="Center" VerticalContentAlignment="Center"
/> />
<Button Content="X" Grid.Column="2" <Button Content="X" Grid.Column="2"
Foreground="{Binding XButtonForeground, RelativeSource={
RelativeSource AncestorType=UserControl}}"
Command="{Binding XButtonCommand, RelativeSource={ Command="{Binding XButtonCommand, RelativeSource={
RelativeSource RelativeSource AncestorType=UserControl}}"
AncestorType=UserControl}}"
Background="Transparent" Background="Transparent"
HorizontalContentAlignment="Center" HorizontalContentAlignment="Center"
VerticalContentAlignment="Center" VerticalContentAlignment="Center"

View File

@ -27,6 +27,15 @@ namespace PatchClient.CustomControls
set => SetValue(TitleProperty, value); set => SetValue(TitleProperty, value);
} }
public static readonly StyledProperty<IBrush> XButtonForegroundProperty =
AvaloniaProperty.Register<TitleBar, IBrush>(nameof(XButtonForeground));
public IBrush XButtonForeground
{
get => GetValue(XButtonForegroundProperty);
set => SetValue(XButtonForegroundProperty, value);
}
public static new readonly StyledProperty<IBrush> ForegroundProperty = public static new readonly StyledProperty<IBrush> ForegroundProperty =
AvaloniaProperty.Register<TitleBar, IBrush>(nameof(Foreground)); AvaloniaProperty.Register<TitleBar, IBrush>(nameof(Foreground));

View File

@ -1,9 +1,7 @@
{ {
"profiles": { "profiles": {
"PatchClient": { "PatchClient": {
"commandName": "Executable", "commandName": "Project"
"executablePath": "Z:\\SPTarkov\\Patcher\\Patcher\\_port\\Patcher\\PatchClient\\bin\\Debug\\net5.0\\PatchClient.exe",
"workingDirectory": "C:\\Users\\JohnO\\Desktop\\12.12.2.16165"
} }
} }
} }

View File

@ -44,35 +44,6 @@ namespace PatchClient.ViewModels
RunPatcher(); RunPatcher();
} }
[Obsolete]
private void Test()
{
Task.Run(() =>
{
LineItem x = new LineItem("test 1", 30);
LineItem xx = new LineItem("test 2", 100);
LineItem xxx = new LineItem("test 3", 70);
LineItems.Add(new LineItemProgress(x));
LineItems.Add(new LineItemProgress(xx));
LineItems.Add(new LineItemProgress(xxx));
for (int i = 0; i <= 100; i++)
{
System.Threading.Thread.Sleep(20);
PatchPercent = i;
ProgressMessage = $"Patching @ {i}%";
foreach(var item in LineItems)
{
item.UpdateProgress(item.Total - i);
}
}
navigator.SelectedViewModel = new MessageViewModel("Test Run Complete").WithDelay(400);
});
}
private void RunPatcher() private void RunPatcher()
{ {
Task.Run(() => Task.Run(() =>

View File

@ -8,11 +8,12 @@
x:Class="PatchClient.Views.MainWindow" x:Class="PatchClient.Views.MainWindow"
Icon="/Assets/avalonia-logo.ico" Icon="/Assets/avalonia-logo.ico"
Title="Patch Client" Title="Patch Client"
Height="300" Width="600" Height="240" Width="600"
WindowStartupLocation="CenterScreen" WindowStartupLocation="CenterScreen"
ExtendClientAreaToDecorationsHint="True" ExtendClientAreaToDecorationsHint="True"
ExtendClientAreaChromeHints="NoChrome" ExtendClientAreaChromeHints="NoChrome"
ExtendClientAreaTitleBarHeightHint="-1" ExtendClientAreaTitleBarHeightHint="-1"
Background="{StaticResource AKI_Background_Light}"
> >
<Window.Styles> <Window.Styles>
<StyleInclude Source="/Assets/Styles.axaml"/> <StyleInclude Source="/Assets/Styles.axaml"/>

View File

@ -13,7 +13,7 @@
<Label Content="You can close this window" <Label Content="You can close this window"
FontSize="12" FontWeight="SemiBold"/> FontSize="12" FontWeight="SemiBold"/>
<Label Content="{Binding InfoText}" <Label Content="{Binding InfoText}"
Classes="blue" Classes="yellow"
/> />
</StackPanel> </StackPanel>

View File

@ -21,12 +21,11 @@
<!-- Current Patch Text --> <!-- Current Patch Text -->
<Label Content="{Binding ProgressMessage}"/> <Label Content="{Binding ProgressMessage}"/>
<Label Content="{Binding PatchMessage}" Grid.Row="1" <Label Content="{Binding PatchMessage}" Grid.Row="1"
Classes="blue"/> Classes="dark"/>
<ProgressBar Grid.Row="2" Value="{Binding PatchPercent}"/> <ProgressBar Grid.Row="2" Value="{Binding PatchPercent}"/>
<Separator Grid.Row="3" <Separator Grid.Row="3"
VerticalAlignment="Bottom" VerticalAlignment="Bottom"
Background="Gainsboro"
Height="1" Height="1"
Margin="0 20"/> Margin="0 20"/>
@ -34,15 +33,17 @@
<ItemsControl Items="{Binding LineItems}" Grid.Row="4"> <ItemsControl Items="{Binding LineItems}" Grid.Row="4">
<ItemsControl.ItemTemplate> <ItemsControl.ItemTemplate>
<DataTemplate DataType="{x:Type model:LineItemProgress}"> <DataTemplate DataType="{x:Type model:LineItemProgress}">
<StackPanel Orientation="Horizontal"> <Grid ColumnDefinitions="AUTO,3*,AUTO,*,AUTO">
<Label Content="{Binding Info}"/> <Label Content="{Binding Info}"
<Label Content="{Binding ProgressInfo}"/> />
<ProgressBar Value="{Binding Progress}" <Label Content="{Binding ProgressInfo}" Grid.Column="2"
FontSize="12"/>
<ProgressBar Value="{Binding Progress}" Grid.Column="4"
Margin="0 0 0 4" Margin="0 0 0 4"
VerticalAlignment="Center" VerticalAlignment="Center"
Width="200" MaxWidth="200" Width="200" MaxWidth="200"
Classes.Done="{Binding Completed}"/> Classes.done="{Binding Completed}"/>
</StackPanel> </Grid>
</DataTemplate> </DataTemplate>
</ItemsControl.ItemTemplate> </ItemsControl.ItemTemplate>
</ItemsControl> </ItemsControl>