mirror of
https://github.com/ChrisTitusTech/winutil.git
synced 2025-07-02 19:13:30 -05:00
Compare commits
4 Commits
25.05.23
...
8db7d8e974
Author | SHA1 | Date | |
---|---|---|---|
8db7d8e974 | |||
6f09367ff1 | |||
dfd2125cba | |||
9b87edc10b |
7
functions/public/Invoke-MinimizeButton.ps1
Normal file
7
functions/public/Invoke-MinimizeButton.ps1
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
function Invoke-WPFMinimizeButton {
|
||||||
|
<#
|
||||||
|
.SYNOPSIS
|
||||||
|
Minimize the application window
|
||||||
|
#>
|
||||||
|
$sync["Form"].WindowState = [System.Windows.WindowState]::Minimized
|
||||||
|
}
|
@ -52,6 +52,8 @@ function Invoke-WPFButton {
|
|||||||
"WPFGetInstalledTweaks" {Invoke-WPFGetInstalled -CheckBox "tweaks"}
|
"WPFGetInstalledTweaks" {Invoke-WPFGetInstalled -CheckBox "tweaks"}
|
||||||
"WPFGetIso" {Invoke-WPFGetIso}
|
"WPFGetIso" {Invoke-WPFGetIso}
|
||||||
"WPFMicrowin" {Invoke-WPFMicrowin}
|
"WPFMicrowin" {Invoke-WPFMicrowin}
|
||||||
|
"WPFMinimizeButton" {Invoke-WPFMinimizeButton}
|
||||||
|
"WPFMaximizeButton" {Invoke-WPFMaximizeButton}
|
||||||
"WPFCloseButton" {Invoke-WPFCloseButton}
|
"WPFCloseButton" {Invoke-WPFCloseButton}
|
||||||
"MicrowinScratchDirBT" {Invoke-ScratchDialog}
|
"MicrowinScratchDirBT" {Invoke-ScratchDialog}
|
||||||
}
|
}
|
||||||
|
11
functions/public/Invoke-WPFMaximizeButton.ps1
Normal file
11
functions/public/Invoke-WPFMaximizeButton.ps1
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
function Invoke-WPFMaximizeButton {
|
||||||
|
<#
|
||||||
|
.SYNOPSIS
|
||||||
|
Alternates between Maximized and Minimized window
|
||||||
|
#>
|
||||||
|
if ($sync["Form"].WindowState -eq [System.Windows.WindowState]::Maximized) {
|
||||||
|
$sync["Form"].WindowState = [System.Windows.WindowState]::Normal
|
||||||
|
} else {
|
||||||
|
$sync["Form"].WindowState = [System.Windows.WindowState]::Maximized
|
||||||
|
}
|
||||||
|
}
|
57
winutil.ps1
57
winutil.ps1
@ -10,7 +10,6 @@
|
|||||||
Author : Chris Titus @christitustech
|
Author : Chris Titus @christitustech
|
||||||
Runspace Author: @DeveloperDurp
|
Runspace Author: @DeveloperDurp
|
||||||
GitHub : https://github.com/ChrisTitusTech
|
GitHub : https://github.com/ChrisTitusTech
|
||||||
Version : 24.02.12
|
|
||||||
#>
|
#>
|
||||||
param (
|
param (
|
||||||
[switch]$Debug,
|
[switch]$Debug,
|
||||||
@ -47,7 +46,6 @@ Add-Type -AssemblyName System.Windows.Forms
|
|||||||
# Variable to sync between runspaces
|
# Variable to sync between runspaces
|
||||||
$sync = [Hashtable]::Synchronized(@{})
|
$sync = [Hashtable]::Synchronized(@{})
|
||||||
$sync.PSScriptRoot = $PSScriptRoot
|
$sync.PSScriptRoot = $PSScriptRoot
|
||||||
$sync.version = "24.02.12"
|
|
||||||
$sync.configs = @{}
|
$sync.configs = @{}
|
||||||
$sync.ProcessRunning = $false
|
$sync.ProcessRunning = $false
|
||||||
|
|
||||||
@ -2336,6 +2334,13 @@ Function Update-WinUtilProgramWinget {
|
|||||||
$global:WinGetInstall = Start-Process -Verb runas powershell -ArgumentList "-command invoke-command -scriptblock {$wingetinstall} -argumentlist '$($ProgramsToInstall -join ",")'" -PassThru
|
$global:WinGetInstall = Start-Process -Verb runas powershell -ArgumentList "-command invoke-command -scriptblock {$wingetinstall} -argumentlist '$($ProgramsToInstall -join ",")'" -PassThru
|
||||||
|
|
||||||
}
|
}
|
||||||
|
function Invoke-WPFMinimizeButton {
|
||||||
|
<#
|
||||||
|
.SYNOPSIS
|
||||||
|
Minimize the application window
|
||||||
|
#>
|
||||||
|
$sync["Form"].WindowState = [System.Windows.WindowState]::Minimized
|
||||||
|
}
|
||||||
|
|
||||||
function Invoke-ScratchDialog {
|
function Invoke-ScratchDialog {
|
||||||
|
|
||||||
@ -2419,6 +2424,8 @@ function Invoke-WPFButton {
|
|||||||
"WPFGetInstalledTweaks" {Invoke-WPFGetInstalled -CheckBox "tweaks"}
|
"WPFGetInstalledTweaks" {Invoke-WPFGetInstalled -CheckBox "tweaks"}
|
||||||
"WPFGetIso" {Invoke-WPFGetIso}
|
"WPFGetIso" {Invoke-WPFGetIso}
|
||||||
"WPFMicrowin" {Invoke-WPFMicrowin}
|
"WPFMicrowin" {Invoke-WPFMicrowin}
|
||||||
|
"WPFMinimizeButton" {Invoke-WPFMinimizeButton}
|
||||||
|
"WPFMaximizeButton" {Invoke-WPFMaximizeButton}
|
||||||
"WPFCloseButton" {Invoke-WPFCloseButton}
|
"WPFCloseButton" {Invoke-WPFCloseButton}
|
||||||
"MicrowinScratchDirBT" {Invoke-ScratchDialog}
|
"MicrowinScratchDirBT" {Invoke-ScratchDialog}
|
||||||
}
|
}
|
||||||
@ -3243,6 +3250,17 @@ function Invoke-WPFInstallUpgrade {
|
|||||||
Write-Host "-- You can close this window if desired ---"
|
Write-Host "-- You can close this window if desired ---"
|
||||||
Write-Host "==========================================="
|
Write-Host "==========================================="
|
||||||
}
|
}
|
||||||
|
function Invoke-WPFMaximizeButton {
|
||||||
|
<#
|
||||||
|
.SYNOPSIS
|
||||||
|
Alternates between Maximized and Minimized window
|
||||||
|
#>
|
||||||
|
if ($sync["Form"].WindowState -eq [System.Windows.WindowState]::Maximized) {
|
||||||
|
$sync["Form"].WindowState = [System.Windows.WindowState]::Normal
|
||||||
|
} else {
|
||||||
|
$sync["Form"].WindowState = [System.Windows.WindowState]::Maximized
|
||||||
|
}
|
||||||
|
}
|
||||||
function Invoke-WPFMicrowin {
|
function Invoke-WPFMicrowin {
|
||||||
<#
|
<#
|
||||||
.DESCRIPTION
|
.DESCRIPTION
|
||||||
@ -4463,6 +4481,7 @@ $inputXML = '<Window x:Class="WinUtility.MainWindow"
|
|||||||
Background="{MainBackgroundColor}"
|
Background="{MainBackgroundColor}"
|
||||||
WindowStartupLocation="CenterScreen"
|
WindowStartupLocation="CenterScreen"
|
||||||
WindowStyle="None"
|
WindowStyle="None"
|
||||||
|
Name="MainWindow"
|
||||||
Title="Chris Titus Tech''s Windows Utility" Height="800" Width="1280">
|
Title="Chris Titus Tech''s Windows Utility" Height="800" Width="1280">
|
||||||
<WindowChrome.WindowChrome>
|
<WindowChrome.WindowChrome>
|
||||||
<WindowChrome CaptionHeight="0" CornerRadius="10"/>
|
<WindowChrome CaptionHeight="0" CornerRadius="10"/>
|
||||||
@ -4708,13 +4727,13 @@ $inputXML = '<Window x:Class="WinUtility.MainWindow"
|
|||||||
<Trigger Property="IsPressed" Value="True">
|
<Trigger Property="IsPressed" Value="True">
|
||||||
<Setter TargetName="BackgroundBorder" Property="Background" Value="{ButtonBackgroundPressedColor}"/>
|
<Setter TargetName="BackgroundBorder" Property="Background" Value="{ButtonBackgroundPressedColor}"/>
|
||||||
</Trigger>
|
</Trigger>
|
||||||
<Trigger Property="IsMouseOver" Value="True">
|
<MultiTrigger>
|
||||||
|
<MultiTrigger.Conditions>
|
||||||
|
<Condition Property="IsMouseOver" Value="True"/>
|
||||||
|
<Condition Property="IsPressed" Value="False"/>
|
||||||
|
</MultiTrigger.Conditions>
|
||||||
<Setter TargetName="BackgroundBorder" Property="Background" Value="{ButtonBackgroundMouseoverColor}"/>
|
<Setter TargetName="BackgroundBorder" Property="Background" Value="{ButtonBackgroundMouseoverColor}"/>
|
||||||
</Trigger>
|
</MultiTrigger>
|
||||||
<Trigger Property="IsEnabled" Value="False">
|
|
||||||
<Setter TargetName="BackgroundBorder" Property="Background" Value="{ButtonBackgroundSelectedColor}"/>
|
|
||||||
<Setter Property="Foreground" Value="DimGray"/>
|
|
||||||
</Trigger>
|
|
||||||
</ControlTemplate.Triggers>
|
</ControlTemplate.Triggers>
|
||||||
</ControlTemplate>
|
</ControlTemplate>
|
||||||
</Setter.Value>
|
</Setter.Value>
|
||||||
@ -5074,6 +5093,8 @@ $inputXML = '<Window x:Class="WinUtility.MainWindow"
|
|||||||
<ColumnDefinition Width="*"/>
|
<ColumnDefinition Width="*"/>
|
||||||
<ColumnDefinition Width="50px"/>
|
<ColumnDefinition Width="50px"/>
|
||||||
<ColumnDefinition Width="50px"/>
|
<ColumnDefinition Width="50px"/>
|
||||||
|
<ColumnDefinition Width="50px"/>
|
||||||
|
<ColumnDefinition Width="50px"/>
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
|
|
||||||
<TextBox
|
<TextBox
|
||||||
@ -5124,6 +5145,26 @@ $inputXML = '<Window x:Class="WinUtility.MainWindow"
|
|||||||
|
|
||||||
<Button
|
<Button
|
||||||
Grid.Column="2"
|
Grid.Column="2"
|
||||||
|
Content="-" BorderThickness="0"
|
||||||
|
BorderBrush="Transparent"
|
||||||
|
Background="{MainBackgroundColor}"
|
||||||
|
Width="35" Height="35"
|
||||||
|
HorizontalAlignment="Right" VerticalAlignment="Top"
|
||||||
|
Margin="0,5,5,0"
|
||||||
|
FontFamily="Arial"
|
||||||
|
Foreground="{MainForegroundColor}" FontSize="18" Name="WPFMinimizeButton" />
|
||||||
|
<Button
|
||||||
|
Grid.Column="3"
|
||||||
|
Content="□" BorderThickness="0"
|
||||||
|
BorderBrush="Transparent"
|
||||||
|
Background="{MainBackgroundColor}"
|
||||||
|
Width="35" Height="35"
|
||||||
|
HorizontalAlignment="Right" VerticalAlignment="Top"
|
||||||
|
Margin="0,5,5,0"
|
||||||
|
FontFamily="Arial"
|
||||||
|
Foreground="{MainForegroundColor}" FontSize="18" Name="WPFMaximizeButton" />
|
||||||
|
<Button
|
||||||
|
Grid.Column="4"
|
||||||
Content="×" BorderThickness="0"
|
Content="×" BorderThickness="0"
|
||||||
BorderBrush="Transparent"
|
BorderBrush="Transparent"
|
||||||
Background="{MainBackgroundColor}"
|
Background="{MainBackgroundColor}"
|
||||||
|
@ -8,6 +8,7 @@
|
|||||||
Background="{MainBackgroundColor}"
|
Background="{MainBackgroundColor}"
|
||||||
WindowStartupLocation="CenterScreen"
|
WindowStartupLocation="CenterScreen"
|
||||||
WindowStyle="None"
|
WindowStyle="None"
|
||||||
|
Name="MainWindow"
|
||||||
Title="Chris Titus Tech's Windows Utility" Height="800" Width="1280">
|
Title="Chris Titus Tech's Windows Utility" Height="800" Width="1280">
|
||||||
<WindowChrome.WindowChrome>
|
<WindowChrome.WindowChrome>
|
||||||
<WindowChrome CaptionHeight="0" CornerRadius="10"/>
|
<WindowChrome CaptionHeight="0" CornerRadius="10"/>
|
||||||
@ -253,13 +254,13 @@
|
|||||||
<Trigger Property="IsPressed" Value="True">
|
<Trigger Property="IsPressed" Value="True">
|
||||||
<Setter TargetName="BackgroundBorder" Property="Background" Value="{ButtonBackgroundPressedColor}"/>
|
<Setter TargetName="BackgroundBorder" Property="Background" Value="{ButtonBackgroundPressedColor}"/>
|
||||||
</Trigger>
|
</Trigger>
|
||||||
<Trigger Property="IsMouseOver" Value="True">
|
<MultiTrigger>
|
||||||
|
<MultiTrigger.Conditions>
|
||||||
|
<Condition Property="IsMouseOver" Value="True"/>
|
||||||
|
<Condition Property="IsPressed" Value="False"/>
|
||||||
|
</MultiTrigger.Conditions>
|
||||||
<Setter TargetName="BackgroundBorder" Property="Background" Value="{ButtonBackgroundMouseoverColor}"/>
|
<Setter TargetName="BackgroundBorder" Property="Background" Value="{ButtonBackgroundMouseoverColor}"/>
|
||||||
</Trigger>
|
</MultiTrigger>
|
||||||
<Trigger Property="IsEnabled" Value="False">
|
|
||||||
<Setter TargetName="BackgroundBorder" Property="Background" Value="{ButtonBackgroundSelectedColor}"/>
|
|
||||||
<Setter Property="Foreground" Value="DimGray"/>
|
|
||||||
</Trigger>
|
|
||||||
</ControlTemplate.Triggers>
|
</ControlTemplate.Triggers>
|
||||||
</ControlTemplate>
|
</ControlTemplate>
|
||||||
</Setter.Value>
|
</Setter.Value>
|
||||||
@ -619,6 +620,8 @@
|
|||||||
<ColumnDefinition Width="*"/>
|
<ColumnDefinition Width="*"/>
|
||||||
<ColumnDefinition Width="50px"/>
|
<ColumnDefinition Width="50px"/>
|
||||||
<ColumnDefinition Width="50px"/>
|
<ColumnDefinition Width="50px"/>
|
||||||
|
<ColumnDefinition Width="50px"/>
|
||||||
|
<ColumnDefinition Width="50px"/>
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
|
|
||||||
<TextBox
|
<TextBox
|
||||||
@ -669,6 +672,26 @@
|
|||||||
|
|
||||||
<Button
|
<Button
|
||||||
Grid.Column="2"
|
Grid.Column="2"
|
||||||
|
Content="-" BorderThickness="0"
|
||||||
|
BorderBrush="Transparent"
|
||||||
|
Background="{MainBackgroundColor}"
|
||||||
|
Width="35" Height="35"
|
||||||
|
HorizontalAlignment="Right" VerticalAlignment="Top"
|
||||||
|
Margin="0,5,5,0"
|
||||||
|
FontFamily="Arial"
|
||||||
|
Foreground="{MainForegroundColor}" FontSize="18" Name="WPFMinimizeButton" />
|
||||||
|
<Button
|
||||||
|
Grid.Column="3"
|
||||||
|
Content="□" BorderThickness="0"
|
||||||
|
BorderBrush="Transparent"
|
||||||
|
Background="{MainBackgroundColor}"
|
||||||
|
Width="35" Height="35"
|
||||||
|
HorizontalAlignment="Right" VerticalAlignment="Top"
|
||||||
|
Margin="0,5,5,0"
|
||||||
|
FontFamily="Arial"
|
||||||
|
Foreground="{MainForegroundColor}" FontSize="18" Name="WPFMaximizeButton" />
|
||||||
|
<Button
|
||||||
|
Grid.Column="4"
|
||||||
Content="×" BorderThickness="0"
|
Content="×" BorderThickness="0"
|
||||||
BorderBrush="Transparent"
|
BorderBrush="Transparent"
|
||||||
Background="{MainBackgroundColor}"
|
Background="{MainBackgroundColor}"
|
||||||
|
Reference in New Issue
Block a user