mirror of
https://github.com/ChrisTitusTech/winutil.git
synced 2025-07-01 18:42:35 -05:00
Compare commits
4 Commits
24.11.11
...
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"}
|
||||
"WPFGetIso" {Invoke-WPFGetIso}
|
||||
"WPFMicrowin" {Invoke-WPFMicrowin}
|
||||
"WPFMinimizeButton" {Invoke-WPFMinimizeButton}
|
||||
"WPFMaximizeButton" {Invoke-WPFMaximizeButton}
|
||||
"WPFCloseButton" {Invoke-WPFCloseButton}
|
||||
"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
|
||||
Runspace Author: @DeveloperDurp
|
||||
GitHub : https://github.com/ChrisTitusTech
|
||||
Version : 24.02.12
|
||||
#>
|
||||
param (
|
||||
[switch]$Debug,
|
||||
@ -47,7 +46,6 @@ Add-Type -AssemblyName System.Windows.Forms
|
||||
# Variable to sync between runspaces
|
||||
$sync = [Hashtable]::Synchronized(@{})
|
||||
$sync.PSScriptRoot = $PSScriptRoot
|
||||
$sync.version = "24.02.12"
|
||||
$sync.configs = @{}
|
||||
$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
|
||||
|
||||
}
|
||||
function Invoke-WPFMinimizeButton {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Minimize the application window
|
||||
#>
|
||||
$sync["Form"].WindowState = [System.Windows.WindowState]::Minimized
|
||||
}
|
||||
|
||||
function Invoke-ScratchDialog {
|
||||
|
||||
@ -2419,6 +2424,8 @@ function Invoke-WPFButton {
|
||||
"WPFGetInstalledTweaks" {Invoke-WPFGetInstalled -CheckBox "tweaks"}
|
||||
"WPFGetIso" {Invoke-WPFGetIso}
|
||||
"WPFMicrowin" {Invoke-WPFMicrowin}
|
||||
"WPFMinimizeButton" {Invoke-WPFMinimizeButton}
|
||||
"WPFMaximizeButton" {Invoke-WPFMaximizeButton}
|
||||
"WPFCloseButton" {Invoke-WPFCloseButton}
|
||||
"MicrowinScratchDirBT" {Invoke-ScratchDialog}
|
||||
}
|
||||
@ -3243,6 +3250,17 @@ function Invoke-WPFInstallUpgrade {
|
||||
Write-Host "-- You can close this window if desired ---"
|
||||
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 {
|
||||
<#
|
||||
.DESCRIPTION
|
||||
@ -4463,6 +4481,7 @@ $inputXML = '<Window x:Class="WinUtility.MainWindow"
|
||||
Background="{MainBackgroundColor}"
|
||||
WindowStartupLocation="CenterScreen"
|
||||
WindowStyle="None"
|
||||
Name="MainWindow"
|
||||
Title="Chris Titus Tech''s Windows Utility" Height="800" Width="1280">
|
||||
<WindowChrome.WindowChrome>
|
||||
<WindowChrome CaptionHeight="0" CornerRadius="10"/>
|
||||
@ -4708,13 +4727,13 @@ $inputXML = '<Window x:Class="WinUtility.MainWindow"
|
||||
<Trigger Property="IsPressed" Value="True">
|
||||
<Setter TargetName="BackgroundBorder" Property="Background" Value="{ButtonBackgroundPressedColor}"/>
|
||||
</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}"/>
|
||||
</Trigger>
|
||||
<Trigger Property="IsEnabled" Value="False">
|
||||
<Setter TargetName="BackgroundBorder" Property="Background" Value="{ButtonBackgroundSelectedColor}"/>
|
||||
<Setter Property="Foreground" Value="DimGray"/>
|
||||
</Trigger>
|
||||
</MultiTrigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
@ -5074,6 +5093,8 @@ $inputXML = '<Window x:Class="WinUtility.MainWindow"
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="50px"/>
|
||||
<ColumnDefinition Width="50px"/>
|
||||
<ColumnDefinition Width="50px"/>
|
||||
<ColumnDefinition Width="50px"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<TextBox
|
||||
@ -5124,6 +5145,26 @@ $inputXML = '<Window x:Class="WinUtility.MainWindow"
|
||||
|
||||
<Button
|
||||
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"
|
||||
BorderBrush="Transparent"
|
||||
Background="{MainBackgroundColor}"
|
||||
|
@ -8,6 +8,7 @@
|
||||
Background="{MainBackgroundColor}"
|
||||
WindowStartupLocation="CenterScreen"
|
||||
WindowStyle="None"
|
||||
Name="MainWindow"
|
||||
Title="Chris Titus Tech's Windows Utility" Height="800" Width="1280">
|
||||
<WindowChrome.WindowChrome>
|
||||
<WindowChrome CaptionHeight="0" CornerRadius="10"/>
|
||||
@ -253,13 +254,13 @@
|
||||
<Trigger Property="IsPressed" Value="True">
|
||||
<Setter TargetName="BackgroundBorder" Property="Background" Value="{ButtonBackgroundPressedColor}"/>
|
||||
</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}"/>
|
||||
</Trigger>
|
||||
<Trigger Property="IsEnabled" Value="False">
|
||||
<Setter TargetName="BackgroundBorder" Property="Background" Value="{ButtonBackgroundSelectedColor}"/>
|
||||
<Setter Property="Foreground" Value="DimGray"/>
|
||||
</Trigger>
|
||||
</MultiTrigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
@ -619,6 +620,8 @@
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="50px"/>
|
||||
<ColumnDefinition Width="50px"/>
|
||||
<ColumnDefinition Width="50px"/>
|
||||
<ColumnDefinition Width="50px"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<TextBox
|
||||
@ -669,6 +672,26 @@
|
||||
|
||||
<Button
|
||||
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"
|
||||
BorderBrush="Transparent"
|
||||
Background="{MainBackgroundColor}"
|
||||
|
Reference in New Issue
Block a user