Skip to content

Commit

Permalink
Added back window resizing (#250)
Browse files Browse the repository at this point in the history
  • Loading branch information
CriticalFlaw committed Oct 6, 2024
1 parent dabaeb2 commit 74d50be
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/TF2HUD.Editor/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
WindowStyle="None"
AllowsTransparency="True"
Background="Transparent"
ResizeMode="NoResize"
ResizeMode="CanResizeWithGrip"
FontFamily="../Resources/Fonts/TF2Secondary.ttf #TF2 Secondary"
FontSize="20px">

Expand All @@ -23,6 +23,8 @@
<Grid>
<Image Source="../Resources/Images/favicon.ico" Height="20" HorizontalAlignment="Left" Margin="5"/>
<TextBlock Text="{lex:Loc ui_title}" VerticalAlignment="Center" Margin="30,0,0,0" Foreground="#EBE2CA" FontFamily="../Resources/Fonts/TF2Build.ttf #TF2 Build" FontSize="16px" />
<Button Content="_" HorizontalAlignment="Right" Margin="0,0,60,0" Width="30" Height="30" Click="Minimize_Click" FontFamily="../Resources/Fonts/TF2Build.ttf #TF2 Build" />
<Button Content="[]" HorizontalAlignment="Right" Margin="0,0,30,0" Width="30" Height="30" Click="Maximize_Click" FontFamily="../Resources/Fonts/TF2Build.ttf #TF2 Build" />
<Button Content="X" HorizontalAlignment="Right" Width="30" Height="30" Click="CloseButton_Click" FontFamily="../Resources/Fonts/TF2Build.ttf #TF2 Build" />
</Grid>
</Border>
Expand Down
10 changes: 10 additions & 0 deletions src/TF2HUD.Editor/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -234,5 +234,15 @@ private void CloseButton_Click(object sender, RoutedEventArgs e)
{
Close();
}

private void Minimize_Click(object sender, RoutedEventArgs e)
{
this.WindowState = WindowState.Minimized;
}

private void Maximize_Click(object sender, RoutedEventArgs e)
{
this.WindowState = this.WindowState == WindowState.Maximized ? WindowState.Normal : WindowState.Maximized;
}
}
}

0 comments on commit 74d50be

Please sign in to comment.