`UI/refactor`: organize panels into new tabs

- This hides the overflow of stuff before into each tab
- Put Enable/Disable Photo Viewer on Customize Tweaks
- Add 'BSnes HD' and 'Voicemod' downloads
- Reposition all softwares on Software Install section (new tab)

`misc`: fix output
- Use Write-Status over Write-Host on opt-privacy
- Fix blank space on opt-security output
main
Plínio Larrubia 2 years ago committed by Plínio Larrubia
parent 00512d4fe2
commit 67a81d6840
No known key found for this signature in database
GPG Key ID: 057B0A87CB137C69

@ -118,6 +118,7 @@ Set-ExecutionPolicy Unrestricted -Scope CurrentUser -Force; ls -Recurse *.ps*1 |
- `Enable/Disable Cortana`: [Enables](./src/utils/enable-cortana.reg) or [Disables](src/utils/disable-cortana.reg) the **Cortana**;
- `Enable/Disable Clipboard History`: [Enables](./src/utils/enable-clipboard-history.reg) or [Disables](src/utils/disable-clipboard-history.reg) the **Clipboard History**;
- `Enable/Disable Old Volume Control`: [Enables](./src/utils/enable-old-volume-control.reg) or [Disables](src/utils/disable-old-volume-control.reg) the **Old Volume Control (Win 7/8.1)**;
- `Enable/Disable Photo Viewer`: [Enables](./src/utils/enable-photo-viewer.reg) or [Disables](src/utils/disable-photo-viewer.reg) the **Photo Viewer (Win 7/8.1)**;
- `Enable/Disable Search Indexing`: [Enables](./src/utils/enable-search-idx.ps1) or [Disables](src/utils/disable-search-idx.ps1) the **Windows Search Service**;
- `Enable/Disable Telemetry`: [Enables](./src/utils/enable-telemetry.reg) or [Disables](src/utils/disable-telemetry.reg) the **Windows Telemetry**;
- `Enable/Disable Xbox GameBar/DVR`: [Enables](./src/utils/enable-game-bar-dvr.reg) or [Disables](src/utils/disable-game-bar-dvr.reg) the **Xbox GameBar/DVR (In-Game)**;

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 MiB

After

Width:  |  Height:  |  Size: 457 KiB

