Skip to content

Commit

Permalink
Dark theme (#16)
Browse files Browse the repository at this point in the history
* use Microsoft.VisualStudio.Shell.14.0 for compatibility
* fix(ui): use brushkey to support themes fix #15
* proper Microsoft.VisualStudio.CoreUtility version
  • Loading branch information
MrLuje authored Oct 24, 2018
1 parent b4f4c6d commit 2c8cba5
Show file tree
Hide file tree
Showing 9 changed files with 127 additions and 67 deletions.
3 changes: 3 additions & 0 deletions paket.dependencies
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ group vs14
framework: auto-detect
source https://api.nuget.org/v3/index.json
nuget Microsoft.TeamFoundationServer.ExtendedClient 14.102.0 redirects: force, copy_local: false
nuget Microsoft.VisualStudio.CoreUtility 15.5.27130 copy_local: false # avoid Could not detect any platforms from 'UAP10' issue
nuget Microsoft.VisualStudio.Shell.14.0 ~> 14.0 copy_local: false
nuget Microsoft.VisualStudio.Shell.Immutable.10.0 < 15.0
nuget Microsoft.VisualStudio.Shell.Immutable.11.0 < 15.0
Expand All @@ -32,7 +33,9 @@ group vs14
group vs15
framework: auto-detect
source https://api.nuget.org/v3/index.json
nuget Microsoft.VisualStudio.CoreUtility 15.6.27740 copy_local: false # avoid Could not detect any platforms from 'UAP10' issue
nuget Microsoft.TeamFoundationServer.ExtendedClient 15.112.1 redirects: force, copy_local: false
nuget Microsoft.VisualStudio.Shell.14.0 ~> 14.0 copy_local: false
nuget Microsoft.VisualStudio.Shell.15.0 ~> 15.0 copy_local: false
nuget Microsoft.VisualStudio.Shell.Interop.12.0 ~> 12.0
nuget Microsoft.VisualStudio.Threading ~> 15.0
23 changes: 22 additions & 1 deletion paket.lock
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,19 @@ NUGET
Newtonsoft.Json (>= 8.0.3)
System.IdentityModel.Tokens.Jwt (>= 4.0.2.206221351)
WindowsAzure.ServiceBus (>= 3.3.2)
Microsoft.VisualStudio.Shell.14.0 (14.3.25407) - copy_local: false
Microsoft.VisualStudio.Imaging (>= 14.3.25407)
Microsoft.VisualStudio.OLE.Interop (>= 7.10.6070)
Microsoft.VisualStudio.Shell.Immutable.10.0 (>= 10.0.30319)
Microsoft.VisualStudio.Shell.Immutable.11.0 (>= 11.0.50727)
Microsoft.VisualStudio.Shell.Immutable.12.0 (>= 12.0.21003)
Microsoft.VisualStudio.Shell.Immutable.14.0 (>= 14.3.25407)
Microsoft.VisualStudio.Shell.Interop (>= 7.10.6071)
Microsoft.VisualStudio.Shell.Interop.8.0 (>= 8.0.50727)
Microsoft.VisualStudio.Shell.Interop.9.0 (>= 9.0.30729)
Microsoft.VisualStudio.TextManager.Interop (>= 7.10.6070)
Microsoft.VisualStudio.Threading (>= 14.1.111)
Microsoft.VisualStudio.Utilities (>= 14.3.25407)
Microsoft.VisualStudio.Shell.15.0 (15.6.27413) - copy_local: false
Microsoft.VisualStudio.Imaging (>= 15.6.27413)
Microsoft.VisualStudio.SDK.EmbedInteropTypes (>= 15.0.16)
Expand All @@ -267,6 +280,14 @@ NUGET
Microsoft.VisualStudio.CoreUtility (>= 15.6.27413)
Microsoft.VisualStudio.OLE.Interop (>= 7.10.6071)
Microsoft.VisualStudio.Utilities (>= 15.6.27413)
Microsoft.VisualStudio.Shell.Immutable.10.0 (15.0.25415) - copy_local: false
Microsoft.VisualStudio.Shell.Framework (>= 15.0.25415)
Microsoft.VisualStudio.Shell.Immutable.11.0 (15.0.25415) - copy_local: false
Microsoft.VisualStudio.Shell.Framework (>= 15.0.25415)
Microsoft.VisualStudio.Shell.Immutable.12.0 (15.0.25415) - copy_local: false
Microsoft.VisualStudio.Shell.Framework (>= 15.0.25415)
Microsoft.VisualStudio.Shell.Immutable.14.0 (15.0.25405) - copy_local: false
Microsoft.VisualStudio.Shell.Framework (>= 15.0.25405)
Microsoft.VisualStudio.Shell.Interop (7.10.6072) - copy_local: false
Microsoft.VisualStudio.TextManager.Interop (>= 7.10.6071)
Microsoft.VisualStudio.Shell.Interop.10.0 (10.0.30320)
Expand Down Expand Up @@ -301,7 +322,7 @@ NUGET
Microsoft.VisualStudio.Utilities (15.6.27413) - copy_local: false
Microsoft.VisualStudio.Threading (>= 15.4.4)
StreamJsonRpc (>= 1.2.8)
Microsoft.VisualStudio.Validation (15.3.32)
Microsoft.VisualStudio.Validation (15.3.32) - copy_local: false
Newtonsoft.Json (11.0.1) - copy_local: false, redirects: force
StreamJsonRpc (1.3.23) - copy_local: false
Microsoft.VisualStudio.Threading (>= 15.3.20)
Expand Down
3 changes: 2 additions & 1 deletion vs-commitizen.Tests/paket.references
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@ Xunit.StaFact

group vs15
Microsoft.TeamFoundationServer.ExtendedClient copy_local: true
Microsoft.VisualStudio.Shell.15.0 copy_local: true
Microsoft.VisualStudio.Shell.14.0 copy_local: true
# Microsoft.VisualStudio.Shell.15.0 copy_local: true
Microsoft.VisualStudio.Shell.Interop.12.0
52 changes: 31 additions & 21 deletions vs-commitizen.Tests/vs-commitizen.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -605,8 +605,8 @@
<Choose>
<When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And $(TargetFrameworkVersion) == 'v4.6.1'">
<ItemGroup>
<Reference Include="Microsoft.VisualStudio.Shell.15.0">
<HintPath>..\packages\vs15\Microsoft.VisualStudio.Shell.15.0\lib\net45\Microsoft.VisualStudio.Shell.15.0.dll</HintPath>
<Reference Include="Microsoft.VisualStudio.Shell.14.0">
<HintPath>..\packages\vs15\Microsoft.VisualStudio.Shell.14.0\lib\Microsoft.VisualStudio.Shell.14.0.dll</HintPath>
<Private>True</Private>
<Paket>True</Paket>
</Reference>
Expand All @@ -627,8 +627,8 @@
<Choose>
<When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And $(TargetFrameworkVersion) == 'v4.6.1'">
<ItemGroup>
<Reference Include="Microsoft.VisualStudio.Shell.Interop">
<HintPath>..\packages\vs15\Microsoft.VisualStudio.Shell.Interop\lib\net11\Microsoft.VisualStudio.Shell.Interop.dll</HintPath>
<Reference Include="Microsoft.VisualStudio.Shell.Immutable.10.0">
<HintPath>..\packages\vs15\Microsoft.VisualStudio.Shell.Immutable.10.0\lib\net45\Microsoft.VisualStudio.Shell.Immutable.10.0.dll</HintPath>
<Private>True</Private>
<Paket>True</Paket>
</Reference>
Expand All @@ -638,8 +638,8 @@
<Choose>
<When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And $(TargetFrameworkVersion) == 'v4.6.1'">
<ItemGroup>
<Reference Include="Microsoft.VisualStudio.Shell.Interop.10.0">
<HintPath>..\packages\vs15\Microsoft.VisualStudio.Shell.Interop.10.0\lib\net20\Microsoft.VisualStudio.Shell.Interop.10.0.dll</HintPath>
<Reference Include="Microsoft.VisualStudio.Shell.Immutable.11.0">
<HintPath>..\packages\vs15\Microsoft.VisualStudio.Shell.Immutable.11.0\lib\net45\Microsoft.VisualStudio.Shell.Immutable.11.0.dll</HintPath>
<Private>True</Private>
<Paket>True</Paket>
</Reference>
Expand All @@ -649,8 +649,8 @@
<Choose>
<When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And $(TargetFrameworkVersion) == 'v4.6.1'">
<ItemGroup>
<Reference Include="Microsoft.VisualStudio.Shell.Interop.11.0">
<HintPath>..\packages\vs15\Microsoft.VisualStudio.Shell.Interop.11.0\lib\net20\Microsoft.VisualStudio.Shell.Interop.11.0.dll</HintPath>
<Reference Include="Microsoft.VisualStudio.Shell.Immutable.12.0">
<HintPath>..\packages\vs15\Microsoft.VisualStudio.Shell.Immutable.12.0\lib\net45\Microsoft.VisualStudio.Shell.Immutable.12.0.dll</HintPath>
<Private>True</Private>
<Paket>True</Paket>
</Reference>
Expand All @@ -660,8 +660,8 @@
<Choose>
<When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And $(TargetFrameworkVersion) == 'v4.6.1'">
<ItemGroup>
<Reference Include="Microsoft.VisualStudio.Shell.Interop.12.0">
<HintPath>..\packages\vs15\Microsoft.VisualStudio.Shell.Interop.12.0\lib\net20\Microsoft.VisualStudio.Shell.Interop.12.0.dll</HintPath>
<Reference Include="Microsoft.VisualStudio.Shell.Immutable.14.0">
<HintPath>..\packages\vs15\Microsoft.VisualStudio.Shell.Immutable.14.0\lib\net45\Microsoft.VisualStudio.Shell.Immutable.14.0.dll</HintPath>
<Private>True</Private>
<Paket>True</Paket>
</Reference>
Expand All @@ -671,8 +671,8 @@
<Choose>
<When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And $(TargetFrameworkVersion) == 'v4.6.1'">
<ItemGroup>
<Reference Include="Microsoft.VisualStudio.Shell.Interop.15.3.DesignTime">
<HintPath>..\packages\vs15\Microsoft.VisualStudio.Shell.Interop.15.3.DesignTime\lib\net20\Microsoft.VisualStudio.Shell.Interop.15.3.DesignTime.dll</HintPath>
<Reference Include="Microsoft.VisualStudio.Shell.Interop">
<HintPath>..\packages\vs15\Microsoft.VisualStudio.Shell.Interop\lib\net11\Microsoft.VisualStudio.Shell.Interop.dll</HintPath>
<Private>True</Private>
<Paket>True</Paket>
</Reference>
Expand All @@ -682,8 +682,8 @@
<Choose>
<When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And $(TargetFrameworkVersion) == 'v4.6.1'">
<ItemGroup>
<Reference Include="Microsoft.VisualStudio.Shell.Interop.15.6.DesignTime">
<HintPath>..\packages\vs15\Microsoft.VisualStudio.Shell.Interop.15.6.DesignTime\lib\net20\Microsoft.VisualStudio.Shell.Interop.15.6.DesignTime.dll</HintPath>
<Reference Include="Microsoft.VisualStudio.Shell.Interop.10.0">
<HintPath>..\packages\vs15\Microsoft.VisualStudio.Shell.Interop.10.0\lib\net20\Microsoft.VisualStudio.Shell.Interop.10.0.dll</HintPath>
<Private>True</Private>
<Paket>True</Paket>
</Reference>
Expand All @@ -693,8 +693,8 @@
<Choose>
<When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And $(TargetFrameworkVersion) == 'v4.6.1'">
<ItemGroup>
<Reference Include="Microsoft.VisualStudio.Shell.Interop.8.0">
<HintPath>..\packages\vs15\Microsoft.VisualStudio.Shell.Interop.8.0\lib\net11\Microsoft.VisualStudio.Shell.Interop.8.0.dll</HintPath>
<Reference Include="Microsoft.VisualStudio.Shell.Interop.11.0">
<HintPath>..\packages\vs15\Microsoft.VisualStudio.Shell.Interop.11.0\lib\net20\Microsoft.VisualStudio.Shell.Interop.11.0.dll</HintPath>
<Private>True</Private>
<Paket>True</Paket>
</Reference>
Expand All @@ -704,8 +704,19 @@
<Choose>
<When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And $(TargetFrameworkVersion) == 'v4.6.1'">
<ItemGroup>
<Reference Include="Microsoft.VisualStudio.Shell.Interop.9.0">
<HintPath>..\packages\vs15\Microsoft.VisualStudio.Shell.Interop.9.0\lib\net11\Microsoft.VisualStudio.Shell.Interop.9.0.dll</HintPath>
<Reference Include="Microsoft.VisualStudio.Shell.Interop.12.0">
<HintPath>..\packages\vs15\Microsoft.VisualStudio.Shell.Interop.12.0\lib\net20\Microsoft.VisualStudio.Shell.Interop.12.0.dll</HintPath>
<Private>True</Private>
<Paket>True</Paket>
</Reference>
</ItemGroup>
</When>
</Choose>
<Choose>
<When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And $(TargetFrameworkVersion) == 'v4.6.1'">
<ItemGroup>
<Reference Include="Microsoft.VisualStudio.Shell.Interop.8.0">
<HintPath>..\packages\vs15\Microsoft.VisualStudio.Shell.Interop.8.0\lib\net11\Microsoft.VisualStudio.Shell.Interop.8.0.dll</HintPath>
<Private>True</Private>
<Paket>True</Paket>
</Reference>
Expand All @@ -715,8 +726,8 @@
<Choose>
<When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And $(TargetFrameworkVersion) == 'v4.6.1'">
<ItemGroup>
<Reference Include="Microsoft.VisualStudio.Text.Data">
<HintPath>..\packages\vs15\Microsoft.VisualStudio.Text.Data\lib\net46\Microsoft.VisualStudio.Text.Data.dll</HintPath>
<Reference Include="Microsoft.VisualStudio.Shell.Interop.9.0">
<HintPath>..\packages\vs15\Microsoft.VisualStudio.Shell.Interop.9.0\lib\net11\Microsoft.VisualStudio.Shell.Interop.9.0.dll</HintPath>
<Private>True</Private>
<Paket>True</Paket>
</Reference>
Expand Down Expand Up @@ -761,7 +772,6 @@
</Choose>
<Import Project="..\packages\xunit.core\build\xunit.core.targets" Condition="Exists('..\packages\xunit.core\build\xunit.core.targets')" Label="Paket" />
<Import Project="..\packages\vs15\Microsoft.TeamFoundationServer.ExtendedClient\build\Microsoft.TeamFoundationServer.ExtendedClient.targets" Condition="Exists('..\packages\vs15\Microsoft.TeamFoundationServer.ExtendedClient\build\Microsoft.TeamFoundationServer.ExtendedClient.targets')" Label="Paket" />
<Import Project="..\packages\vs15\Microsoft.VisualStudio.SDK.EmbedInteropTypes\build\Microsoft.VisualStudio.SDK.EmbedInteropTypes.targets" Condition="Exists('..\packages\vs15\Microsoft.VisualStudio.SDK.EmbedInteropTypes\build\Microsoft.VisualStudio.SDK.EmbedInteropTypes.targets')" Label="Paket" />
<Import Project="..\packages\vs15\Microsoft.VisualStudio.Threading.Analyzers\build\Microsoft.VisualStudio.Threading.Analyzers.targets" Condition="Exists('..\packages\vs15\Microsoft.VisualStudio.Threading.Analyzers\build\Microsoft.VisualStudio.Threading.Analyzers.targets')" Label="Paket" />
<ItemGroup>
<Analyzer Include="..\packages\vs15\Microsoft.VisualStudio.Threading.Analyzers\analyzers\cs\Microsoft.VisualStudio.Threading.Analyzers.dll">
Expand Down
22 changes: 13 additions & 9 deletions vs-commitizen.vs2015/Controls/TextBoxWithHint.xaml
Original file line number Diff line number Diff line change
@@ -1,24 +1,28 @@
<UserControl x:Class="vs_commitizen.vs2015.Controls.TextBoxWithHint"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:vs_commitizen.vs2015.Controls"
mc:Ignorable="d" >
xmlns:platformUi="clr-namespace:Microsoft.VisualStudio.PlatformUI;assembly=Microsoft.VisualStudio.Shell.14.0"
mc:Ignorable="d">
<UserControl.Resources>
<BooleanToVisibilityConverter x:Key="MyBoolToVisibilityConverter" />
</UserControl.Resources>
<Grid Background="White" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
<Grid Background="{DynamicResource {x:Static platformUi:CommonControlsColors.TextBoxBackgroundBrushKey}}" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
<!-- overlay with hint text -->
<TextBlock Margin="5,0,5,0" Text="{Binding Path=HintText}"
Foreground="LightSteelBlue"
<TextBlock Margin="5,0,5,0" Text="{Binding Path=HintText}"
Foreground="LightSteelBlue"
Visibility="{Binding ElementName=txtInputBox, Path=Text.IsEmpty, Converter={StaticResource MyBoolToVisibilityConverter}}"
HorizontalAlignment="Stretch"
VerticalAlignment="Center" />
<!-- enter term here -->
<TextBox Name="txtInputBox" Background="Transparent" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
AcceptsReturn="{Binding Path=AcceptReturn, RelativeSource={RelativeSource FindAncestor,AncestorType={x:Type UserControl}}}"
Text="{Binding Path=Text, UpdateSourceTrigger=PropertyChanged, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}}"
MaxLength="{Binding Path=MaxLength, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}}" />
Text="{Binding Path=Text, UpdateSourceTrigger=PropertyChanged, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}}"
MaxLength="{Binding Path=MaxLength, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}}"
Foreground="{DynamicResource {x:Static platformUi:CommonControlsColors.TextBoxTextBrushKey}}"
GotFocus="TxtInputBox_OnGotFocus">
</TextBox>
</Grid>
</UserControl>
</UserControl>
5 changes: 5 additions & 0 deletions vs-commitizen.vs2015/Controls/TextBoxWithHint.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,5 +53,10 @@ private void OnPropertyChanged([CallerMemberName] string propertyName = null)
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
}
public event PropertyChangedEventHandler PropertyChanged;

private void TxtInputBox_OnGotFocus(object sender, RoutedEventArgs e)
{
((TextBox)sender).SelectAll();
}
}
}
Loading

0 comments on commit 2c8cba5

Please sign in to comment.