| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 109be68 commit d9ef4dc
4 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -268,6 +268,7 @@ | |||
| 268 | 268 | <ControlTemplate.Triggers> | |
| 269 | 269 | <Trigger Property="IsEnabled" Value="False"> | |
| 270 | 270 | <Setter Property="Foreground" Value="{DynamicResource ThemeButtonForegroundDisabled}" /> | |
| 271 | + <Setter Property="Background" Value="{DynamicResource ThemeButtonBackgroundDisabled}" /> | ||
| 271 | 272 | </Trigger> | |
| 272 | 273 | <Trigger Property="IsMouseOver" Value="true"> | |
| 273 | 274 | <Setter TargetName="shortcutbutton" Property="Background" Value="{DynamicResource ThemeButtonBackgroundMouseOver}" /> | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -17,16 +17,28 @@ | |||
| 17 | 17 | <Border x:Name="shortcutbutton" BorderThickness="0" BorderBrush="Black" Background="{TemplateBinding Background}"> | |
| 18 | 18 | <ContentPresenter Margin="0" HorizontalAlignment="Center" VerticalAlignment="Center" RecognizesAccessKey="True"/> | |
| 19 | 19 | </Border> | |
| 20 | + | ||
| 20 | 21 | <ControlTemplate.Triggers> | |
| 22 | + <Trigger Property="IsEnabled" Value="True"> | ||
| 23 | + <Setter Property="Background" Value="{DynamicResource ThemeButtonBackground}" /> | ||
| 24 | + <Setter Property="Foreground" Value="{DynamicResource ThemeButtonForeground}" /> | ||
| 25 | + </Trigger> | ||
| 26 | + <Trigger Property="IsEnabled" Value="False"> | ||
| 27 | + <Setter Property="Background" Value="{DynamicResource ThemeButtonBackgroundDisabled}" /> | ||
| 28 | + <Setter Property="Foreground" Value="{DynamicResource ThemeButtonForegroundDisabled}" /> | ||
| 29 | + </Trigger> | ||
| 21 | 30 | <Trigger Property="IsMouseOver" Value="true"> | |
| 22 | - <Setter TargetName="shortcutbutton" Property="Background" Value="#FF494949" /> | ||
| 31 | + <Setter Property="Background" Value="{DynamicResource ThemeButtonBackgroundMouseOver}" /> | ||
| 32 | + <Setter Property="Foreground" Value="{DynamicResource ThemeBrightText}"/> | ||
| 23 | 33 | </Trigger> | |
| 34 | + <!--TODO fix highlight on mousedown--> | ||
| 24 | 35 | <Trigger Property="IsPressed" Value="true"> | |
| 25 | - <Setter TargetName="shortcutbutton" Property="Background" Value="#FF0F0F0F" /> | ||
| 36 | + <Setter Property="Background" Value="{DynamicResource ThemeButtonBackgroundPressed}" /> | ||
| 37 | + <Setter Property="Foreground" Value="{DynamicResource ThemeBrightText}"/> | ||
| 26 | 38 | </Trigger> | |
| 27 | 39 | <Trigger Property="IsFocused" Value="true"> | |
| 28 | - <Setter TargetName="shortcutbutton" Property="BorderBrush" Value="{DynamicResource ThemeSystemHighlight}" /> | ||
| 29 | - <Setter TargetName="shortcutbutton" Property="BorderThickness" Value="1" /> | ||
| 40 | + <Setter Property="BorderBrush" Value="{DynamicResource ThemeSystemHighlight}" /> | ||
| 41 | + <Setter Property="BorderThickness" TargetName="shortcutbutton" Value="1" /> | ||
| 30 | 42 | </Trigger> | |
| 31 | 43 | </ControlTemplate.Triggers> | |
| 32 | 44 | </ControlTemplate> | |
@@ -210,11 +222,11 @@ | |||
| 210 | 222 | <ColumnDefinition Width="*"/> | |
| 211 | 223 | <ColumnDefinition Width="*"/> | |
| 212 | 224 | </Grid.ColumnDefinitions> | |
| 213 | - <Button Grid.Column="0" Style="{StaticResource CustomButton}" x:Name="btnCancelNewProject" Background="{DynamicResource ThemeButtonBackground}" Foreground="#FFC1C1C1" Margin="0,0,3,3" BorderBrush="{x:Null}" VerticalAlignment="Top" Height="35" Click="BtnCancelNewProject_Click" TabIndex="4" > | ||
| 214 | - <Label Foreground="{DynamicResource ThemeButtonForeground}" Content="Cancel"/> | ||
| 225 | + <Button Grid.Column="0" Style="{StaticResource CustomButton}" x:Name="btnCancelNewProject" Margin="0,0,3,3" BorderBrush="{x:Null}" VerticalAlignment="Top" Height="35" Click="BtnCancelNewProject_Click" TabIndex="4" > | ||
| 226 | + <Label Content="Cancel" Foreground="{Binding RelativeSource={RelativeSource AncestorType=Button}, Path=Foreground}"/> | ||
| 215 | 227 | </Button> | |
| 216 | - <Button Grid.Column="1" Style="{StaticResource CustomButton}" x:Name="btnCreateNewProject" Background="{DynamicResource ThemeButtonBackground}" Foreground="#FFC1C1C1" Margin="3,0,0,3" BorderBrush="{x:Null}" VerticalAlignment="Top" Height="35" Click="BtnCreateNewProject_Click" TabIndex="3"> | ||
| 217 | - <Label Foreground="{DynamicResource ThemeButtonForeground}" Content="_Create"/> | ||
| 228 | + <Button Grid.Column="1" Style="{StaticResource CustomButton}" x:Name="btnCreateNewProject" Margin="3,0,0,3" BorderBrush="{x:Null}" VerticalAlignment="Top" Height="35" Click="BtnCreateNewProject_Click" TabIndex="3"> | ||
| 229 | + <Label Content="_Create" Foreground="{Binding RelativeSource={RelativeSource AncestorType=Button}, Path=Foreground}"/> | ||
| 218 | 230 | </Button> | |
| 219 | 231 | </Grid> | |
| 220 | 232 | </StackPanel> | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,4 +1,5 @@ | |||
| 1 | 1 | using System.Collections.Generic; | |
| 2 | + using System.IO; | ||
| 2 | 3 | using System.Windows; | |
| 3 | 4 | using System.Windows.Controls; | |
| 4 | 5 | using System.Windows.Input; | |
@@ -19,11 +20,15 @@ public partial class NewProject : Window | |||
| 19 | 20 | int previousSelectedTemplateIndex = -1; | |
| 20 | 21 | int previousSelectedModuleIndex = -1; | |
| 21 | 22 | ||
| 23 | + static string targetFolder = null; | ||
| 24 | + | ||
| 22 | 25 | public NewProject(string unityVersion, string suggestedName, string targetFolder, bool nameIsLocked = false) | |
| 23 | 26 | { | |
| 24 | 27 | isInitializing = true; | |
| 25 | 28 | InitializeComponent(); | |
| 26 | 29 | ||
| 30 | + NewProject.targetFolder = targetFolder; | ||
| 31 | + | ||
| 27 | 32 | // get version | |
| 28 | 33 | newVersion = unityVersion; | |
| 29 | 34 | newName = suggestedName; | |
@@ -183,8 +188,27 @@ void UpdateSelectedVersion() | |||
| 183 | 188 | } | |
| 184 | 189 | } | |
| 185 | 190 | ||
| 186 | - private void TxtNewProjectName_TextChanged(object sender, System.Windows.Controls.TextChangedEventArgs e) | ||
| 191 | + private void TxtNewProjectName_TextChanged(object sender, TextChangedEventArgs e) | ||
| 187 | 192 | { | |
| 193 | + if (isInitializing == true) return; | ||
| 194 | + | ||
| 195 | + // validate new projectname that it doesnt exists already | ||
| 196 | + var targetPath = Path.Combine(targetFolder, txtNewProjectName.Text); | ||
| 197 | + System.Console.WriteLine(targetPath); | ||
| 198 | + if (Directory.Exists(targetPath) == true) | ||
| 199 | + { | ||
| 200 | + System.Console.WriteLine("Project name already exists"); | ||
| 201 | + txtNewProjectName.BorderBrush = Brushes.Red; // not visible if focused | ||
| 202 | + btnCreateNewProject.IsEnabled = false; | ||
| 203 | + } | ||
| 204 | + else | ||
| 205 | + { | ||
| 206 | + txtNewProjectName.BorderBrush = null; | ||
| 207 | + btnCreateNewProject.IsEnabled = true; | ||
| 208 | + } | ||
| 209 | + | ||
| 210 | + System.Console.WriteLine("newProjectName: " + txtNewProjectName.Text); | ||
| 211 | + | ||
| 188 | 212 | newProjectName = txtNewProjectName.Text; | |
| 189 | 213 | } | |
| 190 | 214 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -32,7 +32,8 @@ | |||
| 32 | 32 | <SolidColorBrush x:Key="ThemeScrollBarEnabledForeground" Color="#FF000000"/> | |
| 33 | 33 | ||
| 34 | 34 | <!--buttons--> | |
| 35 | - <SolidColorBrush x:Key="ThemeButtonForegroundDisabled" Color="#FF707070"/> | ||
| 35 | + <SolidColorBrush x:Key="ThemeButtonForegroundDisabled" Color="#FF505050"/> | ||
| 36 | + <SolidColorBrush x:Key="ThemeButtonBackgroundDisabled" Color="#44707070"/> | ||
| 36 | 37 | <SolidColorBrush x:Key="ThemeButtonBackgroundMouseOver" Color="#FF494949"/> | |
| 37 | 38 | <SolidColorBrush x:Key="ThemeButtonBackgroundPressed" Color="#FF0F0F0F"/> | |
| 38 | 39 | <SolidColorBrush x:Key="ThemeButtonBackground" Color="#FF3F3F46"/> | |
| Back | FazBrowse Home | New Git URL |
0 commit comments