Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vs2013 theme improvement #284

Merged
merged 8 commits into from
Aug 9, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Created test project.
  • Loading branch information
oktrue committed Jun 22, 2021
commit d16dd36cd55c36a090fb30ba37e82c2ba1df1597
19 changes: 17 additions & 2 deletions source/AvalonDock.sln
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AvalonDock.Themes.Aero", "C
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "AutomationTest", "AutomationTest", "{20876020-CC7D-46BD-9B80-E4F01FC0FD31}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AvalonDockTest", "AutomationTest\AvalonDockTest\AvalonDockTest.csproj", "{FE4E16A2-876A-4356-9974-8A89C50B2A5A}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AvalonDockTest", "AutomationTest\AvalonDockTest\AvalonDockTest.csproj", "{FE4E16A2-876A-4356-9974-8A89C50B2A5A}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ServiceLocator", "MLibTest\MLibTest_Components\ServiceLocator\ServiceLocator.csproj", "{38F7F15D-2F13-49E4-B4E6-B9552072AFCD}"
EndProject
Expand All @@ -40,7 +40,9 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WinFormsTestApp", "WinForms
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AvalonDocPanelMemoryLeaks", "AvalonDocPanelMemoryLeaks\AvalonDocPanelMemoryLeaks.csproj", "{5543BFED-827A-4404-8066-3FFDB201DDF0}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CaliburnDockTestApp", "CaliburnDockTestApp\CaliburnDockTestApp.csproj", "{F8AEE594-DB5E-4DB8-9F45-4969CA5F8EF1}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CaliburnDockTestApp", "CaliburnDockTestApp\CaliburnDockTestApp.csproj", "{F8AEE594-DB5E-4DB8-9F45-4969CA5F8EF1}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VS2013Test", "VS2013Test\VS2013Test.csproj", "{12C5DFE9-27AE-4BAB-9050-617F8A7FC52E}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down Expand Up @@ -244,6 +246,18 @@ Global
{F8AEE594-DB5E-4DB8-9F45-4969CA5F8EF1}.Release|x64.Build.0 = Release|Any CPU
{F8AEE594-DB5E-4DB8-9F45-4969CA5F8EF1}.Release|x86.ActiveCfg = Release|Any CPU
{F8AEE594-DB5E-4DB8-9F45-4969CA5F8EF1}.Release|x86.Build.0 = Release|Any CPU
{12C5DFE9-27AE-4BAB-9050-617F8A7FC52E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{12C5DFE9-27AE-4BAB-9050-617F8A7FC52E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{12C5DFE9-27AE-4BAB-9050-617F8A7FC52E}.Debug|x64.ActiveCfg = Debug|Any CPU
{12C5DFE9-27AE-4BAB-9050-617F8A7FC52E}.Debug|x64.Build.0 = Debug|Any CPU
{12C5DFE9-27AE-4BAB-9050-617F8A7FC52E}.Debug|x86.ActiveCfg = Debug|Any CPU
{12C5DFE9-27AE-4BAB-9050-617F8A7FC52E}.Debug|x86.Build.0 = Debug|Any CPU
{12C5DFE9-27AE-4BAB-9050-617F8A7FC52E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{12C5DFE9-27AE-4BAB-9050-617F8A7FC52E}.Release|Any CPU.Build.0 = Release|Any CPU
{12C5DFE9-27AE-4BAB-9050-617F8A7FC52E}.Release|x64.ActiveCfg = Release|Any CPU
{12C5DFE9-27AE-4BAB-9050-617F8A7FC52E}.Release|x64.Build.0 = Release|Any CPU
{12C5DFE9-27AE-4BAB-9050-617F8A7FC52E}.Release|x86.ActiveCfg = Release|Any CPU
{12C5DFE9-27AE-4BAB-9050-617F8A7FC52E}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand All @@ -267,6 +281,7 @@ Global
{2433B8AF-0788-4C86-8FDD-E3BCB62E2157} = {1D267DDB-F2DE-4B70-87C1-E93A0C2D73F4}
{5543BFED-827A-4404-8066-3FFDB201DDF0} = {1D267DDB-F2DE-4B70-87C1-E93A0C2D73F4}
{F8AEE594-DB5E-4DB8-9F45-4969CA5F8EF1} = {1D267DDB-F2DE-4B70-87C1-E93A0C2D73F4}
{12C5DFE9-27AE-4BAB-9050-617F8A7FC52E} = {1D267DDB-F2DE-4B70-87C1-E93A0C2D73F4}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {459B8289-CF04-4E70-AEC9-23DC3A6E66F6}
Expand Down
10 changes: 10 additions & 0 deletions source/VS2013Test/App.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<Application x:Class="VS2013Test.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:VS2013Test"
StartupUri="MainView.xaml">

<Application.Resources>

</Application.Resources>
</Application>
17 changes: 17 additions & 0 deletions source/VS2013Test/App.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Threading.Tasks;
using System.Windows;

namespace VS2013Test
{
/// <summary>
/// Interaction logic for App.xaml
/// </summary>
public partial class App : Application
{
}
}
10 changes: 10 additions & 0 deletions source/VS2013Test/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
using System.Windows;

[assembly: ThemeInfo(
ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
//(used if a resource is not found in the page,
// or application resource dictionaries)
ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
//(used if a resource is not found in the page,
// app, or any theme specific resource dictionaries)
)]
209 changes: 209 additions & 0 deletions source/VS2013Test/MainView.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,209 @@
<Window x:Class="VS2013Test.MainView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:VS2013Test"
mc:Ignorable="d"
Title="VS2013Test" MinWidth="140" MinHeight="34" MaxHeight="{x:Static SystemParameters.MaximizedPrimaryScreenHeight}" Height="450" Width="800" SnapsToDevicePixels="True" Foreground="White" Background="#2d2d30" BorderThickness="1" WindowStyle="None" ResizeMode="CanResize">

<Window.DataContext>
<local:MainViewModel/>
</Window.DataContext>

<WindowChrome.WindowChrome>
<WindowChrome CaptionHeight="33" ResizeBorderThickness="8" CornerRadius="0" GlassFrameThickness="0" NonClientFrameEdges="None" />
</WindowChrome.WindowChrome>

<Window.Resources>
<Style x:Key="CloseButton" TargetType="{x:Type Button}">
<Setter Property="FocusVisualStyle" Value="{x:Null}"/>
<Setter Property="IsTabStop" Value="False"/>
<Setter Property="Focusable" Value="False"/>
<Setter Property="ToolTip" Value="Close"/>
<Setter Property="Background" Value="{Binding Background, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}}"/>
<Setter Property="Foreground" Value="White"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Button}">
<Border Background="{TemplateBinding Background}">
<Path Width="46" Height="32" StrokeThickness="1" Stroke="{TemplateBinding Foreground}" Data="M 18,11 27,20 M 18,20 27,11"/>
</Border>

<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="#393939"/>
</Trigger>
<Trigger Property="IsPressed" Value="true">
<Setter Property="Background" Value="#1982C4"/>
</Trigger>
<DataTrigger Binding="{Binding IsActive, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}}" Value="False">
<Setter Property="Foreground" Value="#818181" />
</DataTrigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>

<Style x:Key="MaximizeButton" TargetType="{x:Type Button}">
<Setter Property="FocusVisualStyle" Value="{x:Null}"/>
<Setter Property="ToolTip" Value="Maximize"/>
<Setter Property="IsTabStop" Value="False"/>
<Setter Property="Focusable" Value="False"/>
<Setter Property="Background" Value="{Binding Background, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}}"/>
<Setter Property="Foreground" Value="White"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Button}">
<Border Background="{TemplateBinding Background}">
<Path x:Name="MaximizePath" Width="46" Height="32" Data="M 18.5,10.5 H 27.5 V 19.5 H 18.5 Z" Stroke="{TemplateBinding Foreground}" StrokeThickness="1" />
</Border>

<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="#393939"/>
</Trigger>
<Trigger Property="IsPressed" Value="true">
<Setter Property="Background" Value="#1982C4"/>
</Trigger>
<DataTrigger Binding="{Binding WindowState, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}}" Value="Maximized">
<Setter Property="Visibility" Value="Collapsed"/>
</DataTrigger>
<DataTrigger Binding="{Binding IsActive, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}}" Value="False">
<Setter Property="Foreground" Value="#818181" />
</DataTrigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>

<!--Прямоугольная кнопка нормального режима на панели состояния-->
<Style x:Key="RestoreDownButton" TargetType="{x:Type Button}">
<Setter Property="Visibility" Value="Collapsed"/>
<Setter Property="FocusVisualStyle" Value="{x:Null}"/>
<Setter Property="IsTabStop" Value="False"/>
<Setter Property="Focusable" Value="False"/>
<Setter Property="ToolTip" Value="Restore Down"/>
<Setter Property="Background" Value="{Binding Background, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}}"/>
<Setter Property="Foreground" Value="White"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Button}">
<Border Background="{TemplateBinding Background}">
<Path x:Name="RestoreDownPath" Width="46" Height="32" Data="M 18.5,12.5 H 25.5 V 19.5 H 18.5 Z M 20.5,12.5 V 10.5 H 27.5 V 17.5 H 25.5" Stroke="{TemplateBinding Foreground}" StrokeThickness="1" />
</Border>

