Some progress heat styling work

This commit is contained in:
Justin Swanson 2019-11-28 23:52:23 -06:00
parent 5f67725ed4
commit 86efb24ec8
5 changed files with 46 additions and 7 deletions

View File

@ -1,4 +1,4 @@
<ResourceDictionary
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
@ -37,6 +37,7 @@
<Color x:Key="PrimaryVariant">#3700B3</Color>
<Color x:Key="Secondary">#03DAC6</Color>
<Color x:Key="DarkSecondary">#0e8f83</Color>
<Color x:Key="DarkerSecondary">#095952</Color>
<Color x:Key="Complementary">#C7FC86</Color>
<Color x:Key="Analogous1">#868CFC</Color>
<Color x:Key="Analogous2">#F686FC</Color>
@ -61,6 +62,7 @@
<SolidColorBrush x:Key="PrimaryVariantBrush" Color="{StaticResource PrimaryVariant}" />
<SolidColorBrush x:Key="SecondaryBrush" Color="{StaticResource Secondary}" />
<SolidColorBrush x:Key="DarkSecondaryBrush" Color="{StaticResource DarkSecondary}" />
<SolidColorBrush x:Key="DarkerSecondaryBrush" Color="{StaticResource DarkerSecondary}" />
<SolidColorBrush x:Key="ComplementaryBrush" Color="{StaticResource Complementary}" />
<SolidColorBrush x:Key="Analogous1Brush" Color="{StaticResource Analogous1}" />
<SolidColorBrush x:Key="Analogous2Brush" Color="{StaticResource Analogous2}" />

View File

@ -1,4 +1,4 @@
<UserControl
<local:UserControlRx
x:Class="Wabbajack.TopProgressView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
@ -83,7 +83,7 @@
BorderThickness="0"
Foreground="{StaticResource PrimaryVariantBrush}"
Maximum="1"
Opacity="{Binding ProgressPercent, Mode=OneWay, RelativeSource={RelativeSource AncestorType={x:Type UserControl}}}"
Opacity="{Binding ProgressOpacityPercent, Mode=OneWay, RelativeSource={RelativeSource AncestorType={x:Type UserControl}}}"
Value="{Binding ProgressPercent, Mode=OneWay, RelativeSource={RelativeSource AncestorType={x:Type UserControl}}}" />
<TextBlock
Grid.Column="0"
@ -135,4 +135,4 @@
</mahapps:MetroProgressBar.Foreground>
</mahapps:MetroProgressBar>
</Grid>
</UserControl>
</local:UserControlRx>

View File

@ -1,12 +1,14 @@
using System.Windows;
using System.Reactive.Linq;
using System.Windows;
using System.Windows.Controls;
using ReactiveUI;
namespace Wabbajack
{
/// <summary>
/// Interaction logic for TopProgressView.xaml
/// </summary>
public partial class TopProgressView : UserControl
public partial class TopProgressView : UserControlRx
{
public double ProgressPercent
{
@ -14,7 +16,7 @@ namespace Wabbajack
set => SetValue(ProgressPercentProperty, value);
}
public static readonly DependencyProperty ProgressPercentProperty = DependencyProperty.Register(nameof(ProgressPercent), typeof(double), typeof(TopProgressView),
new FrameworkPropertyMetadata(default(double)));
new FrameworkPropertyMetadata(default(double), WireNotifyPropertyChanged));
public string Title
{
@ -40,9 +42,18 @@ namespace Wabbajack
public static readonly DependencyProperty OverhangShadowProperty = DependencyProperty.Register(nameof(OverhangShadow), typeof(bool), typeof(TopProgressView),
new FrameworkPropertyMetadata(true));
private readonly ObservableAsPropertyHelper<double> _ProgressOpacityPercent;
public double ProgressOpacityPercent => _ProgressOpacityPercent.Value;
public TopProgressView()
{
InitializeComponent();
_ProgressOpacityPercent = this.WhenAny(x => x.ProgressPercent)
.Select(x =>
{
return 0.3 + x * 0.7;
})
.ToProperty(this, nameof(ProgressOpacityPercent));
}
}
}

View File

@ -33,6 +33,14 @@
Grid.Row="1"
Grid.RowSpan="2"
Grid.Column="4" />
<Rectangle
x:Name="BorderHeatFill"
Grid.Row="0"
Grid.RowSpan="3"
Grid.Column="0"
Grid.ColumnSpan="5"
Fill="#7d3700B3"
Opacity="{Binding PercentCompleted}" />
<local:DetailImageView
Title="{Binding CurrentModlistSettings.ModListName}"
Grid.Row="1"
@ -49,6 +57,11 @@
HorizontalAlignment="Center"
Fill="{StaticResource DarkBackgroundBrush}"
SnapsToDevicePixels="True" />
<Rectangle
x:Name="ModlistDetailsBackground"
Grid.Row="1"
Grid.Column="1"
Fill="{StaticResource WindowBackgroundBrush}" />
<!-- Comes after image area so shadow can overlay -->
<local:TopProgressView
Title="{Binding CurrentModlistSettings.ModListName, Mode=OneWay}"
@ -150,6 +163,13 @@
VerticalAlignment="Top"
Fill="{StaticResource DarkBackgroundBrush}"
SnapsToDevicePixels="True" />
<Rectangle
x:Name="BottomBarBackground"
Grid.Row="2"
Grid.Column="0"
Grid.ColumnSpan="5"
Margin="5"
Fill="{StaticResource WindowBackgroundBrush}" />
<Grid
Grid.Row="2"
Grid.Column="0"

View File

@ -38,6 +38,12 @@
</LinearGradientBrush>
</Rectangle.Fill>
</Rectangle>
<Rectangle
x:Name="BorderHeatFill"
Grid.Row="0"
Grid.RowSpan="3"
Fill="#7d3700B3"
Opacity="{Binding PercentCompleted}" />
<Grid
x:Name="Slideshow"
Grid.Row="1"