Skip to content

Commit

Permalink
Updated to V0.5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
nezhatweaks committed Oct 30, 2024
1 parent 5c38d8b commit 7ff4970
Show file tree
Hide file tree
Showing 18 changed files with 1,645 additions and 364 deletions.
2 changes: 1 addition & 1 deletion Assets/latest_version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.4.0.0
0.5.0.0
16 changes: 6 additions & 10 deletions src/AMD.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,6 @@ private void LoadRegistryValue(string valueName, ToggleButton toggleButton, stri
toggleButton.IsChecked = GetToggleState(value);
}
}
else
{
ShowError($"Failed to access {valueName} registry key.");
}
}
catch (UnauthorizedAccessException)
{
Expand Down Expand Up @@ -127,7 +123,6 @@ private void LoadRegistryValue(string valueName, ToggleButton toggleButton, stri
};
}


private RegistryKey? OpenRegistryKey(string path, bool writable = false)
{
// Attempt to open the specified registry key
Expand All @@ -137,7 +132,6 @@ private void LoadRegistryValue(string valueName, ToggleButton toggleButton, stri
if (key == null && writable)
{
// Create the key if it doesn't exist
string basePath = path.Substring(0, path.LastIndexOf('\\'));
key = Registry.LocalMachine.CreateSubKey(path);
}

Expand All @@ -154,17 +148,19 @@ private void ToggleRegistryValue(string valueName, bool enable, string? registry
// Open the registry key, creating it if it doesn't exist
key = OpenRegistryKey(path, writable: true);

// Ensure UMD key is created if this is a UMD setting
if (path == UMDRegistryKeyPath)
{
OpenRegistryKey(UMDRegistryKeyPath, writable: true);
}

if (key != null)
{
// Set the value, creating it if necessary
SetRegistryValue(key, valueName, enable);
mainWindow?.MarkSettingsApplied();
App.changelogUserControl?.AddLog("Applied", $"{valueName} has been set to {(enable ? "Enabled" : "Disabled")}");
}
else
{
ShowError($"Failed to access the registry key for '{valueName}'.");
}
}
catch (UnauthorizedAccessException)
{
Expand Down
232 changes: 145 additions & 87 deletions src/CPUPriorityControl.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -120,61 +120,116 @@
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>

<StackPanel Grid.Row="0">
<StackPanel x:Name="VerifiedContent" Visibility="Visible" Orientation="Vertical" Margin="0,70,0,0">
<StackPanel Margin="10,70,-10,0" >
<StackPanel x:Name="VerifiedContent" Visibility="Visible" Orientation="Vertical" >
<TextBlock x:Name="CardTitleTextBlock" FontSize="24" HorizontalAlignment="Center" Visibility="Collapsed" />
<TextBlock x:Name="CardDescriptionTextBlock" FontSize="18" HorizontalAlignment="Center" Visibility="Collapsed" />

<!-- ScrollViewer for scrolling capability -->
<ScrollViewer VerticalScrollBarVisibility="Auto" Height="250" >
<ScrollViewer.Resources>
<Style TargetType="ScrollBar">
<Setter Property="Background" Value="Transparent"/>
<Setter Property="Width" Value="20"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ScrollBar" >
<Grid Background="Transparent" Margin="-20,20,0,0" >
<Track Name="PART_Track" IsDirectionReversed="true">
<Track.DecreaseRepeatButton>
<RepeatButton Name="PART_DecreaseButton"
Content=""
Command="ScrollBar.LineUpCommand"
Background="Transparent"
Width="0" Height="0"/>
</Track.DecreaseRepeatButton>
<Track.Thumb>
<Thumb Name="Thumb"
Background="Black"
Opacity="0.7"
Width="3"
MinHeight="200"/>
</Track.Thumb>
<Track.IncreaseRepeatButton>
<RepeatButton Name="PART_IncreaseButton"
Content=""
Command="ScrollBar.LineDownCommand"
Background="Transparent"
Width="0" Height="0"/>
</Track.IncreaseRepeatButton>
</Track>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ScrollViewer.Resources>
<ItemsControl ItemsSource="{Binding Cards}" Width="400">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<WrapPanel />
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate>
<Grid Margin="5">
<!-- Card Button -->
<Button Click="CardButton_Click" Width="180" Height="240"
Background="Black" Foreground="White" FontSize="16" FontWeight="Bold">
<Button.Template>
<ControlTemplate TargetType="Button">
<Border x:Name="border" Background="{TemplateBinding Background}"
BorderBrush="Black" BorderThickness="1" CornerRadius="5" Padding="3">
<Border.Effect>
<DropShadowEffect Color="Black" ShadowDepth="5" BlurRadius="10" Opacity="0.5" />
</Border.Effect>
<Grid>
<Image x:Name="CardImage" Stretch="UniformToFill"
Source="{Binding ImageSource}" Margin="0,0,0,0" />
<StackPanel VerticalAlignment="Bottom" HorizontalAlignment="Center"
Background="Transparent">
<TextBlock Text="{Binding Title}"
FontSize="16" Margin="0,0,0,5" Background="Black"
HorizontalAlignment="Center" Foreground="White" />
<TextBlock Text="{Binding Description}" FontSize="18"
FontWeight="Bold" Foreground="{TemplateBinding Foreground}"
HorizontalAlignment="Center" />
</StackPanel>
</Grid>
</Border>

<Button x:Name="CardButton" Click="CardButton_Click" Width="180" Height="240"
Background="Black" Foreground="White" FontSize="16" FontWeight="Bold" VerticalAlignment="Center">
<Button.Template>
<ControlTemplate TargetType="Button">
<Border x:Name="border" Background="{TemplateBinding Background}"
BorderBrush="Black" BorderThickness="1" CornerRadius="0" Padding="3">
<Border.Effect>
<DropShadowEffect Color="Black" ShadowDepth="5" BlurRadius="10" Opacity="0.5" />
</Border.Effect>
<Grid>

<Image x:Name="CardImage" Stretch="UniformToFill"
Source="{Binding ImageSource}" Margin="0,0,0,0" />
<StackPanel VerticalAlignment="Bottom" HorizontalAlignment="Center"
Background="Transparent" >

<TextBlock Text="{Binding ElementName=CardTitleTextBlock, Path=Text}"
FontSize="16" Margin="0,0,0,5" Background="Black"
HorizontalAlignment="Center" Foreground="White" />
<TextBlock Text="{TemplateBinding Content}" FontSize="18"
FontWeight="Bold" Foreground="{TemplateBinding Foreground}"
HorizontalAlignment="Center" />

<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="border" Property="Background" Value="Red"/>
<Setter TargetName="border" Property="BorderBrush" Value="Red"/>
<Setter TargetName="border" Property="Effect">
<Setter.Value>
<DropShadowEffect Color="Red" ShadowDepth="5" BlurRadius="20" Opacity="1" />
</Setter.Value>
</Setter>
</Trigger>
<Trigger Property="IsPressed" Value="True">
<Setter TargetName="border" Property="Background" Value="Red"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Button.Template>
</Button>



</StackPanel>

<!-- Revert Button inside each card -->
<Button x:Name="RevertButton" Click="RevertButton_Click" Width="30" Height="30"
Background="Black"
Style="{StaticResource MinimalButtonStyle}"
Content="↩️"
HorizontalAlignment="Right"
VerticalAlignment="Top"
Margin="0,5,5,0" />
<!-- Adjust margin to position as needed -->
</Grid>
</Border>

<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="border" Property="Background" Value="Red"/>
<Setter TargetName="border" Property="BorderBrush" Value="Red"/>
<Setter TargetName="border" Property="Effect">
<Setter.Value>
<DropShadowEffect Color="Red" ShadowDepth="5" BlurRadius="20" Opacity="1" />
</Setter.Value>
</Setter>
</Trigger>
<Trigger Property="IsPressed" Value="True">
<Setter TargetName="border" Property="Background" Value="Red"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Button.Template>
</Button>

</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</ScrollViewer>
</StackPanel>

<Grid Grid.Row="1">
Expand All @@ -184,49 +239,52 @@
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>

<Button x:Name="LeftButton"
Click="LeftButton_Click"
Width="50"
Height="30"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Grid.Column="1"
Margin="0,-250,210,0"
Background="Transparent"
BorderBrush="Gray"
BorderThickness="0"
FontWeight="Bold"
Content=""
Style="{StaticResource MinimalButtonStyle}" />

<Button x:Name="RightButton"
Click="RightButton_Click"
Width="50"
Height="30"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Grid.Column="2"
Margin="0,-250,0,0"
Background="Transparent"
BorderBrush="Gray"
BorderThickness="0"
Foreground="White"
FontWeight="Bold"
Content=""
Style="{StaticResource MinimalButtonStyle}" />
</Grid>
<Button x:Name="RevertButton" Click="RevertButton_Click" Width="30" Height="30"
Background="Black"
Style="{StaticResource MinimalButtonStyle}"
Content="X"
HorizontalAlignment="Right"
VerticalAlignment="Top"
Margin="0,-250,100,0" />
</StackPanel>





<StackPanel x:Name="ExperimentalContent" Visibility="Collapsed" Orientation="Vertical" Margin="0,20,0,0">
<ScrollViewer Width="420" Height="300" VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled">
<ScrollViewer.Resources>
<Style TargetType="ScrollBar">
<Setter Property="Background" Value="Transparent"/>
<Setter Property="Width" Value="20"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ScrollBar" >
<Grid Background="Transparent" Margin="-20,20,0,0" >
<Track Name="PART_Track" IsDirectionReversed="true">
<Track.DecreaseRepeatButton>
<RepeatButton Name="PART_DecreaseButton"
Content=""
Command="ScrollBar.LineUpCommand"
Background="Transparent"
Width="0" Height="0"/>
</Track.DecreaseRepeatButton>
<Track.Thumb>
<Thumb Name="Thumb"
Background="Black"
Opacity="0.7"
Width="3"
MinHeight="200"/>
</Track.Thumb>
<Track.IncreaseRepeatButton>
<RepeatButton Name="PART_IncreaseButton"
Content=""
Command="ScrollBar.LineDownCommand"
Background="Transparent"
Width="0" Height="0"/>
</Track.IncreaseRepeatButton>
</Track>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ScrollViewer.Resources>
<StackPanel>
<TextBlock Text="Apps" Foreground="White" FontSize="20" FontWeight="Bold" />
<Border Background="#2F3136" Padding="10" CornerRadius="10" BorderThickness="1" BorderBrush="Transparent">
Expand Down
Loading

0 comments on commit 7ff4970

Please sign in to comment.