Reconstructed the whole Window Layout

This commit is contained in:
HorizonCode 2021-05-27 10:02:42 +02:00
parent 2ca4f8beb4
commit d71f0d38fc
2 changed files with 24 additions and 17 deletions

View File

@ -5,19 +5,20 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:EZPPClient_Installer" xmlns:local="clr-namespace:EZPPClient_Installer"
mc:Ignorable="d" mc:Ignorable="d"
Title="EZPPClient Installer" Height="237.051" Width="525.487" Title="EZPPClient Installer" Height="293.333" Width="525"
xmlns:ui="http://schemas.modernwpf.com/2019" xmlns:ui="http://schemas.modernwpf.com/2019"
ui:WindowHelper.UseModernWindowStyle="True" ResizeMode="CanMinimize" Icon="circle_new.ico" Topmost="True" WindowStartupLocation="CenterScreen"> ui:WindowHelper.UseModernWindowStyle="True" ResizeMode="CanMinimize" Icon="circle_new.ico" Topmost="True" WindowStartupLocation="CenterScreen">
<ui:SimpleStackPanel Margin="12" Spacing="24"> <ui:SimpleStackPanel Margin="12" Spacing="24">
<CheckBox x:Name="linkFoldersCheckbox" Content="Link Song and Skins Folder" HorizontalAlignment="Stretch" Height="32" VerticalAlignment="Top" Margin="150,62,150,-62" IsChecked="True" /> <CheckBox x:Name="linkFoldersCheckbox" Content="Link Song and Skins Folder" HorizontalAlignment="Stretch" Height="32" VerticalAlignment="Top" Margin="150,125,150,-125" IsChecked="True" />
<TextBox x:Name="folderTextbox" HorizontalAlignment="Left" Height="32" TextWrapping="Wrap" Text="" VerticalAlignment="Top" Width="422" Margin="10,-34,0,0" IsReadOnly="true"/> <TextBox x:Name="folderTextbox" HorizontalAlignment="Left" Height="32" TextWrapping="Wrap" Text="" VerticalAlignment="Top" Width="422" Margin="10,-27,0,-5" IsReadOnly="true"/>
<Button x:Name="InstallButton" Content="Install" HorizontalAlignment="Stretch" Height="32" VerticalAlignment="Bottom" Margin="176,0,176,-58" Style="{StaticResource AccentButtonStyle}" Click="Install_Click"/> <Button x:Name="InstallButton" Content="Install" HorizontalAlignment="Stretch" Height="32" VerticalAlignment="Bottom" Margin="176,0,176,-114" Style="{StaticResource AccentButtonStyle}" Click="Install_Click"/>
<Button x:Name="BrowseButton" Content="..." HorizontalAlignment="Stretch" Height="32" VerticalAlignment="Top" Margin="437,-82,10,0" Click="Browse_Click"/> <Button x:Name="BrowseButton" Content="..." HorizontalAlignment="Stretch" Height="32" VerticalAlignment="Top" Margin="437,-75,10,0" Click="Browse_Click"/>
<Button x:Name="Uninstall_Button" Content="Uninstall" HorizontalAlignment="Stretch" Height="31" VerticalAlignment="Bottom" Margin="176,0,176,-47" Click="Uninstall_Button_Click" Background="#CCCB3737" Foreground="White" Visibility="Hidden"/> <Button x:Name="Uninstall_Button" Content="Uninstall" HorizontalAlignment="Stretch" Height="31" VerticalAlignment="Bottom" Margin="176,0,176,-100" Click="Uninstall_Button_Click" Foreground="White" Visibility="Hidden" IsCancel="True"/>
<ProgressBar x:Name="Download_Progressbar" Height="1" VerticalAlignment="Top" Margin="15,-34,15,0" IsIndeterminate="True" Visibility="Hidden"/> <ProgressBar x:Name="Download_Progressbar" Height="1" VerticalAlignment="Top" Margin="15,22,15,-26" IsIndeterminate="True" Visibility="Hidden"/>
<Label x:Name="Download_Text" Content="Downloading: " Height="19" VerticalAlignment="Top" Margin="10,-82,10,0" Visibility="Hidden"/> <Label x:Name="Download_Text" Content="Downloading: " Height="19" VerticalAlignment="Top" Margin="10,-26,10,0" Visibility="Hidden"/>
<TextBlock Margin="349,-38,0,15"><Hyperlink NavigateUri="https://ez-pp.farm" RequestNavigate="Hyperlink_RequestNavigate"><Run Text="Copyright @ EZPPFarm"/></Hyperlink></TextBlock> <TextBlock Margin="349,14,0,-37"><Hyperlink NavigateUri="https://ez-pp.farm" RequestNavigate="Hyperlink_RequestNavigate"><Run Text="Copyright @ EZPPFarm"/></Hyperlink></TextBlock>
<ComboBox x:Name="ReleaseStreamComboBox" HorizontalAlignment="Left" Height="31" VerticalAlignment="Top" Width="171" Margin="0,-80,0,0" ClipToBounds="True" SelectionChanged="ReleaseStreamComboBox_SelectionChanged"/> <ComboBox x:Name="ReleaseStreamComboBox" HorizontalAlignment="Left" Height="31" VerticalAlignment="Top" Width="475" Margin="10,-137,0,0" ClipToBounds="True" SelectionChanged="ReleaseStreamComboBox_SelectionChanged"/>
<Label x:Name="ReleaseStreamLabel" Content="Release:" HorizontalAlignment="Left" Height="19" VerticalAlignment="Top" Width="145" Margin="0,-128,0,0"/> <Label x:Name="ReleaseStreamLabel" Content="Release:" HorizontalAlignment="Left" Height="19" VerticalAlignment="Top" Width="145" Margin="10,-181,0,0"/>
<Label Content="Path to osu! Folder:" HorizontalAlignment="Left" Height="19" VerticalAlignment="Top" Width="145" Margin="10,-263,0,0"/>
</ui:SimpleStackPanel> </ui:SimpleStackPanel>
</Window> </Window>

