mirror of
https://github.com/ChrisTitusTech/winutil.git
synced 2025-06-28 00:54:47 -05:00
[Microwin] Fix & Cleanup UI (#3426)
* hide MicrowinISOPanel on proceeding steps * fix textbox styling + remove Password text * MicroWinPanelToggling
This commit is contained in:
@ -472,7 +472,7 @@ public class PowerManagement {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$sync.MicrowinOptionsPanel.Visibility = 'Collapsed'
|
Toggle-MicrowinPanel 1
|
||||||
|
|
||||||
#$sync.MicrowinFinalIsoLocation.Text = "$env:temp\microwin.iso"
|
#$sync.MicrowinFinalIsoLocation.Text = "$env:temp\microwin.iso"
|
||||||
$sync.MicrowinFinalIsoLocation.Text = "$($SaveDialog.FileName)"
|
$sync.MicrowinFinalIsoLocation.Text = "$($SaveDialog.FileName)"
|
||||||
|
@ -276,7 +276,8 @@ function Invoke-MicrowinGetIso {
|
|||||||
Get-Volume $driveLetter | Get-DiskImage | Dismount-DiskImage
|
Get-Volume $driveLetter | Get-DiskImage | Dismount-DiskImage
|
||||||
Write-Host "Selected value '$($sync.MicrowinWindowsFlavors.SelectedValue)'....."
|
Write-Host "Selected value '$($sync.MicrowinWindowsFlavors.SelectedValue)'....."
|
||||||
|
|
||||||
$sync.MicrowinOptionsPanel.Visibility = 'Visible'
|
Toggle-MicrowinPanel 2
|
||||||
|
|
||||||
} catch {
|
} catch {
|
||||||
Write-Host "Dismounting bad image..."
|
Write-Host "Dismounting bad image..."
|
||||||
Get-Volume $driveLetter | Get-DiskImage | Dismount-DiskImage
|
Get-Volume $driveLetter | Get-DiskImage | Dismount-DiskImage
|
||||||
|
28
functions/microwin/Toggle-MicrowinPanel.ps1
Normal file
28
functions/microwin/Toggle-MicrowinPanel.ps1
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
function Toggle-MicrowinPanel {
|
||||||
|
<#
|
||||||
|
.SYNOPSIS
|
||||||
|
Toggles the visibility of the Microwin options and ISO panels in the GUI.
|
||||||
|
.DESCRIPTION
|
||||||
|
This function toggles the visibility of the Microwin options and ISO panels in the GUI.
|
||||||
|
.PARAMETER MicrowinOptionsPanel
|
||||||
|
The panel containing Microwin options.
|
||||||
|
.PARAMETER MicrowinISOPanel
|
||||||
|
The panel containing the Microwin ISO options.
|
||||||
|
.EXAMPLE
|
||||||
|
Toggle-MicrowinPanel 1
|
||||||
|
#>
|
||||||
|
param (
|
||||||
|
[Parameter(Mandatory = $true, Position = 0)]
|
||||||
|
[ValidateSet(1, 2)]
|
||||||
|
[int]$PanelNumber
|
||||||
|
)
|
||||||
|
|
||||||
|
if ($PanelNumber -eq 1) {
|
||||||
|
$sync.MicrowinISOPanel.Visibility = 'Visible'
|
||||||
|
$sync.MicrowinOptionsPanel.Visibility = 'Collapsed'
|
||||||
|
|
||||||
|
} elseif ($PanelNumber -eq 2) {
|
||||||
|
$sync.MicrowinOptionsPanel.Visibility = 'Visible'
|
||||||
|
$sync.MicrowinISOPanel.Visibility = 'Collapsed'
|
||||||
|
}
|
||||||
|
}
|
@ -62,5 +62,6 @@ function Invoke-WPFButton {
|
|||||||
"WPFWinUtilUninstallPSProfile" {Invoke-WinUtilUninstallPSProfile}
|
"WPFWinUtilUninstallPSProfile" {Invoke-WinUtilUninstallPSProfile}
|
||||||
"WPFWinUtilSSHServer" {Invoke-WPFSSHServer}
|
"WPFWinUtilSSHServer" {Invoke-WPFSSHServer}
|
||||||
"WPFselectedAppsButton" {$sync.selectedAppsPopup.IsOpen = -not $sync.selectedAppsPopup.IsOpen}
|
"WPFselectedAppsButton" {$sync.selectedAppsPopup.IsOpen = -not $sync.selectedAppsPopup.IsOpen}
|
||||||
|
"WPFMicrowinPanelBack" {Toggle-MicrowinPanel 1}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -801,6 +801,7 @@
|
|||||||
<Setter Property="HorizontalAlignment" Value="Stretch"/>
|
<Setter Property="HorizontalAlignment" Value="Stretch"/>
|
||||||
<Setter Property="VerticalAlignment" Value="Center"/>
|
<Setter Property="VerticalAlignment" Value="Center"/>
|
||||||
<Setter Property="HorizontalContentAlignment" Value="Stretch"/>
|
<Setter Property="HorizontalContentAlignment" Value="Stretch"/>
|
||||||
|
<Setter Property="CaretBrush" Value="{DynamicResource MainForegroundColor}"/>
|
||||||
<Setter Property="ContextMenu">
|
<Setter Property="ContextMenu">
|
||||||
<Setter.Value>
|
<Setter.Value>
|
||||||
<ContextMenu>
|
<ContextMenu>
|
||||||
@ -855,6 +856,7 @@
|
|||||||
<Setter Property="HorizontalAlignment" Value="Stretch"/>
|
<Setter Property="HorizontalAlignment" Value="Stretch"/>
|
||||||
<Setter Property="VerticalAlignment" Value="Center"/>
|
<Setter Property="VerticalAlignment" Value="Center"/>
|
||||||
<Setter Property="HorizontalContentAlignment" Value="Stretch"/>
|
<Setter Property="HorizontalContentAlignment" Value="Stretch"/>
|
||||||
|
<Setter Property="CaretBrush" Value="{DynamicResource MainForegroundColor}"/>
|
||||||
<Setter Property="Template">
|
<Setter Property="Template">
|
||||||
<Setter.Value>
|
<Setter.Value>
|
||||||
<ControlTemplate TargetType="PasswordBox">
|
<ControlTemplate TargetType="PasswordBox">
|
||||||
@ -1259,7 +1261,7 @@
|
|||||||
VerticalAlignment="Stretch"
|
VerticalAlignment="Stretch"
|
||||||
HorizontalAlignment="Stretch">
|
HorizontalAlignment="Stretch">
|
||||||
<StackPanel Name="MicrowinMain" Background="{DynamicResource MainBackgroundColor}" SnapsToDevicePixels="True" Grid.Column="0" Grid.Row="0">
|
<StackPanel Name="MicrowinMain" Background="{DynamicResource MainBackgroundColor}" SnapsToDevicePixels="True" Grid.Column="0" Grid.Row="0">
|
||||||
<StackPanel Background="Transparent" SnapsToDevicePixels="True" Margin="1">
|
<StackPanel Name="MicrowinISOPanel" Background="Transparent" SnapsToDevicePixels="True" Margin="1">
|
||||||
<CheckBox x:Name="WPFMicrowinDownloadFromGitHub" Content="Download oscdimg.exe from CTT Github repo" IsChecked="True" Margin="{DynamicResource MicrowinCheckBoxMargin}" />
|
<CheckBox x:Name="WPFMicrowinDownloadFromGitHub" Content="Download oscdimg.exe from CTT Github repo" IsChecked="True" Margin="{DynamicResource MicrowinCheckBoxMargin}" />
|
||||||
<TextBlock Margin="5" Padding="1" TextWrapping="Wrap" Foreground="{DynamicResource ComboBoxForegroundColor}">
|
<TextBlock Margin="5" Padding="1" TextWrapping="Wrap" Foreground="{DynamicResource ComboBoxForegroundColor}">
|
||||||
Choose a Windows ISO file that you've downloaded <LineBreak/>
|
Choose a Windows ISO file that you've downloaded <LineBreak/>
|
||||||
@ -1314,8 +1316,46 @@
|
|||||||
</Button.Content>
|
</Button.Content>
|
||||||
</Button>
|
</Button>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
|
|
||||||
<!-- Visibility="Hidden" -->
|
<!-- Visibility="Hidden" -->
|
||||||
<StackPanel Name="MicrowinOptionsPanel" HorizontalAlignment="Left" SnapsToDevicePixels="True" Margin="1" Visibility="Hidden">
|
<StackPanel Name="MicrowinOptionsPanel" HorizontalAlignment="Left" SnapsToDevicePixels="True" Margin="1" Visibility="Hidden">
|
||||||
|
<Grid Margin="0,0,0,10">
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="Auto"/>
|
||||||
|
<ColumnDefinition Width="*"/>
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
|
||||||
|
<Button Name="WPFMicrowinPanelBack"
|
||||||
|
Grid.Column="0"
|
||||||
|
Width="30" Height="30"
|
||||||
|
HorizontalAlignment="Left"
|
||||||
|
FontFamily="Segoe MDL2 Assets"
|
||||||
|
FontSize="12"
|
||||||
|
Content=""
|
||||||
|
ToolTip="Back to main view"
|
||||||
|
Background="{DynamicResource ButtonBackgroundColor}"
|
||||||
|
Foreground="{DynamicResource ButtonForegroundColor}"
|
||||||
|
BorderBrush="{DynamicResource ButtonBackgroundColor}"
|
||||||
|
BorderThickness="1"
|
||||||
|
Padding="0">
|
||||||
|
<Button.ContentTemplate>
|
||||||
|
<DataTemplate>
|
||||||
|
<TextBlock Text="{Binding}"
|
||||||
|
HorizontalAlignment="Center"
|
||||||
|
VerticalAlignment="Center"/>
|
||||||
|
</DataTemplate>
|
||||||
|
</Button.ContentTemplate>
|
||||||
|
</Button>
|
||||||
|
|
||||||
|
<TextBlock Name="MicrowinPanel2Title"
|
||||||
|
Grid.Column="1"
|
||||||
|
Text="Configure Windows ISO"
|
||||||
|
Margin="10,0,0,0"
|
||||||
|
Foreground="{DynamicResource MainForegroundColor}"
|
||||||
|
FontSize="16"
|
||||||
|
VerticalAlignment="Center"/>
|
||||||
|
</Grid>
|
||||||
|
|
||||||
<TextBlock Margin="6" Padding="1" TextWrapping="Wrap">Choose Windows SKU</TextBlock>
|
<TextBlock Margin="6" Padding="1" TextWrapping="Wrap">Choose Windows SKU</TextBlock>
|
||||||
<ComboBox x:Name = "MicrowinWindowsFlavors" Margin="1" />
|
<ComboBox x:Name = "MicrowinWindowsFlavors" Margin="1" />
|
||||||
<Rectangle Fill="{DynamicResource MainForegroundColor}" Height="2" HorizontalAlignment="Stretch" Margin="0,10,0,10"/>
|
<Rectangle Fill="{DynamicResource MainForegroundColor}" Height="2" HorizontalAlignment="Stretch" Margin="0,10,0,10"/>
|
||||||
@ -1343,7 +1383,7 @@
|
|||||||
Foreground="{DynamicResource LabelboxForegroundColor}"
|
Foreground="{DynamicResource LabelboxForegroundColor}"
|
||||||
MaxLength="20"
|
MaxLength="20"
|
||||||
/>
|
/>
|
||||||
<TextBlock Margin="6" Padding="1" TextWrapping="Wrap">Password (characters will not be shown for your security):</TextBlock>
|
<TextBlock Margin="6" Padding="1" TextWrapping="Wrap">Password:</TextBlock>
|
||||||
<PasswordBox Name="MicrowinUserPassword" Background="Transparent" BorderThickness="1" BorderBrush="{DynamicResource MainForegroundColor}"
|
<PasswordBox Name="MicrowinUserPassword" Background="Transparent" BorderThickness="1" BorderBrush="{DynamicResource MainForegroundColor}"
|
||||||
Margin="6"
|
Margin="6"
|
||||||
PasswordChar="*"
|
PasswordChar="*"
|
||||||
|
Reference in New Issue
Block a user