Skip to content

Commit

Permalink
ProfileWindow UI Improvement
Browse files Browse the repository at this point in the history
  • Loading branch information
d1ret committed Jan 31, 2022
1 parent 55142f9 commit e21b2d8
Show file tree
Hide file tree
Showing 3 changed files with 253 additions and 43 deletions.
174 changes: 166 additions & 8 deletions ValorantCC/App.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -218,14 +218,172 @@
</ControlTemplate>
</Setter.Value>
</Setter>
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="BlueViolet"></Setter>
</Trigger>
<Trigger Property="IsMouseOver" Value="False">
<Setter Property="Background" Value="Yellow" />
</Trigger>
</Style.Triggers>
</Style>
<!--SearchCodeButtonStyleStart-->
<Style x:Key="SearchCodeButtonStyle" TargetType="Button">
<Setter Property="OverridesDefaultStyle" Value="True"/>
<Setter Property="Margin" Value="5"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Grid x:Name="defaultbutton" Background="{TemplateBinding Background}">
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center" />
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsDefaulted" Value="true">
<Setter TargetName="defaultbutton" Property="Background" Value="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}" />
</Trigger>
<Trigger Property="IsMouseOver" Value="true">
<Setter TargetName="defaultbutton" Property="Background" Value="#595C6A" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<!--SearchCodeButtonStyleStart-->
<!--TextBoxStart-->
<Style TargetType="{x:Type TextBox}" x:Key="LineTextBox">
<Setter Property="FontSize" Value="12"/>
<Setter Property="Margin" Value="0 3 0 0"/>
<Setter Property="BorderBrush" Value="Transparent"/>
<Setter Property="BorderThickness" Value="0 0 0 0"/>
<Setter Property="CaretBrush" Value="White"/>
<Setter Property="Background" Value="Transparent"/>
<Setter Property="Foreground" Value="White"/>

<Setter Property="Template" >
<Setter.Value>
<ControlTemplate TargetType="{x:Type TextBoxBase}">
<Grid>
<Border x:Name="border"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
Background="{TemplateBinding Background}"
SnapsToDevicePixels="True">
<ScrollViewer x:Name="PART_ContentHost" Focusable="False" HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Hidden"/>
</Border>

<TextBlock IsHitTestVisible="False"
Text="{TemplateBinding Tag}"
x:Name="placeholder"
FontFamily="{TemplateBinding FontFamily}"
Padding="{TemplateBinding Padding}"
VerticalAlignment="Center"
HorizontalAlignment="{TemplateBinding HorizontalAlignment}"
Foreground="Gray"
>
<TextBlock.Style>
<Style TargetType="{x:Type TextBlock}">
<Setter Property="Visibility" Value="Collapsed" />
<Style.Triggers>
<DataTrigger Binding="{Binding Text, RelativeSource={RelativeSource TemplatedParent}}" Value="">
<Setter Property="Visibility" Value="Visible" />
</DataTrigger>
</Style.Triggers>
</Style>
</TextBlock.Style>

</TextBlock>

</Grid>

<ControlTemplate.Triggers>
<Trigger Property="IsEnabled" Value="False">
<Setter Property="Opacity" TargetName="border" Value="0.56"/>
</Trigger>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="BorderBrush" TargetName="border" Value="#FF7EB4EA"/>
</Trigger>
<Trigger Property="IsKeyboardFocused" Value="True">
<Setter Property="BorderBrush" TargetName="border" Value="#FF569DE5"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<!--TextBoxEnd-->
<!--ScrollStart-->
<Style x:Key="ScrollThumbs" TargetType="{x:Type Thumb}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate>
<Grid x:Name="Grid">
<Rectangle HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Width="Auto"
Height="Auto" Fill="Transparent"/>
<Border x:Name="Rectangle1" CornerRadius="3" HorizontalAlignment="Stretch"
VerticalAlignment="Stretch" Width="Auto" Height="Auto"
Background="{TemplateBinding Background}"/>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="Tag" Value="Horizontal">
<Setter TargetName="Rectangle1" Property="Width" Value="Auto"/>
<Setter TargetName="Rectangle1" Property="Height" Value="7"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="{x:Type ScrollBar}" TargetType="{x:Type ScrollBar}">
<Setter Property="Stylus.IsFlicksEnabled" Value="False"/>
<Setter Property="Foreground" Value="#FF2D2D30"/>
<Setter Property="Background" Value="#8c8c8f"/>
<Setter Property="Width" Value="0"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ScrollBar}">
<!--<Border Width="7" CornerRadius="15">-->
<Grid x:Name="GridRoot" Width="7" Background="#FF2E2F35" Margin="5,0,5,-1">
<Track x:Name="PART_Track" Grid.Row="0" IsDirectionReversed="true" Focusable="False">
<Track.Thumb>
<Thumb x:Name="Thumb" Background="#8c8c8f"
Style="{DynamicResource ScrollThumbs}"/>
</Track.Thumb>
<Track.IncreaseRepeatButton>
<RepeatButton x:Name="PageUp" Command="ScrollBar.PageDownCommand" Opacity="0" Focusable="False"/>
</Track.IncreaseRepeatButton>
<Track.DecreaseRepeatButton>
<RepeatButton x:Name="PageDown" Command="ScrollBar.PageUpCommand" Opacity="0" Focusable="False"/>
</Track.DecreaseRepeatButton>
</Track>
</Grid>
<!--</Border>-->

