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
Prev Previous commit
Next Next commit
Added MLib dependency. Fixed caption height.
  • Loading branch information
oktrue committed Jun 26, 2021
commit a57c14298cad4d47fed639c5e63309504ea46e73
2 changes: 2 additions & 0 deletions source/VS2013Test/App.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/MLib;component/Themes/DarkTheme.xaml" />
<ResourceDictionary Source="pack://application:,,,/VS2013Test;component/Themes/DarkBrushsExtended.xaml" />
<ResourceDictionary Source="pack://application:,,,/VS2013Test;component/Themes/Generic.xaml" />
<ResourceDictionary Source="pack://application:,,,/VS2013Test;component/Themes/Controls/VsResizeGrip.xaml" />

<ResourceDictionary>
<BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" />
Expand Down
45 changes: 15 additions & 30 deletions source/VS2013Test/LayoutInitializer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,50 +12,36 @@ public bool BeforeInsertAnchorable(LayoutRoot layout, LayoutAnchorable anchorabl
//just for test provide a new anchorablepane
//if the pane is floating let the manager go ahead
LayoutAnchorablePane destPane = destinationContainer as LayoutAnchorablePane;
anchorableToShow.AutoHideWidth = 256;
anchorableToShow.AutoHideHeight = 128;

if (destinationContainer != null && destinationContainer.FindParent<LayoutFloatingWindow>() != null)
return false;

if (anchorableToShow.Content is ExplorerViewModel)
{
anchorableToShow.AutoHideWidth = 256;
var explorerPane = layout.Descendents().OfType<LayoutAnchorablePane>().FirstOrDefault(d => d.Name == "ExplorerPane");

var treeViewPane = layout.Descendents().OfType<LayoutAnchorablePane>().FirstOrDefault(d => d.Name == "ExplorerPane");

if (treeViewPane != null)
if (explorerPane != null)
{
treeViewPane.Children.Add(anchorableToShow);
explorerPane.Children.Add(anchorableToShow);
return true;
}
}

if (anchorableToShow.Content is PropertiesViewModel)
{
var propertiesPane = layout.Descendents().OfType<LayoutAnchorablePane>().FirstOrDefault(d => d.Name == "PropertiesPane");

if (propertiesPane != null)
{
propertiesPane.Children.Add(anchorableToShow);
return true;
}
}

if (anchorableToShow.Content is FileStatsViewModel)
{
anchorableToShow.AutoHideWidth = 256;

var controllerPane = layout.Descendents().OfType<LayoutAnchorablePane>().FirstOrDefault(d => d.Name == "FileStatsPane");

if (controllerPane != null)
{
controllerPane.Children.Add(anchorableToShow);
return true;
}
}

if (anchorableToShow.Content is OutputViewModel)
{
anchorableToShow.AutoHideHeight = 128;

var outputPane = layout.Descendents().OfType<LayoutAnchorablePane>().FirstOrDefault(d => d.Name == "OutputPane");

if (outputPane != null)
Expand All @@ -69,9 +55,6 @@ public bool BeforeInsertAnchorable(LayoutRoot layout, LayoutAnchorable anchorabl
{
var leftGroup = new LayoutAnchorGroup();
leftGroup.Children.Add(anchorableToShow);

anchorableToShow.AutoHideWidth = 256;

layout.LeftSide.Children.Add(leftGroup);
return true;
}
Expand All @@ -80,21 +63,23 @@ public bool BeforeInsertAnchorable(LayoutRoot layout, LayoutAnchorable anchorabl
{
var rightGroup = new LayoutAnchorGroup();
rightGroup.Children.Add(anchorableToShow);

anchorableToShow.AutoHideWidth = 256;

layout.RightSide.Children.Add(rightGroup);
return true;
}

if (anchorableToShow.Content is ErrorViewModel)
{
var bottomGroup = new LayoutAnchorGroup();
bottomGroup.Children.Add(anchorableToShow);
//var errorsPane = layout.Descendents().OfType<LayoutAnchorablePane>().FirstOrDefault(d => d.Name == "ErrorsPane");

anchorableToShow.AutoHideWidth = 256;
anchorableToShow.AutoHideHeight = 128;
//if (errorsPane != null)
//{
// errorsPane.Children.Add(anchorableToShow);
// anchorableToShow.Hide(false);
// return true;
//}

var bottomGroup = new LayoutAnchorGroup();
bottomGroup.Children.Add(anchorableToShow);
layout.BottomSide.Children.Add(bottomGroup);
return true;
}
Expand Down
9 changes: 0 additions & 9 deletions source/VS2013Test/PanesTemplateSelector.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,6 @@ public DataTemplate FileViewTemplate
set;
}

public DataTemplate FileStatsViewTemplate
{
get;
set;
}

public DataTemplate PropertiesViewTemplate
{
get;
Expand Down Expand Up @@ -66,9 +60,6 @@ public override DataTemplate SelectTemplate(object item, DependencyObject contai
if (item is FileViewModel)
return FileViewTemplate;

if (item is FileStatsViewModel)
return FileStatsViewTemplate;

if (item is PropertiesViewModel)
return PropertiesViewTemplate;

Expand Down
9 changes: 6 additions & 3 deletions source/VS2013Test/Themes/BlueBrushsExtended.xaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:MLib_reskeys="clr-namespace:MLib.Themes;assembly=MLib">

<SolidColorBrush x:Key="IconBrush" Color="#854CC7" />
<SolidColorBrush x:Key="IconInactiveBrush" Color="#98A3C6" />
Expand All @@ -15,7 +16,9 @@
<SolidColorBrush x:Key="WindowBorderBrush" Color="#1F3C76" />
<SolidColorBrush x:Key="WindowInactiveBorderBrush" Color="#515151" />
<SolidColorBrush x:Key="ToolBarGripper" Color="#3A4470" />
<SolidColorBrush x:Key="ProjectNameForeground" Color="#40508D" />
<SolidColorBrush x:Key="ProjectNameInactiveForeground" Color="#A3ABCA" />
<SolidColorBrush x:Key="ProjectNameForeground" Color="#FF40568D" />
<SolidColorBrush x:Key="ProjectNameInactiveForeground" Color="#664C5787" />
<SolidColorBrush x:Key="ProjectNameBackground" Color="#D9E0F8" />
<SolidColorBrush x:Key="{ComponentResourceKey TypeInTargetAssembly={x:Type MLib_reskeys:ResourceKeys}, ResourceId=NormalBackgroundBrushKey}" Color="Transparent" />
<SolidColorBrush x:Key="{ComponentResourceKey TypeInTargetAssembly={x:Type MLib_reskeys:ResourceKeys}, ResourceId=TopLevelHeaderMenuBackgroundKey}" Color="Transparent" />
</ResourceDictionary>
48 changes: 48 additions & 0 deletions source/VS2013Test/Themes/Controls/VsResizeGrip.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:s="clr-namespace:System;assembly=mscorlib">

<Style TargetType="ResizeGrip">
<Setter Property="UIElement.Focusable">
<Setter.Value>
<s:Boolean>False</s:Boolean>
</Setter.Value>
</Setter>

<Setter Property="Control.Template">
<Setter.Value>
<ControlTemplate TargetType="ResizeGrip">
<Grid Background="#00FFFFFF" x:Uid="Grid_1" SnapsToDevicePixels="True">
<Canvas Width="8" Height="8" Margin="5,5,5,5" Opacity="0.5" x:Uid="Canvas_1">
<Canvas Width="7" Height="7" Margin="1,1,0,0" x:Uid="Canvas_2">
<Rectangle Width="1" Height="1" x:Uid="Rectangle_1" Canvas.Left="6" Canvas.Top="6" Fill="White"/>
<Rectangle Width="1" Height="1" x:Uid="Rectangle_2" Canvas.Left="4" Canvas.Top="6" Fill="White"/>
<Rectangle Width="1" Height="1" x:Uid="Rectangle_3" Canvas.Left="2" Canvas.Top="6" Fill="White"/>
<Rectangle Width="1" Height="1" x:Uid="Rectangle_4" Canvas.Left="0" Canvas.Top="6" Fill="White"/>
<Rectangle Width="1" Height="1" x:Uid="Rectangle_5" Canvas.Left="6" Canvas.Top="4" Fill="White"/>
<Rectangle Width="1" Height="1" x:Uid="Rectangle_6" Canvas.Left="6" Canvas.Top="2" Fill="White"/>
<Rectangle Width="1" Height="1" x:Uid="Rectangle_7" Canvas.Left="6" Canvas.Top="0" Fill="White"/>
<Rectangle Width="1" Height="1" x:Uid="Rectangle_8" Canvas.Left="4" Canvas.Top="2" Fill="White"/>
<Rectangle Width="1" Height="1" x:Uid="Rectangle_9" Canvas.Left="2" Canvas.Top="4" Fill="White"/>
<Rectangle Width="1" Height="1" x:Uid="Rectangle_10" Canvas.Left="4" Canvas.Top="4" Fill="White"/>
</Canvas>

<Canvas Width="7" Height="7" Margin="0,0,0,0" x:Uid="Canvas_3">
<Rectangle Width="1" Height="1" x:Uid="Rectangle_11" Canvas.Left="6" Canvas.Top="6" Fill="#7F000000"/>
<Rectangle Width="1" Height="1" x:Uid="Rectangle_12" Canvas.Left="4" Canvas.Top="6" Fill="#7F000000"/>
<Rectangle Width="1" Height="1" x:Uid="Rectangle_13" Canvas.Left="2" Canvas.Top="6" Fill="#7F000000"/>
<Rectangle Width="1" Height="1" x:Uid="Rectangle_14" Canvas.Left="0" Canvas.Top="6" Fill="#7F000000"/>
<Rectangle Width="1" Height="1" x:Uid="Rectangle_15" Canvas.Left="6" Canvas.Top="4" Fill="#7F000000"/>
<Rectangle Width="1" Height="1" x:Uid="Rectangle_16" Canvas.Left="6" Canvas.Top="2" Fill="#7F000000"/>
<Rectangle Width="1" Height="1" x:Uid="Rectangle_17" Canvas.Left="6" Canvas.Top="0" Fill="#7F000000"/>
<Rectangle Width="1" Height="1" x:Uid="Rectangle_18" Canvas.Left="4" Canvas.Top="2" Fill="#7F000000"/>
<Rectangle Width="1" Height="1" x:Uid="Rectangle_19" Canvas.Left="2" Canvas.Top="4" Fill="#7F000000"/>
<Rectangle Width="1" Height="1" x:Uid="Rectangle_20" Canvas.Left="4" Canvas.Top="4" Fill="#7F000000"/>
</Canvas>
</Canvas>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>
7 changes: 5 additions & 2 deletions source/VS2013Test/Themes/DarkBrushsExtended.xaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:MLib_reskeys="clr-namespace:MLib.Themes;assembly=MLib">

<SolidColorBrush x:Key="IconBrush" Color="White" />
<SolidColorBrush x:Key="IconInactiveBrush" Color="#818183" />
<SolidColorBrush x:Key="IconInactiveBrush" Color="#66FFFFFF" />
<SolidColorBrush x:Key="HeaderBackground" Color="#2D2D30" />
<SolidColorBrush x:Key="StatusBarBackground" Color="#007ACC" />
<SolidColorBrush x:Key="StatusBarForeground" Color="White" />
Expand All @@ -18,4 +19,6 @@
<SolidColorBrush x:Key="ProjectNameForeground" Color="White" />
<SolidColorBrush x:Key="ProjectNameInactiveForeground" Color="#818181" />
<SolidColorBrush x:Key="ProjectNameBackground" Color="#252526" />
<SolidColorBrush x:Key="{ComponentResourceKey TypeInTargetAssembly={x:Type MLib_reskeys:ResourceKeys}, ResourceId=NormalBackgroundBrushKey}" Color="Transparent" />
<SolidColorBrush x:Key="{ComponentResourceKey TypeInTargetAssembly={x:Type MLib_reskeys:ResourceKeys}, ResourceId=TopLevelHeaderMenuBackgroundKey}" Color="Transparent" />
</ResourceDictionary>
5 changes: 4 additions & 1 deletion source/VS2013Test/Themes/LightBrushsExtended.xaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:MLib_reskeys="clr-namespace:MLib.Themes;assembly=MLib">

<SolidColorBrush x:Key="IconBrush" Color="#865FC5" />
<SolidColorBrush x:Key="IconInactiveBrush" Color="#8F8F91" />
Expand All @@ -18,4 +19,6 @@
<SolidColorBrush x:Key="ProjectNameForeground" Color="Black" />
<SolidColorBrush x:Key="ProjectNameInactiveForeground" Color="#929496" />
<SolidColorBrush x:Key="ProjectNameBackground" Color="#E0E3E6" />
<SolidColorBrush x:Key="{ComponentResourceKey TypeInTargetAssembly={x:Type MLib_reskeys:ResourceKeys}, ResourceId=NormalBackgroundBrushKey}" Color="Transparent" />
<SolidColorBrush x:Key="{ComponentResourceKey TypeInTargetAssembly={x:Type MLib_reskeys:ResourceKeys}, ResourceId=TopLevelHeaderMenuBackgroundKey}" Color="Transparent" />
</ResourceDictionary>
4 changes: 4 additions & 0 deletions source/VS2013Test/VS2013Test.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
<UseWPF>true</UseWPF>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Dirkster.MLib" Version="1.3.1.2" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Components\AvalonDock.Themes.VS2013\AvalonDock.Themes.VS2013.csproj" />
</ItemGroup>
Expand Down
109 changes: 0 additions & 109 deletions source/VS2013Test/ViewModels/FileStatsViewModel.cs

This file was deleted.

Loading