View File

@ -391,15 +391,12 @@ namespace EZPPClient_Installer
Visibility prevInstallBtnVis = InstallButton.Visibility; Visibility prevInstallBtnVis = InstallButton.Visibility;
Visibility prevUninstallBtnVis = Uninstall_Button.Visibility; Visibility prevUninstallBtnVis = Uninstall_Button.Visibility;
Visibility prevLinkFCVis = linkFoldersCheckbox.Visibility; Visibility prevLinkFCVis = linkFoldersCheckbox.Visibility;
Visibility prevReleaseLabelVis = ReleaseStreamLabel.Visibility;
Visibility prevReleasesVis = ReleaseStreamComboBox.Visibility;
BrowseButton.IsEnabled = false; BrowseButton.IsEnabled = false;
InstallButton.Visibility = Visibility.Hidden; InstallButton.Visibility = Visibility.Hidden;
Uninstall_Button.Visibility = Visibility.Hidden; Uninstall_Button.Visibility = Visibility.Hidden;
linkFoldersCheckbox.Visibility = Visibility.Hidden; linkFoldersCheckbox.Visibility = Visibility.Hidden;
ReleaseStreamComboBox.Visibility = Visibility.Hidden; ReleaseStreamComboBox.IsEnabled = false;
ReleaseStreamLabel.Visibility = Visibility.Hidden;
Download_Text.Visibility = Visibility.Visible; Download_Text.Visibility = Visibility.Visible;
Download_Progressbar.Visibility = Visibility.Visible; Download_Progressbar.Visibility = Visibility.Visible;
@ -425,9 +422,8 @@ namespace EZPPClient_Installer
InstallButton.Visibility = prevInstallBtnVis; InstallButton.Visibility = prevInstallBtnVis;
Uninstall_Button.Visibility = prevUninstallBtnVis; Uninstall_Button.Visibility = prevUninstallBtnVis;
linkFoldersCheckbox.Visibility = prevLinkFCVis; linkFoldersCheckbox.Visibility = prevLinkFCVis;
ReleaseStreamComboBox.Visibility = prevReleasesVis;
ReleaseStreamLabel.Visibility = prevReleaseLabelVis;
BrowseButton.IsEnabled = true; BrowseButton.IsEnabled = true;
ReleaseStreamComboBox.IsEnabled = true;
Download_Text.Visibility = Visibility.Hidden; Download_Text.Visibility = Visibility.Hidden;
Download_Progressbar.Visibility = Visibility.Hidden; Download_Progressbar.Visibility = Visibility.Hidden;
@ -665,6 +661,11 @@ namespace EZPPClient_Installer
if (init) if (init)
return; return;
ReleaseStreamComboBox.IsEnabled = false;
BrowseButton.IsEnabled = false;
InstallButton.IsEnabled = false;
Uninstall_Button.IsEnabled = false;
string osuPath = folderTextbox.Text; string osuPath = folderTextbox.Text;
bool isValidFolder = await isValidOsuFolder(osuPath); bool isValidFolder = await isValidOsuFolder(osuPath);
@ -701,6 +702,11 @@ namespace EZPPClient_Installer
PrimaryButtonText = "Okay" PrimaryButtonText = "Okay"
}.ShowAsync(); }.ShowAsync();
ReleaseStreamComboBox.IsEnabled = true;
BrowseButton.IsEnabled = true;
InstallButton.IsEnabled = true;
Uninstall_Button.IsEnabled = true;
} }
} }
} }