<ControlTemplate.Triggers>
<Trigger SourceName="Thumb" Property="IsMouseOver" Value="true">
<Setter Value="#8c8c8f"
TargetName="Thumb" Property="Background"/>
</Trigger>
<Trigger SourceName="Thumb" Property="IsDragging" Value="true">
<Setter Value="White" TargetName="Thumb" Property="Background"/>
</Trigger>
<Trigger Property="IsEnabled" Value="false">
<Setter TargetName="Thumb" Property="Visibility" Value="Collapsed"/>
</Trigger>
<Trigger Property="Orientation" Value="Horizontal">
<Setter TargetName="GridRoot" Property="LayoutTransform">
<Setter.Value>
<RotateTransform Angle="-90"/>
</Setter.Value>
</Setter>
<Setter TargetName="PART_Track" Property="LayoutTransform">
<Setter.Value>
<RotateTransform Angle="-90"/>
</Setter.Value>
</Setter>
<Setter Property="Width" Value="Auto"/>
<Setter Property="Height" Value="12"/>
<Setter TargetName="Thumb" Property="Tag" Value="Horizontal"/>
<Setter TargetName="PageDown" Property="Command" Value="ScrollBar.PageLeftCommand"/>
<Setter TargetName="PageUp" Property="Command" Value="ScrollBar.PageRightCommand"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<!--ScrollEnd-->
</Application.Resources>
</Application>
44 changes: 31 additions & 13 deletions ValorantCC/SubWindow/ProfilesWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,36 @@
xmlns:local="clr-namespace:ValorantCC"
xmlns:gif="http://wpfanimatedgif.codeplex.com"
mc:Ignorable="d"
Title="ProfilesWindow" Height="Auto" Width="Auto" ResizeMode="NoResize" SizeToContent="WidthAndHeight" ShowInTaskbar="False" WindowStartupLocation="CenterOwner">
<Border Background="#232429" Height="450" Width="351" Loaded="Border_Loaded">
<StackPanel Name="Container" HorizontalAlignment="Center" Margin="0,5">
<StackPanel Orientation="Horizontal" VerticalAlignment="Center">
<TextBox Name="SearchCode" MinWidth="165" MaxWidth="165" Background="#FF393B44" Margin="0,0,5,0" Foreground="White"/>
<Button Name="btnSearchCode" Content="Search Code" MinWidth="85" Background="#FF393B44" Foreground="White" Click="btnSearchCode_Click"/>
</StackPanel>
<ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled" Height="420">
<StackPanel Name="ShareablesContainer" HorizontalAlignment="Center">
<Image gif:ImageBehavior.AnimatedSource="../Resources/vtspinner.gif" Width="50" Height="50" Name="LoadingPlaceHolder"/>
Title="ProfilesWindow" RenderOptions.BitmapScalingMode="Fant" Background="Transparent" AllowsTransparency="True" Height="481" Width="339" ResizeMode="NoResize" SizeToContent="WidthAndHeight" ShowInTaskbar="False" WindowStartupLocation="CenterOwner" WindowStyle="None">

<Border BorderThickness="0" CornerRadius="7" Background="#232429" Height="450" Loaded="Border_Loaded" Margin="0,15,0,15">
<Grid>
<Border BorderThickness="0" BorderBrush="Transparent" Background ="#16171B" Margin="0,-2,-1,425" CornerRadius="7,5,0,0" MouseDown="Border_MouseDown">
<Grid Height="Auto" Width="Auto" Margin="0,0,1,-2" OpacityMask="#FFA42727">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="18*"/>
<ColumnDefinition Width="90*"/>
<ColumnDefinition Width="189*"/>
<ColumnDefinition Width="20*"/>
<ColumnDefinition Width="23*"/>
</Grid.ColumnDefinitions>
<Image Source="/Resources/vtools-colored.ico" Grid.Column="0" Margin="2,6,2,7"/>
<Button x:Name="exitButton" Content="" Margin="2,5,4,5" Background="{x:Null}" BorderBrush="{x:Null}" Foreground="White" Style="{DynamicResource RightButtonStyle}" Cursor="Hand" Grid.Column="4" Click="ExitClick" MouseEnter="TabButtonEnter" MouseLeave="TabButtonLeave"/>
<Button x:Name="minusButton" Content="" Margin="1,4,4,4" Background="{x:Null}" BorderBrush="{x:Null}" Foreground="White" Style="{DynamicResource RightButtonStyle}" Cursor="Hand" Grid.Column="3" Click="MinimizeClick" MouseEnter="TabButtonEnter" MouseLeave="TabButtonLeave"/>
</Grid>
</Border>
<StackPanel Name="Container" HorizontalAlignment="Center" Margin="0,5">
<StackPanel Orientation="Horizontal" Width="350">
<TextBox Style="{StaticResource LineTextBox}" Name="SearchCode" MinWidth="128" MaxWidth="128" Background="#FF393B44" Margin="65,25,5,0" Foreground="White" Height="22"/>
<Button Style="{DynamicResource SearchCodeButtonStyle}" Name="btnSearchCode" Content="Search Code" MinWidth="85" Background="#FF393B44" Margin="0,25,5,0" Foreground="White" Cursor="Hand" Click="btnSearchCode_Click" BorderBrush="#FF393B44"/>
</StackPanel>
</ScrollViewer>
</StackPanel>
<ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled" Margin="0,5,0,0" Height="388" Width="338">

<StackPanel Name="ShareablesContainer" HorizontalAlignment="Center">
<Image gif:ImageBehavior.AnimatedSource="../Resources/vtspinner.gif" Width="50" Height="52" Margin="0,155,0,0" x:Name="LoadingPlaceHolder"/>
</StackPanel>
</ScrollViewer>
</StackPanel>
</Grid>
</Border>
</Window>
</Window>
Loading

0 comments on commit e21b2d8

Please # to comment.