<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="#393939"/>
</Trigger>
<Trigger Property="IsPressed" Value="true">
<Setter Property="Background" Value="#1982C4"/>
</Trigger>
<DataTrigger Binding="{Binding WindowState, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}}" Value="Maximized">
<Setter Property="Visibility" Value="Visible"/>
</DataTrigger>
<DataTrigger Binding="{Binding IsActive, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}}" Value="False">
<Setter Property="Foreground" Value="#818181" />
</DataTrigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>

<!--Прямоугольная кнопка сворачивания на панели состояния-->
<Style x:Key="MinimizeButton" TargetType="{x:Type Button}">
<Setter Property="FocusVisualStyle" Value="{x:Null}"/>
<Setter Property="RenderOptions.EdgeMode" Value="Aliased"/>
<Setter Property="IsTabStop" Value="False"/>
<Setter Property="Focusable" Value="False"/>
<Setter Property="ToolTip" Value="Minimize"/>
<Setter Property="Background" Value="{Binding Background, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}}"/>
<Setter Property="Foreground" Value="White"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Button}">
<Border Background="{TemplateBinding Background}">
<Path Width="46" Height="32" StrokeThickness="1" Stroke="{TemplateBinding Foreground}" Data="M 18,15 H 28"/>
</Border>

<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="#393939"/>
</Trigger>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="IsMouseOver" Value="True" />
<Condition Property="IsPressed" Value="True" />
</MultiTrigger.Conditions>
<MultiTrigger.Setters>
<Setter Property="Background" Value="#1982C4"/>
</MultiTrigger.Setters>
</MultiTrigger>
<DataTrigger Binding="{Binding IsActive, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}}" Value="False">
<Setter Property="Foreground" Value="#818181" />
</DataTrigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</Window.Resources>

