|
5 | 5 | xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
6 | 6 | xmlns:local="clr-namespace:UnityLauncherPro"
|
7 | 7 | mc:Ignorable="d"
|
8 |
| - Title="Create New Project" Height="200" Width="300" Background="{DynamicResource DarkestBackground}" PreviewKeyDown="Window_PreviewKeyDown"> |
| 8 | + Title="Create New Project" Height="296" Width="300" Background="{DynamicResource DarkestBackground}" PreviewKeyDown="Window_PreviewKeyDown" ResizeMode="NoResize" WindowStartupLocation="CenterOwner"> |
9 | 9 | <Window.Resources>
|
10 | 10 | <!-- custom buttons -->
|
11 | 11 | <Style x:Key="CustomButton" TargetType="{x:Type Button}">
|
|
29 | 29 | </Setter.Value>
|
30 | 30 | </Setter>
|
31 | 31 | </Style>
|
| 32 | + |
| 33 | + <!--TODO move to styles--> |
| 34 | + <!-- datagrid rows & row selection --> |
| 35 | + <Style TargetType="DataGridRow"> |
| 36 | + <Setter Property="Background" Value="{StaticResource ButtonBackground}" /> |
| 37 | + <Setter Property="BorderBrush" Value="{x:Null}" /> |
| 38 | + <Setter Property="BorderThickness" Value="0,0,0,0" /> |
| 39 | + <Style.Triggers> |
| 40 | + <!--<Trigger Property="IsMouseOver" Value="True"> |
| 41 | + <Setter Property="Background" Value="{StaticResource DataGridRowMouseOver}"/> |
| 42 | + </Trigger>--> |
| 43 | + <Trigger Property="IsSelected" Value="True"> |
| 44 | + <Setter Property="Background" Value="{StaticResource DataGridRowSelectedBackground}" /> |
| 45 | + </Trigger> |
| 46 | + </Style.Triggers> |
| 47 | + </Style> |
| 48 | + |
| 49 | + <!-- datagrid hide selected cell borders --> |
| 50 | + <Style TargetType="{x:Type DataGridCell}"> |
| 51 | + <Setter Property="BorderBrush" Value="Transparent" /> |
| 52 | + <Setter Property="FocusVisualStyle" Value="{x:Null}" /> |
| 53 | + <Setter Property="Margin" Value="0,0.5,0,0.5" /> |
| 54 | + <Style.Triggers> |
| 55 | + <Trigger Property="IsSelected" Value="True"> |
| 56 | + <Setter Property="Background" Value="Transparent" /> |
| 57 | + </Trigger> |
| 58 | + <Trigger Property="IsSelected" Value="False"> |
| 59 | + <Setter Property="Background" Value="Transparent" /> |
| 60 | + </Trigger> |
| 61 | + </Style.Triggers> |
| 62 | + </Style> |
| 63 | + |
| 64 | + <!-- datagrid scrollbar customization --> |
| 65 | + <!-- scrollbar top/bottom arrow buttons --> |
| 66 | + <Style x:Key="ScrollBarLineButton" TargetType="{x:Type RepeatButton}"> |
| 67 | + <Setter Property="SnapsToDevicePixels" Value="True"/> |
| 68 | + <Setter Property="OverridesDefaultStyle" Value="true"/> |
| 69 | + <Setter Property="Focusable" Value="false"/> |
| 70 | + <Setter Property="Template"> |
| 71 | + <Setter.Value> |
| 72 | + <ControlTemplate TargetType="{x:Type RepeatButton}"> |
| 73 | + <!-- button background --> |
| 74 | + <Border Name="Border" Margin="1" CornerRadius="0" BorderThickness="0" Background="{DynamicResource ButtonBackground}" BorderBrush="{x:Null}"> |
| 75 | + <!-- arrow sign --> |
| 76 | + <Path HorizontalAlignment="Center" VerticalAlignment="Center" Fill="{DynamicResource ScrollArrowForeground}" Data="{Binding Path=Content,RelativeSource={RelativeSource TemplatedParent}}" /> |
| 77 | + </Border> |
| 78 | + <ControlTemplate.Triggers> |
| 79 | + <!-- NOTE order matters, if pressed is before mouseover, then it gets overwritten --> |
| 80 | + <Trigger Property="IsMouseOver" Value="true"> |
| 81 | + <Setter TargetName="Border" Property="Background" Value="{StaticResource TextBoxBackground}" /> |
| 82 | + </Trigger> |
| 83 | + <Trigger Property="IsPressed" Value="true"> |
| 84 | + <Setter TargetName="Border" Property="Background" Value="{StaticResource ScrollArrowPressed}" /> |
| 85 | + </Trigger> |
| 86 | + <Trigger Property="IsEnabled" Value="false"> |
| 87 | + <Setter Property="Foreground" Value="Black"/> |
| 88 | + </Trigger> |
| 89 | + </ControlTemplate.Triggers> |
| 90 | + </ControlTemplate> |
| 91 | + </Setter.Value> |
| 92 | + </Setter> |
| 93 | + </Style> |
| 94 | + |
| 95 | + <Style x:Key="ScrollBarPageButton" TargetType="{x:Type RepeatButton}"> |
| 96 | + <Setter Property="SnapsToDevicePixels" Value="True"/> |
| 97 | + <Setter Property="OverridesDefaultStyle" Value="true"/> |
| 98 | + <Setter Property="IsTabStop" Value="false"/> |
| 99 | + <Setter Property="Focusable" Value="false"/> |
| 100 | + <Setter Property="Template"> |
| 101 | + <Setter.Value> |
| 102 | + <ControlTemplate TargetType="{x:Type RepeatButton}"> |
| 103 | + <Border Background="Transparent" /> |
| 104 | + </ControlTemplate> |
| 105 | + </Setter.Value> |
| 106 | + </Setter> |
| 107 | + </Style> |
| 108 | + |
| 109 | + <!-- scroll thumb (elevator) bar --> |
| 110 | + <Style x:Key="ScrollBarThumb" TargetType="{x:Type Thumb}"> |
| 111 | + <Setter Property="SnapsToDevicePixels" Value="True"/> |
| 112 | + <Setter Property="OverridesDefaultStyle" Value="true"/> |
| 113 | + <Setter Property="IsTabStop" Value="false"/> |
| 114 | + <Setter Property="Focusable" Value="false"/> |
| 115 | + <Setter Property="Template"> |
| 116 | + <Setter.Value> |
| 117 | + <ControlTemplate TargetType="{x:Type Thumb}"> |
| 118 | + <Border Name="Border" CornerRadius="0" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="1" /> |
| 119 | + <ControlTemplate.Triggers> |
| 120 | + <Trigger Property="IsMouseOver" Value="true"> |
| 121 | + <Setter TargetName="Border" Property="Background" Value="{StaticResource ScrollBarThumbFill}" /> |
| 122 | + </Trigger> |
| 123 | + </ControlTemplate.Triggers> |
| 124 | + </ControlTemplate> |
| 125 | + </Setter.Value> |
| 126 | + </Setter> |
| 127 | + </Style> |
| 128 | + |
| 129 | + <ControlTemplate x:Key="VerticalScrollBar" TargetType="{x:Type ScrollBar}"> |
| 130 | + <Grid > |
| 131 | + <Grid.RowDefinitions> |
| 132 | + <RowDefinition MaxHeight="18"/> |
| 133 | + <RowDefinition Height="0.00001*"/> |
| 134 | + <RowDefinition MaxHeight="18"/> |
| 135 | + </Grid.RowDefinitions> |
| 136 | + <!-- scrollbar background --> |
| 137 | + <Border Grid.RowSpan="3" CornerRadius="0" Background="{DynamicResource ScrollBarBackground}" /> |
| 138 | + <!-- scrollbar top button --> |
| 139 | + <RepeatButton Grid.Row="0" Style="{StaticResource ScrollBarLineButton}" Height="18" Command="ScrollBar.LineUpCommand" Content="M 0 4 L 8 4 L 4 0 Z" /> |
| 140 | + <Track Name="PART_Track" Grid.Row="1" IsDirectionReversed="true"> |
| 141 | + <Track.DecreaseRepeatButton> |
| 142 | + <RepeatButton Style="{StaticResource ScrollBarPageButton}" Command="ScrollBar.PageUpCommand" /> |
| 143 | + </Track.DecreaseRepeatButton> |
| 144 | + <Track.Thumb> |
| 145 | + <!-- scrollbar foreground --> |
| 146 | + <Thumb Style="{StaticResource ScrollBarThumb}" Margin="1,0,1,0" Background="{DynamicResource ScrollBarFill}" BorderBrush="{x:Null}"/> |
| 147 | + </Track.Thumb> |
| 148 | + <Track.IncreaseRepeatButton> |
| 149 | + <RepeatButton Style="{StaticResource ScrollBarPageButton}" Command="ScrollBar.PageDownCommand" /> |
| 150 | + </Track.IncreaseRepeatButton> |
| 151 | + </Track> |
| 152 | + <!-- scrollbar bottom button --> |
| 153 | + <RepeatButton Grid.Row="3" Style="{StaticResource ScrollBarLineButton}" Height="18" Command="ScrollBar.LineDownCommand" Content="M 0 0 L 4 4 L 8 0 Z" /> |
| 154 | + </Grid> |
| 155 | + </ControlTemplate> |
| 156 | + |
| 157 | + <Style x:Key="{x:Type ScrollBar}" TargetType="{x:Type ScrollBar}"> |
| 158 | + <Setter Property="SnapsToDevicePixels" Value="True"/> |
| 159 | + <Setter Property="OverridesDefaultStyle" Value="true"/> |
| 160 | + <Style.Triggers> |
| 161 | + <Trigger Property="Orientation" Value="Vertical"> |
| 162 | + <Setter Property="Width" Value="18"/> |
| 163 | + <Setter Property="Height" Value="Auto" /> |
| 164 | + <Setter Property="Template" Value="{StaticResource VerticalScrollBar}" /> |
| 165 | + </Trigger> |
| 166 | + </Style.Triggers> |
| 167 | + </Style> |
| 168 | + |
32 | 169 | </Window.Resources>
|
33 | 170 |
|
34 | 171 | <Grid>
|
35 | 172 | <StackPanel Margin="10,3">
|
36 |
| - <Label Content="Unity Version " Foreground="{DynamicResource ButtonForeground}" Margin="0,0,0,3" /> |
37 |
| - <TextBox x:Name="txtNewProjectVersion" VerticalAlignment="Center" Margin="0,0,0,3" IsEnabled="False" IsReadOnly="True" IsUndoEnabled="False" /> |
38 |
| - <Label Content="Project Name:" Foreground="{DynamicResource ButtonForeground}" Margin="0,0,0,3" /> |
39 |
| - <TextBox x:Name="txtNewProjectName" VerticalAlignment="Center" Margin="0,0,0,3" IsUndoEnabled="True" TextChanged="TxtNewProjectName_TextChanged" /> |
40 |
| - <Grid HorizontalAlignment="Stretch" Margin="0,15,0,0"> |
| 173 | + <Label Content="Unity Version " Foreground="{DynamicResource ButtonForeground}" Margin="0,0,0,3" Padding="5,5,5,3" /> |
| 174 | + <DataGrid x:Name="gridAvailableVersions" SelectionMode="Single" Height="120" Margin="3,0" VerticalAlignment="Top" HeadersVisibility="None" AutoGenerateColumns="False" IsSynchronizedWithCurrentItem="True" Foreground="{DynamicResource ButtonForeground}" Background="{DynamicResource MainBackgroundColor}" SelectionChanged="GridAvailableVersions_SelectionChanged" IsTabStop="True" TabIndex="1" KeyboardNavigation.TabNavigation = "None" Loaded="GridAvailableVersions_Loaded" EnableRowVirtualization="False"> |
| 175 | + <DataGrid.Columns> |
| 176 | + <DataGridTextColumn Header="Key" Binding="{Binding Key}" IsReadOnly="True" CanUserResize="False" MinWidth="300" /> |
| 177 | + </DataGrid.Columns> |
| 178 | + </DataGrid> |
| 179 | + <Label Content="Project Name:" Foreground="{DynamicResource ButtonForeground}" Margin="0,0,0,3" Padding="5,5,5,3" /> |
| 180 | + <TextBox x:Name="txtNewProjectName" VerticalAlignment="Center" Margin="3,0,3,3" IsUndoEnabled="True" TextChanged="TxtNewProjectName_TextChanged" PreviewKeyDown="TxtNewProjectName_PreviewKeyDown" TabIndex="0" /> |
| 181 | + <Label x:Name="lblNewProjectFolder" Content="(folder)" Foreground="{DynamicResource ButtonBackground}" Margin="0" FontSize="10" Padding="5,0,5,3" /> |
| 182 | + <Grid HorizontalAlignment="Stretch" Margin="0,8,0,0"> |
41 | 183 | <Grid.ColumnDefinitions>
|
42 | 184 | <ColumnDefinition Width="*"/>
|
43 | 185 | <ColumnDefinition Width="*"/>
|
44 | 186 | </Grid.ColumnDefinitions>
|
45 |
| - <Button Grid.Column="0" Style="{StaticResource CustomButton}" x:Name="btnCancelNewProject" Background="{DynamicResource ButtonBackground}" Foreground="#FFC1C1C1" Margin="3,0,3,3" BorderBrush="{x:Null}" VerticalAlignment="Top" Height="35" Click="BtnCancelNewProject_Click" > |
| 187 | + <Button Grid.Column="0" Style="{StaticResource CustomButton}" x:Name="btnCancelNewProject" Background="{DynamicResource ButtonBackground}" Foreground="#FFC1C1C1" Margin="3,0,3,3" BorderBrush="{x:Null}" VerticalAlignment="Top" Height="35" Click="BtnCancelNewProject_Click" IsTabStop="False" > |
46 | 188 | <Label Foreground="{DynamicResource ButtonForeground}" Content="Cancel"/>
|
47 | 189 | </Button>
|
48 |
| - <Button Grid.Column="1" Style="{StaticResource CustomButton}" x:Name="btnCreateNewProject" Background="{DynamicResource ButtonBackground}" Foreground="#FFC1C1C1" Margin="3,0,3,3" BorderBrush="{x:Null}" VerticalAlignment="Top" Height="35" Click="BtnCreateNewProject_Click"> |
| 190 | + <Button Grid.Column="1" Style="{StaticResource CustomButton}" x:Name="btnCreateNewProject" Background="{DynamicResource ButtonBackground}" Foreground="#FFC1C1C1" Margin="3,0,3,3" BorderBrush="{x:Null}" VerticalAlignment="Top" Height="35" Click="BtnCreateNewProject_Click" IsTabStop="False"> |
49 | 191 | <Label Foreground="{DynamicResource ButtonForeground}" Content="_Create"/>
|
50 | 192 | </Button>
|
51 | 193 | </Grid>
|
|
0 commit comments