mirror of
https://github.com/ChrisTitusTech/winutil.git
synced 2025-01-15 09:20:36 -06:00
Compare commits
3 Commits
cdf36857c5
...
a22d6b0d10
Author | SHA1 | Date | |
---|---|---|---|
|
a22d6b0d10 | ||
|
4c6990b515 | ||
|
3f48c8aa70 |
@ -86,7 +86,7 @@
|
|||||||
"HeaderFontFamily": "Consolas, Monaco",
|
"HeaderFontFamily": "Consolas, Monaco",
|
||||||
|
|
||||||
"CheckBoxBulletDecoratorFontSize": "14",
|
"CheckBoxBulletDecoratorFontSize": "14",
|
||||||
"CheckBoxMargin": "5,0,0,2",
|
"CheckBoxMargin": "5,0,0,1",
|
||||||
|
|
||||||
"TabButtonFontSize": "14",
|
"TabButtonFontSize": "14",
|
||||||
"TabButtonWidth": "100",
|
"TabButtonWidth": "100",
|
||||||
@ -158,7 +158,7 @@
|
|||||||
"HeaderFontFamily": "Consolas, Monaco",
|
"HeaderFontFamily": "Consolas, Monaco",
|
||||||
|
|
||||||
"CheckBoxBulletDecoratorFontSize": "14",
|
"CheckBoxBulletDecoratorFontSize": "14",
|
||||||
"CheckBoxMargin": "5,0,0,2",
|
"CheckBoxMargin": "5,0,0,0.8",
|
||||||
|
|
||||||
"TabButtonFontSize": "14",
|
"TabButtonFontSize": "14",
|
||||||
"TabButtonWidth": "100",
|
"TabButtonWidth": "100",
|
||||||
|
@ -48,7 +48,7 @@ function Invoke-WPFUIElements {
|
|||||||
Content = $entryInfo.Content
|
Content = $entryInfo.Content
|
||||||
Choco = $entryInfo.choco
|
Choco = $entryInfo.choco
|
||||||
Winget = $entryInfo.winget
|
Winget = $entryInfo.winget
|
||||||
Panel = if ($entryInfo.Panel -ne $null) { $entryInfo.Panel } else { "0" }
|
Panel = if ($entryInfo.Panel) { $entryInfo.Panel } else { "0" }
|
||||||
Link = $entryInfo.link
|
Link = $entryInfo.link
|
||||||
Description = $entryInfo.description
|
Description = $entryInfo.description
|
||||||
Type = $entryInfo.type
|
Type = $entryInfo.type
|
||||||
@ -87,7 +87,6 @@ function Invoke-WPFUIElements {
|
|||||||
# Only apply the logic for distributing entries across columns if the targetGridName is "appspanel"
|
# Only apply the logic for distributing entries across columns if the targetGridName is "appspanel"
|
||||||
if ($targetGridName -eq "appspanel") {
|
if ($targetGridName -eq "appspanel") {
|
||||||
$panelcount = 0
|
$panelcount = 0
|
||||||
$paneltotal = $columncount # Use columncount for even distribution
|
|
||||||
$entrycount = $configHashtable.Keys.Count + $organizedData["0"].Keys.Count
|
$entrycount = $configHashtable.Keys.Count + $organizedData["0"].Keys.Count
|
||||||
$maxcount = [Math]::Round($entrycount / $columncount + 0.5)
|
$maxcount = [Math]::Round($entrycount / $columncount + 0.5)
|
||||||
}
|
}
|
||||||
@ -138,6 +137,8 @@ function Invoke-WPFUIElements {
|
|||||||
$label.FontFamily = $theme.HeaderFontFamily
|
$label.FontFamily = $theme.HeaderFontFamily
|
||||||
$stackPanel.Children.Add($label) | Out-Null
|
$stackPanel.Children.Add($label) | Out-Null
|
||||||
|
|
||||||
|
$sync[$category] = $label
|
||||||
|
|
||||||
# Sort entries by Order and then by Name, but only display Name
|
# Sort entries by Order and then by Name, but only display Name
|
||||||
$entries = $organizedData[$panelKey][$category] | Sort-Object Order, Name
|
$entries = $organizedData[$panelKey][$category] | Sort-Object Order, Name
|
||||||
foreach ($entryInfo in $entries) {
|
foreach ($entryInfo in $entries) {
|
||||||
@ -176,7 +177,6 @@ function Invoke-WPFUIElements {
|
|||||||
$label.ToolTip = $entryInfo.Description
|
$label.ToolTip = $entryInfo.Description
|
||||||
$label.HorizontalAlignment = "Left"
|
$label.HorizontalAlignment = "Left"
|
||||||
$label.FontSize = $theme.FontSize
|
$label.FontSize = $theme.FontSize
|
||||||
# Implement for consistent theming later on $label.Style = $window.FindResource("labelfortweaks")
|
|
||||||
$dockPanel.Children.Add($label) | Out-Null
|
$dockPanel.Children.Add($label) | Out-Null
|
||||||
$stackPanel.Children.Add($dockPanel) | Out-Null
|
$stackPanel.Children.Add($dockPanel) | Out-Null
|
||||||
|
|
||||||
@ -222,17 +222,6 @@ function Invoke-WPFUIElements {
|
|||||||
$sync[$entryInfo.Name] = $toggleButton
|
$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" {
|
"Combobox" {
|
||||||
$horizontalStackPanel = New-Object Windows.Controls.StackPanel
|
$horizontalStackPanel = New-Object Windows.Controls.StackPanel
|
||||||
$horizontalStackPanel.Orientation = "Horizontal"
|
$horizontalStackPanel.Orientation = "Horizontal"
|
||||||
@ -276,35 +265,32 @@ function Invoke-WPFUIElements {
|
|||||||
$button.Margin = "5"
|
$button.Margin = "5"
|
||||||
$button.Padding = "20,5"
|
$button.Padding = "20,5"
|
||||||
$button.FontSize = $theme.ButtonFontSize
|
$button.FontSize = $theme.ButtonFontSize
|
||||||
if ($entryInfo.ButtonWidth -ne $null) {
|
if ($entryInfo.ButtonWidth) {
|
||||||
$button.Width = $entryInfo.ButtonWidth
|
$button.Width = $entryInfo.ButtonWidth
|
||||||
}
|
}
|
||||||
$stackPanel.Children.Add($button) | Out-Null
|
$stackPanel.Children.Add($button) | Out-Null
|
||||||
|
|
||||||
$sync[$entryInfo.Name] = $button
|
$sync[$entryInfo.Name] = $button
|
||||||
|
|
||||||
$sync[$entryInfo.Name].Add_Click({
|
|
||||||
[System.Object]$Sender = $args[0]
|
|
||||||
Invoke-WPFButton $Sender.name
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
default {
|
default {
|
||||||
|
$horizontalStackPanel = New-Object Windows.Controls.StackPanel
|
||||||
|
$horizontalStackPanel.Orientation = "Horizontal"
|
||||||
|
|
||||||
$checkBox = New-Object Windows.Controls.CheckBox
|
$checkBox = New-Object Windows.Controls.CheckBox
|
||||||
$checkBox.Name = $entryInfo.Name
|
$checkBox.Name = $entryInfo.Name
|
||||||
$checkBox.Content = $entryInfo.Content
|
$checkBox.Content = $entryInfo.Content
|
||||||
$checkBox.FontSize = $theme.FontSize
|
$checkBox.FontSize = $theme.FontSize
|
||||||
$checkBox.ToolTip = $entryInfo.Description
|
$checkBox.ToolTip = $entryInfo.Description
|
||||||
$checkBox.Margin = $theme.CheckBoxMargin
|
$checkBox.Margin = $theme.CheckBoxMargin
|
||||||
if ($entryInfo.Checked -ne $null) {
|
if ($entryInfo.Checked) {
|
||||||
$checkBox.IsChecked = $entryInfo.Checked
|
$checkBox.IsChecked = $entryInfo.Checked
|
||||||
}
|
}
|
||||||
if ($entryInfo.Link -ne $null) {
|
|
||||||
$horizontalStackPanel = New-Object Windows.Controls.StackPanel
|
|
||||||
$horizontalStackPanel.Orientation = "Horizontal"
|
|
||||||
$horizontalStackPanel.Children.Add($checkBox) | Out-Null
|
$horizontalStackPanel.Children.Add($checkBox) | Out-Null
|
||||||
|
|
||||||
|
if ($entryInfo.Link) {
|
||||||
$textBlock = New-Object Windows.Controls.TextBlock
|
$textBlock = New-Object Windows.Controls.TextBlock
|
||||||
|
$textBlock.Name = $checkBox.Name + "Link"
|
||||||
$textBlock.Text = "(?)"
|
$textBlock.Text = "(?)"
|
||||||
$textBlock.ToolTip = $entryInfo.Link
|
$textBlock.ToolTip = $entryInfo.Link
|
||||||
$textBlock.Style = $window.FindResource("HoverTextBlockStyle")
|
$textBlock.Style = $window.FindResource("HoverTextBlockStyle")
|
||||||
@ -318,11 +304,10 @@ function Invoke-WPFUIElements {
|
|||||||
|
|
||||||
$horizontalStackPanel.Children.Add($textBlock) | Out-Null
|
$horizontalStackPanel.Children.Add($textBlock) | Out-Null
|
||||||
|
|
||||||
$stackPanel.Children.Add($horizontalStackPanel) | Out-Null
|
$sync[$textBlock.Name] = $textBlock
|
||||||
} else {
|
|
||||||
$stackPanel.Children.Add($checkBox) | Out-Null
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$stackPanel.Children.Add($horizontalStackPanel) | Out-Null
|
||||||
$sync[$entryInfo.Name] = $checkBox
|
$sync[$entryInfo.Name] = $checkBox
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -372,7 +372,6 @@ $labels = @{}
|
|||||||
$allCategories = $checkBoxes.Name | ForEach-Object {$sync.configs.applications.$_} | Select-Object -Unique -ExpandProperty category
|
$allCategories = $checkBoxes.Name | ForEach-Object {$sync.configs.applications.$_} | Select-Object -Unique -ExpandProperty category
|
||||||
|
|
||||||
$sync["SearchBar"].Add_TextChanged({
|
$sync["SearchBar"].Add_TextChanged({
|
||||||
|
|
||||||
if ($sync.SearchBar.Text -ne "") {
|
if ($sync.SearchBar.Text -ne "") {
|
||||||
$sync.SearchBarClearButton.Visibility = "Visible"
|
$sync.SearchBarClearButton.Visibility = "Visible"
|
||||||
}
|
}
|
||||||
@ -399,33 +398,31 @@ $sync["SearchBar"].Add_TextChanged({
|
|||||||
$CheckBox.Value.Visibility = "Visible"
|
$CheckBox.Value.Visibility = "Visible"
|
||||||
$activeApplications += $sync.configs.applications.$checkboxName
|
$activeApplications += $sync.configs.applications.$checkboxName
|
||||||
# Set the corresponding text block visibility
|
# Set the corresponding text block visibility
|
||||||
if ($textBlock -ne $null) {
|
if ($textBlock -ne $null -and $textBlock -is [System.Windows.Controls.TextBlock]) {
|
||||||
$textBlock.Visibility = "Visible"
|
$textBlock.Visibility = "Visible"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$CheckBox.Value.Visibility = "Collapsed"
|
$CheckBox.Value.Visibility = "Collapsed"
|
||||||
# Set the corresponding text block visibility
|
# Set the corresponding text block visibility
|
||||||
if ($textBlock -ne $null) {
|
if ($textBlock -ne $null -and $textBlock -is [System.Windows.Controls.TextBlock]) {
|
||||||
$textBlock.Visibility = "Collapsed"
|
$textBlock.Visibility = "Collapsed"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$activeCategories = $activeApplications | Select-Object -ExpandProperty category -Unique
|
$activeCategories = $activeApplications | Select-Object -ExpandProperty category -Unique
|
||||||
|
|
||||||
foreach ($category in $activeCategories) {
|
foreach ($category in $activeCategories) {
|
||||||
$label = $labels[$(Get-WPFObjectName -type "Label" -name $category)]
|
$sync[$category].Visibility = "Visible"
|
||||||
$label.Visibility = "Visible"
|
|
||||||
}
|
}
|
||||||
if ($activeCategories) {
|
if ($activeCategories) {
|
||||||
$inactiveCategories = Compare-Object -ReferenceObject $allCategories -DifferenceObject $activeCategories -PassThru
|
$inactiveCategories = Compare-Object -ReferenceObject $allCategories -DifferenceObject $activeCategories -PassThru
|
||||||
}
|
} else {
|
||||||
else{
|
|
||||||
$inactiveCategories = $allCategories
|
$inactiveCategories = $allCategories
|
||||||
}
|
}
|
||||||
foreach ($category in $inactiveCategories) {
|
foreach ($category in $inactiveCategories) {
|
||||||
$label = $labels[$(Get-WPFObjectName -type "Label" -name $category)]
|
$sync[$category].Visibility = "Collapsed"}
|
||||||
$label.Visibility = "Collapsed"}
|
|
||||||
})
|
})
|
||||||
|
|
||||||
# Initialize the hashtable
|
# Initialize the hashtable
|
||||||
|
@ -773,13 +773,21 @@
|
|||||||
</Grid>
|
</Grid>
|
||||||
</TabItem>
|
</TabItem>
|
||||||
<TabItem Header="Tweaks" Visibility="Collapsed" Name="WPFTab2">
|
<TabItem Header="Tweaks" Visibility="Collapsed" Name="WPFTab2">
|
||||||
<ScrollViewer VerticalScrollBarVisibility="Auto">
|
<Grid>
|
||||||
|
<!-- Main content area with a ScrollViewer -->
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="*" />
|
||||||
|
<RowDefinition Height="Auto" />
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
|
||||||
|
<ScrollViewer VerticalScrollBarVisibility="Auto" Grid.Row="0">
|
||||||
<Grid Background="Transparent">
|
<Grid Background="Transparent">
|
||||||
<Grid.RowDefinitions>
|
<Grid.RowDefinitions>
|
||||||
<RowDefinition Height="45px"/>
|
<RowDefinition Height="45px"/>
|
||||||
<RowDefinition Height=".70*"/>
|
<RowDefinition Height="*"/>
|
||||||
<RowDefinition Height=".10*"/>
|
<RowDefinition Height="Auto"/>
|
||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
|
|
||||||
<StackPanel Background="{MainBackgroundColor}" Orientation="Horizontal" HorizontalAlignment="Left" Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" Margin="5">
|
<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"/>
|
<Label Content="Recommended Selections:" FontSize="{FontSize}" VerticalAlignment="Center" Margin="2"/>
|
||||||
<Button Name="WPFstandard" Content=" Standard " Margin="2"/>
|
<Button Name="WPFstandard" Content=" Standard " Margin="2"/>
|
||||||
@ -787,18 +795,37 @@
|
|||||||
<Button Name="WPFclear" Content=" Clear " Margin="2"/>
|
<Button Name="WPFclear" Content=" Clear " Margin="2"/>
|
||||||
<Button Name="WPFGetInstalledTweaks" Content=" Get Installed " Margin="2"/>
|
<Button Name="WPFGetInstalledTweaks" Content=" Get Installed " Margin="2"/>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
|
|
||||||
<Grid Name="tweakspanel" Grid.Row="1">
|
<Grid Name="tweakspanel" Grid.Row="1">
|
||||||
|
<!-- Your tweakspanel content goes here -->
|
||||||
</Grid>
|
</Grid>
|
||||||
<Border Grid.ColumnSpan="2" Grid.Row="2" Grid.Column="0">
|
|
||||||
<StackPanel Background="{MainBackgroundColor}" Orientation="Horizontal" HorizontalAlignment="Left">
|
<!-- TextBlock with note on the right half -->
|
||||||
<TextBlock Padding="10">
|
<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.
|
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!
|
<LineBreak/>Recommended selections are for normal users and if you are unsure do NOT check anything else!
|
||||||
</TextBlock>
|
</TextBlock>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</Border>
|
|
||||||
</Grid>
|
</Grid>
|
||||||
</ScrollViewer>
|
</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>
|
||||||
</TabItem>
|
</TabItem>
|
||||||
<TabItem Header="Config" Visibility="Collapsed" Name="WPFTab3">
|
<TabItem Header="Config" Visibility="Collapsed" Name="WPFTab3">
|
||||||
<ScrollViewer VerticalScrollBarVisibility="Auto">
|
<ScrollViewer VerticalScrollBarVisibility="Auto">
|
||||||
|
Loading…
Reference in New Issue
Block a user