This commit is contained in:
MyDrift 2024-08-15 23:53:05 +02:00
parent 4c6990b515
commit a22d6b0d10
3 changed files with 56 additions and 45 deletions

View File

@ -86,7 +86,7 @@
"HeaderFontFamily": "Consolas, Monaco",
"CheckBoxBulletDecoratorFontSize": "14",
"CheckBoxMargin": "5,0,0,2",
"CheckBoxMargin": "5,0,0,1",
"TabButtonFontSize": "14",
"TabButtonWidth": "100",
@ -158,7 +158,7 @@
"HeaderFontFamily": "Consolas, Monaco",
"CheckBoxBulletDecoratorFontSize": "14",
"CheckBoxMargin": "5,0,0,2",
"CheckBoxMargin": "5,0,0,0.8",
"TabButtonFontSize": "14",
"TabButtonWidth": "100",

View File

@ -48,7 +48,7 @@ function Invoke-WPFUIElements {
Content = $entryInfo.Content
Choco = $entryInfo.choco
Winget = $entryInfo.winget
Panel = if ($entryInfo.Panel -ne $null) { $entryInfo.Panel } else { "0" }
Panel = if ($entryInfo.Panel) { $entryInfo.Panel } else { "0" }
Link = $entryInfo.link
Description = $entryInfo.description
Type = $entryInfo.type
@ -222,17 +222,6 @@ function Invoke-WPFUIElements {
$sync[$entryInfo.Name] = $toggleButton
}
"Image" {
$image = New-Object Windows.Controls.Image
$image.Name = $entryInfo.Name
$image.Source = $entryInfo.Content
$image.Height = $theme.ImageHeight
$image.Width = $theme.ImageWidth
$image.HorizontalAlignment = "Center"
$image.Margin = $theme.ImageMargin
$stackPanel.Children.Add($image) | Out-Null
}
"Combobox" {
$horizontalStackPanel = New-Object Windows.Controls.StackPanel
$horizontalStackPanel.Orientation = "Horizontal"
@ -276,17 +265,12 @@ function Invoke-WPFUIElements {
$button.Margin = "5"
$button.Padding = "20,5"
$button.FontSize = $theme.ButtonFontSize
if ($entryInfo.ButtonWidth -ne $null) {
if ($entryInfo.ButtonWidth) {
$button.Width = $entryInfo.ButtonWidth
}
$stackPanel.Children.Add($button) | Out-Null
$sync[$entryInfo.Name] = $button
$sync[$entryInfo.Name].Add_Click({
[System.Object]$Sender = $args[0]
Invoke-WPFButton $Sender.name
})
}
default {
@ -299,12 +283,12 @@ function Invoke-WPFUIElements {
$checkBox.FontSize = $theme.FontSize
$checkBox.ToolTip = $entryInfo.Description
$checkBox.Margin = $theme.CheckBoxMargin
if ($entryInfo.Checked -ne $null) {
if ($entryInfo.Checked) {
$checkBox.IsChecked = $entryInfo.Checked
}
$horizontalStackPanel.Children.Add($checkBox) | Out-Null
if ($entryInfo.Link -ne $null) {
if ($entryInfo.Link) {
$textBlock = New-Object Windows.Controls.TextBlock
$textBlock.Name = $checkBox.Name + "Link"
$textBlock.Text = "(?)"

View File

@ -773,32 +773,59 @@
</Grid>
</TabItem>
<TabItem Header="Tweaks" Visibility="Collapsed" Name="WPFTab2">
<ScrollViewer VerticalScrollBarVisibility="Auto">
<Grid Background="Transparent">
<Grid>
<!-- Main content area with a ScrollViewer -->
<Grid.RowDefinitions>
<RowDefinition Height="45px"/>
<RowDefinition Height=".70*"/>
<RowDefinition Height=".10*"/>
<RowDefinition Height="*" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<StackPanel Background="{MainBackgroundColor}" Orientation="Horizontal" HorizontalAlignment="Left" Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" Margin="5">
<Label Content="Recommended Selections:" FontSize="{FontSize}" VerticalAlignment="Center" Margin="2"/>
<Button Name="WPFstandard" Content=" Standard " Margin="2"/>
<Button Name="WPFminimal" Content=" Minimal " Margin="2"/>
<Button Name="WPFclear" Content=" Clear " Margin="2"/>
<Button Name="WPFGetInstalledTweaks" Content=" Get Installed " Margin="2"/>
</StackPanel>
<Grid Name="tweakspanel" Grid.Row="1">
</Grid>
<Border Grid.ColumnSpan="2" Grid.Row="2" Grid.Column="0">
<StackPanel Background="{MainBackgroundColor}" Orientation="Horizontal" HorizontalAlignment="Left">
<TextBlock Padding="10">
Note: Hover over items to get a better description. Please be careful as many of these tweaks will heavily modify your system.
<LineBreak/>Recommended selections are for normal users and if you are unsure do NOT check anything else!
</TextBlock>
</StackPanel>
<ScrollViewer VerticalScrollBarVisibility="Auto" Grid.Row="0">
<Grid Background="Transparent">
<Grid.RowDefinitions>
<RowDefinition Height="45px"/>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<StackPanel Background="{MainBackgroundColor}" Orientation="Horizontal" HorizontalAlignment="Left" Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" Margin="5">
<Label Content="Recommended Selections:" FontSize="{FontSize}" VerticalAlignment="Center" Margin="2"/>
<Button Name="WPFstandard" Content=" Standard " Margin="2"/>
<Button Name="WPFminimal" Content=" Minimal " Margin="2"/>
<Button Name="WPFclear" Content=" Clear " Margin="2"/>
<Button Name="WPFGetInstalledTweaks" Content=" Get Installed " Margin="2"/>
</StackPanel>
<Grid Name="tweakspanel" Grid.Row="1">
<!-- Your tweakspanel content goes here -->
</Grid>
<!-- TextBlock with note on the right half -->
<StackPanel Grid.Row="2" Orientation="Horizontal" Margin="5">
<TextBlock Padding="5">
Note: Hover over items to get a better description. Please be careful as many of these tweaks will heavily modify your system.
<LineBreak/>Recommended selections are for normal users and if you are unsure do NOT check anything else!
</TextBlock>
</StackPanel>
</Grid>
</ScrollViewer>
<!-- Centered border with buttons and text -->
<Border Grid.Row="1" Background="{MainBackgroundColor}" BorderBrush="Gray" BorderThickness="1" CornerRadius="5" HorizontalAlignment="Stretch" Padding="10">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*" />
<ColumnDefinition Width="1*" />
</Grid.ColumnDefinitions>
<!-- Buttons on the left half -->
<StackPanel Orientation="Horizontal" HorizontalAlignment="Left" VerticalAlignment="Center" Grid.Column="0">
<Button Name="WPFApplyButton" Content="Apply" Margin="5"/>
<Button Name="WPFCancelButton" Content="Cancel" Margin="5"/>
</StackPanel>
</Grid>
</Border>
</Grid>
</ScrollViewer>
</Grid>
</TabItem>
<TabItem Header="Config" Visibility="Collapsed" Name="WPFTab3">
<ScrollViewer VerticalScrollBarVisibility="Auto">