mirror of
https://github.com/Stone-Red-Code/DesktopMagic.git
synced 2026-09-04 08:56:15 +02:00
- Code Cleanup
This commit is contained in:
@@ -94,19 +94,19 @@
|
|||||||
<Border CornerRadius="1" BorderThickness="1.5" BorderBrush="Gray" Height="23" Width="23" Margin="0,0,5,0">
|
<Border CornerRadius="1" BorderThickness="1.5" BorderBrush="Gray" Height="23" Width="23" Margin="0,0,5,0">
|
||||||
<Rectangle x:Name="primaryColorRechtangle" Fill="White" />
|
<Rectangle x:Name="primaryColorRechtangle" Fill="White" />
|
||||||
</Border>
|
</Border>
|
||||||
<Button Content="Change Primary Color" Height="23" FontSize="10" Click="ChangePrimaryColorButton_Click" />
|
<Button Content="Change Primary Color" Height="23" FontSize="12" FontWeight="Regular" Click="ChangePrimaryColorButton_Click"/>
|
||||||
</DockPanel>
|
</DockPanel>
|
||||||
<DockPanel Margin="0,0,0,5">
|
<DockPanel Margin="0,0,0,5">
|
||||||
<Border CornerRadius="1" BorderThickness="1.5" BorderBrush="Gray" Height="23" Width="23" Margin="0,0,5,0">
|
<Border CornerRadius="1" BorderThickness="1.5" BorderBrush="Gray" Height="23" Width="23" Margin="0,0,5,0">
|
||||||
<Rectangle x:Name="secondaryColorRechtangle" Fill="White" />
|
<Rectangle x:Name="secondaryColorRechtangle" Fill="White" />
|
||||||
</Border>
|
</Border>
|
||||||
<Button Content="Change Secondary Color" Height="23" FontSize="10" Click="ChangeSecondaryColorButton_Click" />
|
<Button Content="Change Secondary Color" Height="23" FontSize="12" FontWeight="Regular" Click="ChangeSecondaryColorButton_Click" />
|
||||||
</DockPanel>
|
</DockPanel>
|
||||||
<DockPanel >
|
<DockPanel >
|
||||||
<Border CornerRadius="1" BorderThickness="1.5" BorderBrush="Gray" Height="23" Width="23" Margin="0,0,5,0">
|
<Border CornerRadius="1" BorderThickness="1.5" BorderBrush="Gray" Height="23" Width="23" Margin="0,0,5,0">
|
||||||
<Rectangle x:Name="backgroundColorRechtangle" Fill="White" />
|
<Rectangle x:Name="backgroundColorRechtangle" Fill="White" />
|
||||||
</Border>
|
</Border>
|
||||||
<Button Content="Change Background Color" Height="23" FontSize="10" Click="ChangeBackgroundColorButton_Click" />
|
<Button Content="Change Background Color" Height="23" FontSize="12" FontWeight="Regular" Click="ChangeBackgroundColorButton_Click" />
|
||||||
</DockPanel>
|
</DockPanel>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
<Grid Grid.Row="1" VerticalAlignment="Bottom">
|
<Grid Grid.Row="1" VerticalAlignment="Bottom">
|
||||||
|
|||||||
@@ -361,8 +361,6 @@ namespace DesktopMagic
|
|||||||
private void MusicVisualizerColorTextBox_TextChanged(object sender, TextChangedEventArgs e)
|
private void MusicVisualizerColorTextBox_TextChanged(object sender, TextChangedEventArgs e)
|
||||||
{
|
{
|
||||||
if (!string.IsNullOrWhiteSpace(musicVisualizerColorTextBox.Text) && musicVisualizerColorTextBox.Text != "Default")
|
if (!string.IsNullOrWhiteSpace(musicVisualizerColorTextBox.Text) && musicVisualizerColorTextBox.Text != "Default")
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
{
|
||||||
if (musicVisualizerColorTextBox.Text.Length > 0)
|
if (musicVisualizerColorTextBox.Text.Length > 0)
|
||||||
{
|
{
|
||||||
@@ -390,12 +388,9 @@ namespace DesktopMagic
|
|||||||
}
|
}
|
||||||
|
|
||||||
string hex = musicVisualizerColorTextBox.Text;
|
string hex = musicVisualizerColorTextBox.Text;
|
||||||
hex = hex.Replace("#", "");
|
|
||||||
|
|
||||||
if (hex.Length == 6)
|
if (MultiColorConverter.TryConvertToSystemColor(hex, out System.Drawing.Color systemColor))
|
||||||
{
|
{
|
||||||
System.Drawing.Color systemColor = System.Drawing.Color.FromArgb((byte)int.Parse(hex.Substring(0, 2), System.Globalization.NumberStyles.HexNumber), (byte)int.Parse(hex.Substring(2, 2), System.Globalization.NumberStyles.HexNumber), (byte)int.Parse(hex.Substring(4, 2), System.Globalization.NumberStyles.HexNumber));
|
|
||||||
|
|
||||||
MusicVisualzerColor = systemColor;
|
MusicVisualzerColor = systemColor;
|
||||||
musicVisualizerColorTextBox.Foreground = Brushes.Black;
|
musicVisualizerColorTextBox.Foreground = Brushes.Black;
|
||||||
|
|
||||||
@@ -407,11 +402,6 @@ namespace DesktopMagic
|
|||||||
musicVisualizerColorTextBox.Foreground = Brushes.Red;
|
musicVisualizerColorTextBox.Foreground = Brushes.Red;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch
|
|
||||||
{
|
|
||||||
musicVisualizerColorTextBox.Foreground = Brushes.Red;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
MusicVisualzerColor = null;
|
MusicVisualzerColor = null;
|
||||||
|
|||||||
Reference in New Issue
Block a user