<Window.Style>
<Style TargetType="{x:Type Window}">
<Setter Property="BorderBrush" Value="#1982C4" />
<Style.Triggers>
<Trigger Property="IsActive" Value="False">
<Setter Property="BorderBrush" Value="#3F3F46"/>
</Trigger>
</Style.Triggers>
</Style>
</Window.Style>

<Grid>
<Grid.Style>
<Style TargetType="{x:Type Grid}">
<Style.Triggers>
<DataTrigger Binding="{Binding WindowState, RelativeSource={RelativeSource AncestorType=Window}}" Value="Maximized">
<Setter Property="Margin" Value="6,6,6,8" />
</DataTrigger>
</Style.Triggers>
</Style>
</Grid.Style>

<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>

<TextBlock Text="VS2013 DEMO" Margin="8,0" VerticalAlignment="Center" HorizontalAlignment="Left">
<TextBlock.Style>
<Style TargetType="{x:Type TextBlock}">
<Style.Triggers>
<DataTrigger Binding="{Binding IsActive, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}}" Value="False">
<Setter Property="Foreground" Value="#818181" />
</DataTrigger>
</Style.Triggers>
</Style>
</TextBlock.Style>
</TextBlock>

<StackPanel Orientation="Horizontal" HorizontalAlignment="Right" WindowChrome.IsHitTestVisibleInChrome="True">
<Button Style="{StaticResource MinimizeButton}" Click="MinimizeClick" />
<Button Style="{StaticResource MaximizeButton}" Click="MaximizeClick" />
<Button Style="{StaticResource RestoreDownButton}" Click="RestoreDownClick" />
<Button Style="{StaticResource CloseButton}" Click="CloseClick" />
</StackPanel>

<Border Grid.Row="2" Height="23" Background="#1982C4">
<Grid>
<TextBlock Text="Ready" VerticalAlignment="Center" Margin="6,0,0,0" />
</Grid>
</Border>
</Grid>
</Window>
48 changes: 48 additions & 0 deletions source/VS2013Test/MainView.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace VS2013Test
{
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainView : Window
{
public MainView()
{
InitializeComponent();
}

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

private void MaximizeClick(object sender, RoutedEventArgs e)
{
WindowState = WindowState.Maximized;
}

private void RestoreDownClick(object sender, RoutedEventArgs e)
{
WindowState = WindowState.Normal;
}

private void CloseClick(object sender, RoutedEventArgs e)
{
Close();
}
}
}
12 changes: 12 additions & 0 deletions source/VS2013Test/MainViewModel.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace VS2013Test
{
public class MainViewModel
{
}
}
13 changes: 13 additions & 0 deletions source/VS2013Test/VS2013Test.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net5.0-windows</TargetFramework>
<UseWPF>true</UseWPF>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\Components\AvalonDock.Themes.VS2013\AvalonDock.Themes.VS2013.csproj" />
</ItemGroup>

</Project>