@ -3,6 +3,7 @@ Import-Module -DisableNameChecking $PSScriptRoot\..\lib\"title-templates.psm1"
function Install-Software() {
[CmdletBinding()]
[OutputType([String])]
param (
[String] $Name,
[Array] $Packages,
@ -58,10 +59,13 @@ function Install-Software() {
If (!($NoDialog)) {
Show-Message -Title "$DoneTitle" -Message "$DoneMessage"
}
return $DoneMessage
}
function Uninstall-Software() {
[CmdletBinding()]
[OutputType([String])]
param (
[String] $Name,
[Array] $Packages,
@ -117,6 +121,8 @@ function Uninstall-Software() {
If (!($NoDialog)) {
Show-Message -Title "$DoneTitle" -Message "$DoneMessage"
}
return $DoneMessage
}
<#

@ -1,7 +1,13 @@
Import-Module -DisableNameChecking $PSScriptRoot\..\lib\"title-templates.psm1"
Add-Type -AssemblyName System.Windows.Forms
Add-Type -AssemblyName System.Drawing
[System.Windows.Forms.Application]::EnableVisualStyles() # Rounded Buttons :3
# Adapted from: https://stackoverflow.com/a/35965782
# Adapted from: https://www.osdeploy.com/modules/pshot/technical/resolution-scale-and-dpi
# Adapted from: https://stackoverflow.com/a/53377253
# Adapted from: https://stackoverflow.com/a/68296985
function Get-CurrentResolution {
[CmdletBinding()]
@ -12,7 +18,6 @@ function Get-CurrentResolution {
$ScreenHeight = $null
# Accepts Scaling/DPI
Add-Type -AssemblyName System.Windows.Forms
$DisplayInfo = [System.Windows.Forms.SystemInformation]::VirtualScreen
$ScreenWidth = $DisplayInfo.Width
$ScreenHeight = $DisplayInfo.Height
@ -126,7 +131,7 @@ function New-Form() {
[Int] $Width,
[Int] $Height,
[String] $Text,
[String] $BackColor,
[String] $BackColor = "#252525", # Windows Dark
[Bool] $Minimize = $true,
[Bool] $Maximize = $true,
[String] $FormBorderStyle = 'FixedSingle', # FixedSingle, Fixed3D, FixedDialog, Sizable, FixedToolWindow, SizableToolWindow
@ -156,7 +161,6 @@ function New-FormIcon() {
[String] $ImageLocation
)
# Adapted from: https://stackoverflow.com/a/53377253
Write-Verbose "FormIcon: IL $ImageLocation"
$IconBase64 = [Convert]::ToBase64String((Get-Content $ImageLocation -Encoding Byte))
$IconBytes = [Convert]::FromBase64String($IconBase64)
@ -168,6 +172,50 @@ function New-FormIcon() {
return $Form
}
function New-TabControl() {
[CmdletBinding()]
[OutputType([System.Windows.Forms.TabControl])]
param (
[Int] $Width,
[Int] $Height,
[Int] $LocationX,
[Int] $LocationY,
[String] $ForeColor = "#FFFFFF", # White
[String] $BackColor = "#252525" # Windows Dark
)
$FormTabControl = New-object System.Windows.Forms.TabControl
$FormTabControl.Size = "$Width,$Height"
$FormTabControl.Location = "$LocationX,$LocationY"
$FormTabControl.ForeColor = [System.Drawing.ColorTranslator]::FromHtml($ForeColor)
$FormTabControl.BackColor = [System.Drawing.ColorTranslator]::FromHtml($BackColor)
return $FormTabControl
}
function New-TabPage() {
[CmdletBinding()]
[OutputType([System.Windows.Forms.Form])]
param (
[String] $Name,
[String] $Text,
[String] $ForeColor = "#FFFFFF", # White
[String] $BackColor = "#252525" # Windows Dark
)
$FormTabPage = New-object System.Windows.Forms.TabPage
$FormTabPage.DataBindings.DefaultDataSourceUpdateMode = 0
$FormTabPage.UseVisualStyleBackColor = $True
$FormTabPage.Name = $Name
$FormTabPage.Text = $Text
$FormTabPage.ForeColor = [System.Drawing.ColorTranslator]::FromHtml($ForeColor)
$FormTabPage.BackColor = [System.Drawing.ColorTranslator]::FromHtml($BackColor)
$FormTabPage.AutoScroll = $True
return $FormTabPage
}
function New-Panel() {
[CmdletBinding()]
param (

@ -337,11 +337,10 @@ function Optimize-Privacy() {
ForEach ($Key in $KeysToDelete) {
If ((Test-Path $Key)) {
Write-Host "[Privacy] Removing Key: [$Key]"
Write-Status -Symbol '-' -Type $TweakType -Status "Removing Key: [$Key]"
Remove-Item $Key -Recurse
}
}
}
function Main() {

@ -25,7 +25,7 @@ function Optimize-Security() {
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows Defender" -Name "DisableAntiSpyware" -Type DWORD -Value 0 -Force
Set-MpPreference -DisableRealtimeMonitoring $false -Force
Write-Status -Symbol "+" -Type $TweakType -Status " Enabling Microsoft Defender Exploit Guard network protection..."
Write-Status -Symbol "+" -Type $TweakType -Status "Enabling Microsoft Defender Exploit Guard network protection..."
Set-MpPreference -EnableNetworkProtection Enabled -Force
Write-Status -Symbol "+" -Type $TweakType -Status "Enabling detection for potentially unwanted applications and block them..."

Loading…
Cancel
Save