Add dark custom title bar with WindowChrome

This commit is contained in:
2026-06-08 20:31:38 +05:00
parent 793076b948
commit 0c2212cde9
11 changed files with 235 additions and 75 deletions
-49
View File
@@ -1,49 +0,0 @@
# aider chat started at 2026-06-06 00:33:21
> Update git name with: git config user.name "Your Name"
> Update git email with: git config user.email "you@example.com"
> You can skip this check with --no-gitignore
> Add .aider* to .gitignore (recommended)? (Y)es/(N)o [Yes]: n
> C:\Users\dedikar\AppData\Local\Programs\Python\Python310\Scripts\aider --model ollama/qwen3:14b
> Warning: ollama/qwen3:14b expects these environment variables
> - OLLAMA_API_BASE: Not set
> Note: You may need to restart your terminal or command prompt for `setx` to take effect.
> You can skip this check with --no-show-model-warnings
> https://aider.chat/docs/llms/warnings.html
> Open documentation url for more info? (Y)es/(N)o/(D)on't ask again [Yes]: n
> Unable to list files in git repo: Commit.__init__() missing 2 required positional arguments: 'repo' and 'binsha'
> Is your git repo corrupted?
> Unable to read git repository, it may be corrupt?
> Commit.__init__() missing 2 required positional arguments: 'repo' and 'binsha'
# aider chat started at 2026-06-06 00:34:22
> C:\Users\dedikar\AppData\Local\Programs\Python\Python310\Scripts\aider --model ollama/qwen3:14b --no-git
> Warning: ollama/qwen3:14b expects these environment variables
> - OLLAMA_API_BASE: Not set
> Note: You may need to restart your terminal or command prompt for `setx` to take effect.
> You can skip this check with --no-show-model-warnings
> https://aider.chat/docs/llms/warnings.html
> Open documentation url for more info? (Y)es/(N)o/(D)on't ask again [Yes]: n
> Aider v0.86.2
> Model: ollama/qwen3:14b with whole edit format
> Git repo: none
> Repo-map: disabled
#### Видишь проект в папке?
<thinking-content-7bbeb8e1441453ad999a0bbba8a46d4b>
Okay, the user is asking if I can see the project in the folder. But since they mentioned they're not sharing any files yet, I need to respond appropriately. Let me check the previous messages again.
Earlier, the user said they switched to a new codebase and don't want the assistant to consider previous files. Then they stated they aren't sharing any files for editing. Now, their latest message is in Russian: "Видишь проект в папке?" which translates to "Can you see the project in the folder?"
Since they haven't provided any files or project structure, I can't see any files. My response should inform them that I can't access or see any files unless they share them. Also, I should prompt them to provide the necessary files or details for assistance. Need to make sure I follow the guidelines of not making assumptions and only working with provided information. Let me phrase it clearly in Russian as per their request.
</thinking-content-7bbeb8e1441453ad999a0bbba8a46d4b>
Нет, я не вижу проекта в папке. Пожалуйста, поделитесь файлами или укажите, какие изменения вы хотите внести, и я помогу вам с ними.
> Tokens: 608 sent, 306 received.
-6
View File
@@ -1,6 +0,0 @@
# 2026-06-06 00:33:27.709345
+n
# 2026-06-06 00:34:58.748562
+Видишь проект в папке?
BIN
View File
Binary file not shown.
+57
View File
@@ -83,6 +83,63 @@
<Setter Property="Foreground" Value="White"/>
</Style>
<!-- Стиль для кастомного заголовка окна -->
<Style x:Key="TitleBar" TargetType="Border">
<Setter Property="Background" Value="#2D2D2D"/>
<Setter Property="Height" Value="30"/>
<Setter Property="BorderBrush" Value="#444444"/>
<Setter Property="BorderThickness" Value="0,0,0,1"/>
<Setter Property="CornerRadius" Value="8,8,0,0"/>
</Style>
<Style x:Key="TitleBarText" TargetType="TextBlock">
<Setter Property="Foreground" Value="#CCCCCC"/>
<Setter Property="FontSize" Value="12"/>
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="Margin" Value="12,0,0,0"/>
</Style>
<Style x:Key="TitleBarButton" TargetType="Button">
<Setter Property="Width" Value="46"/>
<Setter Property="Height" Value="30"/>
<Setter Property="Background" Value="Transparent"/>
<Setter Property="Foreground" Value="White"/>
<Setter Property="BorderThickness" Value="0"/>
<Setter Property="Cursor" Value="Hand"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Border Background="{TemplateBinding Background}">
<TextBlock Text="{TemplateBinding Content}"
FontFamily="Segoe MDL2 Assets"
FontSize="10"
HorizontalAlignment="Center"
VerticalAlignment="Center"/>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="#3C3C3C"/>
</Trigger>
<Trigger Property="IsPressed" Value="True">
<Setter Property="Background" Value="#2A2A2A"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="TitleBarCloseButton" TargetType="Button" BasedOn="{StaticResource TitleBarButton}">
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="#E81123"/>
</Trigger>
<Trigger Property="IsPressed" Value="True">
<Setter Property="Background" Value="#F1707A"/>
</Trigger>
</Style.Triggers>
</Style>
<!-- Стиль для MessageBox buttons -->
<Style TargetType="Button" x:Key="{x:Type Button}">
<Setter Property="Background" Value="#3C3C3C"/>
+33 -5
View File
@@ -3,6 +3,7 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="QoS Manager"
WindowStartupLocation="CenterScreen"
WindowStyle="None"
ResizeMode="NoResize"
SizeToContent="WidthAndHeight"
Background="#2D2D2D"
@@ -12,13 +13,38 @@
MinWidth="300"
MaxWidth="500">
<Grid Margin="20">
<WindowChrome.WindowChrome>
<WindowChrome CaptionHeight="0" GlassFrameThickness="0" ResizeBorderThickness="0" UseAeroCaptionButtons="False"/>
</WindowChrome.WindowChrome>
<Border BorderBrush="#555555" BorderThickness="1" CornerRadius="8" Background="#2D2D2D">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="20"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="30"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<!-- Title Bar -->
<Border Grid.Row="0" Style="{StaticResource TitleBar}"
MouseLeftButtonDown="TitleBar_MouseLeftButtonDown">
<Grid>
<TextBlock Text="{Binding RelativeSource={RelativeSource AncestorType=Window}, Path=Title}"
Style="{StaticResource TitleBarText}"/>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
<Button x:Name="CloseButton" Style="{StaticResource TitleBarCloseButton}"
Click="CloseButton_Click" Content="&#xE8BB;"/>
</StackPanel>
</Grid>
</Border>
<!-- Content -->
<Grid Grid.Row="1" Margin="20">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="20"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<!-- Сообщение -->
<TextBlock x:Name="MessageTextBlock"
Grid.Row="0"
@@ -69,5 +95,7 @@
Click="NoButton_Click"
Visibility="Collapsed"/>
</StackPanel>
</Grid>
</Grid>
</Grid>
</Border>
</Window>
+34 -2
View File
@@ -5,9 +5,39 @@
Height="600" Width="900"
MinHeight="400" MinWidth="600"
WindowStartupLocation="CenterScreen"
WindowStyle="None"
Background="#1E1E1E">
<Grid Margin="20">
<WindowChrome.WindowChrome>
<WindowChrome CaptionHeight="0" GlassFrameThickness="0" ResizeBorderThickness="5" UseAeroCaptionButtons="False"/>
</WindowChrome.WindowChrome>
<Border BorderBrush="#555555" BorderThickness="1" CornerRadius="8" Background="#1E1E1E">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="30"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<!-- Title Bar -->
<Border Grid.Row="0" Style="{StaticResource TitleBar}"
MouseLeftButtonDown="TitleBar_MouseLeftButtonDown">
<Grid>
<TextBlock Text="{Binding RelativeSource={RelativeSource AncestorType=Window}, Path=Title}"
Style="{StaticResource TitleBarText}"/>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
<Button x:Name="MinimizeButton" Style="{StaticResource TitleBarButton}"
Click="MinimizeButton_Click" Content="&#xE921;"/>
<Button x:Name="MaximizeButton" Style="{StaticResource TitleBarButton}"
Click="MaximizeButton_Click" Content="&#xE922;"/>
<Button x:Name="CloseButton" Style="{StaticResource TitleBarCloseButton}"
Click="CloseButton_Click" Content="&#xE8BB;"/>
</StackPanel>
</Grid>
</Border>
<!-- Content -->
<Grid Grid.Row="1" Margin="20">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
@@ -202,5 +232,7 @@
Height="35"
Style="{StaticResource DarkButtonStyle}"/>
</StackPanel>
</Grid>
</Grid>
</Grid>
</Border>
</Window>
+7
View File
@@ -336,6 +336,13 @@ namespace QoSManager.Views
Close();
}
protected override void OnStateChanged(EventArgs e)
{
base.OnStateChanged(e);
if (MaximizeButton != null)
MaximizeButton.Content = WindowState == WindowState.Maximized ? "\uE923" : "\uE922";
}
protected override void OnClosed(EventArgs e)
{
SaveSettings();
+30 -2
View File
@@ -4,10 +4,36 @@
Title="Создание QoS-политики"
Height="320" Width="500"
WindowStartupLocation="CenterScreen"
WindowStyle="None"
Background="#1E1E1E"
ResizeMode="NoResize">
<Grid Margin="20">
<WindowChrome.WindowChrome>
<WindowChrome CaptionHeight="0" GlassFrameThickness="0" ResizeBorderThickness="0" UseAeroCaptionButtons="False"/>
</WindowChrome.WindowChrome>
<Border BorderBrush="#555555" BorderThickness="1" CornerRadius="8" Background="#1E1E1E">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="30"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<!-- Title Bar -->
<Border Grid.Row="0" Style="{StaticResource TitleBar}"
MouseLeftButtonDown="TitleBar_MouseLeftButtonDown">
<Grid>
<TextBlock Text="{Binding RelativeSource={RelativeSource AncestorType=Window}, Path=Title}"
Style="{StaticResource TitleBarText}"/>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
<Button x:Name="CloseButton" Style="{StaticResource TitleBarCloseButton}"
Click="CloseButton_Click" Content="&#xE8BB;"/>
</StackPanel>
</Grid>
</Border>
<!-- Content -->
<Grid Grid.Row="1" Margin="20">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
@@ -128,5 +154,7 @@
Height="35"
Style="{StaticResource DarkButtonStyle}"/>
</StackPanel>
</Grid>
</Grid>
</Grid>
</Border>
</Window>
+37 -7
View File
@@ -4,20 +4,48 @@
Title="Выбор процесса"
Height="600" Width="800"
WindowStartupLocation="CenterScreen"
WindowStyle="None"
ResizeMode="CanResize"
Background="#2b2b2b"
TextElement.Foreground="White">
<Grid Margin="10">
<WindowChrome.WindowChrome>
<WindowChrome CaptionHeight="0" GlassFrameThickness="0" ResizeBorderThickness="5" UseAeroCaptionButtons="False"/>
</WindowChrome.WindowChrome>
<Border BorderBrush="#555555" BorderThickness="1" CornerRadius="8" Background="#2b2b2b">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="30"/>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<TextBlock Grid.Row="0" Text="Выберите запущенный процесс:"
FontSize="14" FontWeight="Bold"
Foreground="White" Margin="0,0,0,10"/>
<!-- Title Bar -->
<Border Grid.Row="0" Style="{StaticResource TitleBar}"
MouseLeftButtonDown="TitleBar_MouseLeftButtonDown">
<Grid>
<TextBlock Text="{Binding RelativeSource={RelativeSource AncestorType=Window}, Path=Title}"
Style="{StaticResource TitleBarText}"/>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
<Button x:Name="MinimizeButton" Style="{StaticResource TitleBarButton}"
Click="MinimizeButton_Click" Content="&#xE921;"/>
<Button x:Name="CloseButton" Style="{StaticResource TitleBarCloseButton}"
Click="CloseButton_Click" Content="&#xE8BB;"/>
</StackPanel>
</Grid>
</Border>
<!-- Content -->
<Grid Grid.Row="1" Margin="10">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<TextBlock Grid.Row="0" Text="Выберите запущенный процесс:"
FontSize="14" FontWeight="Bold"
Foreground="White" Margin="0,0,0,10"/>
<DataGrid x:Name="ProcessesDataGrid" Grid.Row="1"
AutoGenerateColumns="False"
@@ -57,5 +85,7 @@
Background="#4a4a4a" Foreground="White"
BorderBrush="#6a6a6a" Margin="0,0,10,0" Click="CancelButton_Click"/>
</StackPanel>
</Grid>
</Grid>
</Grid>
</Border>
</Window>
+5
View File
@@ -78,6 +78,11 @@ namespace QoSManager.Views
}
}
private void MinimizeButton_Click(object sender, RoutedEventArgs e)
{
WindowState = WindowState.Minimized;
}
private void CloseButton_Click(object sender, RoutedEventArgs e)
{
DialogResult = false;
+32 -4
View File
@@ -3,16 +3,42 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Неподдерживаемая версия Windows" Height="520" Width="580"
WindowStartupLocation="CenterScreen"
WindowStyle="None"
ResizeMode="NoResize"
Background="#2D2D30">
<Grid Margin="25">
<WindowChrome.WindowChrome>
<WindowChrome CaptionHeight="0" GlassFrameThickness="0" ResizeBorderThickness="0" UseAeroCaptionButtons="False"/>
</WindowChrome.WindowChrome>
<Border BorderBrush="#555555" BorderThickness="1" CornerRadius="8" Background="#2D2D30">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="30"/>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<!-- Title Bar -->
<Border Grid.Row="0" Style="{StaticResource TitleBar}"
MouseLeftButtonDown="TitleBar_MouseLeftButtonDown">
<Grid>
<TextBlock Text="{Binding RelativeSource={RelativeSource AncestorType=Window}, Path=Title}"
Style="{StaticResource TitleBarText}"/>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
<Button x:Name="CloseButton" Style="{StaticResource TitleBarCloseButton}"
Click="CloseButton_Click" Content="&#xE8BB;"/>
</StackPanel>
</Grid>
</Border>
<!-- Content -->
<Grid Grid.Row="1" Margin="25">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<!-- Заголовок с иконкой -->
<StackPanel Orientation="Horizontal" Grid.Row="0" Margin="0,0,0,25">
<TextBlock Text="⚠️" FontSize="36" Margin="0,0,15,0" VerticalAlignment="Center"/>
@@ -74,5 +100,7 @@
Cursor="Hand"
Click="ExitButton_Click"/>
</StackPanel>
</Grid>
</Grid>
</Grid>
</Border>
</Window>