1
0
mirror of https://github.com/chylex/Backup-Essentials.git synced 2025-07-31 03:59:07 +02:00

Fixed blurry main menu text and removed shadow on unsupported systems

This commit is contained in:
chylex 2015-05-06 21:03:40 +02:00
parent 6ebe6729c8
commit e34c448f61
2 changed files with 10 additions and 4 deletions
BackupEssentials

View File

@ -1,6 +1,8 @@
using System;
using BackupEssentials.Utils;
using System;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
using System.Windows.Threading;
namespace BackupEssentials.Controls{
@ -26,6 +28,8 @@ namespace BackupEssentials.Controls{
}
public override void OnApplyTemplate(){
if (!WindowsVersion.IsFullySupported())((Label)Template.FindName("label",this)).Effect = null;
base.OnApplyTemplate();
foreach(VisualStateGroup group in VisualStateManager.GetVisualStateGroups((FrameworkElement)Template.FindName("MainMenuButtonGrid",this))){

View File

@ -113,16 +113,18 @@
<VisualState x:Name="Pressed"/>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<Grid x:Name="GridBackground" Height="Auto" Width="Auto">
<Grid x:Name="GridBackground" Width="Auto" Height="Auto">
<Grid.Background>
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="#FF42B9F0"/>
<GradientStop Color="#FF1D6C8F" Offset="1"/>
</LinearGradientBrush>
</Grid.Background>
<Label x:Name="label" Content="{Binding Content, RelativeSource={RelativeSource TemplatedParent}}" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="White" FontSize="24" FontWeight="Bold" FontFamily="Segoe UI">
<Label x:Name="label" Content="{Binding Content, RelativeSource={RelativeSource TemplatedParent}}" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="White" FontSize="25" FontWeight="Bold" FontFamily="Segoe UI" TextOptions.TextFormattingMode="Display" RenderOptions.BitmapScalingMode="NearestNeighbor" SnapsToDevicePixels="True" UseLayoutRounding="True">
<Label.Effect>
<DropShadowEffect BlurRadius="2" Direction="270" ShadowDepth="0.5" Color="#FF072B3C"/>
<DropShadowEffect BlurRadius="3" Direction="270" ShadowDepth="1" Color="#FF072B3C"/>
</Label.Effect>
</Label>
</Grid>