Skip to content

Commit 2c8cba5

Browse files
authored
Dark theme (#16)
* use Microsoft.VisualStudio.Shell.14.0 for compatibility * fix(ui): use brushkey to support themes fix #15 * proper Microsoft.VisualStudio.CoreUtility version
1 parent b4f4c6d commit 2c8cba5

File tree

9 files changed

+127
-67
lines changed

9 files changed

+127
-67
lines changed

paket.dependencies

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ group vs14
2121
framework: auto-detect
2222
source https://api.nuget.org/v3/index.json
2323
nuget Microsoft.TeamFoundationServer.ExtendedClient 14.102.0 redirects: force, copy_local: false
24+
nuget Microsoft.VisualStudio.CoreUtility 15.5.27130 copy_local: false # avoid Could not detect any platforms from 'UAP10' issue
2425
nuget Microsoft.VisualStudio.Shell.14.0 ~> 14.0 copy_local: false
2526
nuget Microsoft.VisualStudio.Shell.Immutable.10.0 < 15.0
2627
nuget Microsoft.VisualStudio.Shell.Immutable.11.0 < 15.0
@@ -32,7 +33,9 @@ group vs14
3233
group vs15
3334
framework: auto-detect
3435
source https://api.nuget.org/v3/index.json
36+
nuget Microsoft.VisualStudio.CoreUtility 15.6.27740 copy_local: false # avoid Could not detect any platforms from 'UAP10' issue
3537
nuget Microsoft.TeamFoundationServer.ExtendedClient 15.112.1 redirects: force, copy_local: false
38+
nuget Microsoft.VisualStudio.Shell.14.0 ~> 14.0 copy_local: false
3639
nuget Microsoft.VisualStudio.Shell.15.0 ~> 15.0 copy_local: false
3740
nuget Microsoft.VisualStudio.Shell.Interop.12.0 ~> 12.0
3841
nuget Microsoft.VisualStudio.Threading ~> 15.0

paket.lock

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,19 @@ NUGET
254254
Newtonsoft.Json (>= 8.0.3)
255255
System.IdentityModel.Tokens.Jwt (>= 4.0.2.206221351)
256256
WindowsAzure.ServiceBus (>= 3.3.2)
257+
Microsoft.VisualStudio.Shell.14.0 (14.3.25407) - copy_local: false
258+
Microsoft.VisualStudio.Imaging (>= 14.3.25407)
259+
Microsoft.VisualStudio.OLE.Interop (>= 7.10.6070)
260+
Microsoft.VisualStudio.Shell.Immutable.10.0 (>= 10.0.30319)
261+
Microsoft.VisualStudio.Shell.Immutable.11.0 (>= 11.0.50727)
262+
Microsoft.VisualStudio.Shell.Immutable.12.0 (>= 12.0.21003)
263+
Microsoft.VisualStudio.Shell.Immutable.14.0 (>= 14.3.25407)
264+
Microsoft.VisualStudio.Shell.Interop (>= 7.10.6071)
265+
Microsoft.VisualStudio.Shell.Interop.8.0 (>= 8.0.50727)
266+
Microsoft.VisualStudio.Shell.Interop.9.0 (>= 9.0.30729)
267+
Microsoft.VisualStudio.TextManager.Interop (>= 7.10.6070)
268+
Microsoft.VisualStudio.Threading (>= 14.1.111)
269+
Microsoft.VisualStudio.Utilities (>= 14.3.25407)
257270
Microsoft.VisualStudio.Shell.15.0 (15.6.27413) - copy_local: false
258271
Microsoft.VisualStudio.Imaging (>= 15.6.27413)
259272
Microsoft.VisualStudio.SDK.EmbedInteropTypes (>= 15.0.16)
@@ -267,6 +280,14 @@ NUGET
267280
Microsoft.VisualStudio.CoreUtility (>= 15.6.27413)
268281
Microsoft.VisualStudio.OLE.Interop (>= 7.10.6071)
269282
Microsoft.VisualStudio.Utilities (>= 15.6.27413)
283+
Microsoft.VisualStudio.Shell.Immutable.10.0 (15.0.25415) - copy_local: false
284+
Microsoft.VisualStudio.Shell.Framework (>= 15.0.25415)
285+
Microsoft.VisualStudio.Shell.Immutable.11.0 (15.0.25415) - copy_local: false
286+
Microsoft.VisualStudio.Shell.Framework (>= 15.0.25415)
287+
Microsoft.VisualStudio.Shell.Immutable.12.0 (15.0.25415) - copy_local: false
288+
Microsoft.VisualStudio.Shell.Framework (>= 15.0.25415)
289+
Microsoft.VisualStudio.Shell.Immutable.14.0 (15.0.25405) - copy_local: false
290+
Microsoft.VisualStudio.Shell.Framework (>= 15.0.25405)
270291
Microsoft.VisualStudio.Shell.Interop (7.10.6072) - copy_local: false
271292
Microsoft.VisualStudio.TextManager.Interop (>= 7.10.6071)
272293
Microsoft.VisualStudio.Shell.Interop.10.0 (10.0.30320)
@@ -301,7 +322,7 @@ NUGET
301322
Microsoft.VisualStudio.Utilities (15.6.27413) - copy_local: false
302323
Microsoft.VisualStudio.Threading (>= 15.4.4)
303324
StreamJsonRpc (>= 1.2.8)
304-
Microsoft.VisualStudio.Validation (15.3.32)
325+
Microsoft.VisualStudio.Validation (15.3.32) - copy_local: false
305326
Newtonsoft.Json (11.0.1) - copy_local: false, redirects: force
306327
StreamJsonRpc (1.3.23) - copy_local: false
307328
Microsoft.VisualStudio.Threading (>= 15.3.20)

vs-commitizen.Tests/paket.references

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,6 @@ Xunit.StaFact
99

1010
group vs15
1111
Microsoft.TeamFoundationServer.ExtendedClient copy_local: true
12-
Microsoft.VisualStudio.Shell.15.0 copy_local: true
12+
Microsoft.VisualStudio.Shell.14.0 copy_local: true
13+
# Microsoft.VisualStudio.Shell.15.0 copy_local: true
1314
Microsoft.VisualStudio.Shell.Interop.12.0

vs-commitizen.Tests/vs-commitizen.Tests.csproj

Lines changed: 31 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -605,8 +605,8 @@
605605
<Choose>
606606
<When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And $(TargetFrameworkVersion) == 'v4.6.1'">
607607
<ItemGroup>
608-
<Reference Include="Microsoft.VisualStudio.Shell.15.0">
609-
<HintPath>..\packages\vs15\Microsoft.VisualStudio.Shell.15.0\lib\net45\Microsoft.VisualStudio.Shell.15.0.dll</HintPath>
608+
<Reference Include="Microsoft.VisualStudio.Shell.14.0">
609+
<HintPath>..\packages\vs15\Microsoft.VisualStudio.Shell.14.0\lib\Microsoft.VisualStudio.Shell.14.0.dll</HintPath>
610610
<Private>True</Private>
611611
<Paket>True</Paket>
612612
</Reference>
@@ -627,8 +627,8 @@
627627
<Choose>
628628
<When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And $(TargetFrameworkVersion) == 'v4.6.1'">
629629
<ItemGroup>
630-
<Reference Include="Microsoft.VisualStudio.Shell.Interop">
631-
<HintPath>..\packages\vs15\Microsoft.VisualStudio.Shell.Interop\lib\net11\Microsoft.VisualStudio.Shell.Interop.dll</HintPath>
630+
<Reference Include="Microsoft.VisualStudio.Shell.Immutable.10.0">
631+
<HintPath>..\packages\vs15\Microsoft.VisualStudio.Shell.Immutable.10.0\lib\net45\Microsoft.VisualStudio.Shell.Immutable.10.0.dll</HintPath>
632632
<Private>True</Private>
633633
<Paket>True</Paket>
634634
</Reference>
@@ -638,8 +638,8 @@
638638
<Choose>
639639
<When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And $(TargetFrameworkVersion) == 'v4.6.1'">
640640
<ItemGroup>
641-
<Reference Include="Microsoft.VisualStudio.Shell.Interop.10.0">
642-
<HintPath>..\packages\vs15\Microsoft.VisualStudio.Shell.Interop.10.0\lib\net20\Microsoft.VisualStudio.Shell.Interop.10.0.dll</HintPath>
641+
<Reference Include="Microsoft.VisualStudio.Shell.Immutable.11.0">
642+
<HintPath>..\packages\vs15\Microsoft.VisualStudio.Shell.Immutable.11.0\lib\net45\Microsoft.VisualStudio.Shell.Immutable.11.0.dll</HintPath>
643643
<Private>True</Private>
644644
<Paket>True</Paket>
645645
</Reference>
@@ -649,8 +649,8 @@
649649
<Choose>
650650
<When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And $(TargetFrameworkVersion) == 'v4.6.1'">
651651
<ItemGroup>
652-
<Reference Include="Microsoft.VisualStudio.Shell.Interop.11.0">
653-
<HintPath>..\packages\vs15\Microsoft.VisualStudio.Shell.Interop.11.0\lib\net20\Microsoft.VisualStudio.Shell.Interop.11.0.dll</HintPath>
652+
<Reference Include="Microsoft.VisualStudio.Shell.Immutable.12.0">
653+
<HintPath>..\packages\vs15\Microsoft.VisualStudio.Shell.Immutable.12.0\lib\net45\Microsoft.VisualStudio.Shell.Immutable.12.0.dll</HintPath>
654654
<Private>True</Private>
655655
<Paket>True</Paket>
656656
</Reference>
@@ -660,8 +660,8 @@
660660
<Choose>
661661
<When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And $(TargetFrameworkVersion) == 'v4.6.1'">
662662
<ItemGroup>
663-
<Reference Include="Microsoft.VisualStudio.Shell.Interop.12.0">
664-
<HintPath>..\packages\vs15\Microsoft.VisualStudio.Shell.Interop.12.0\lib\net20\Microsoft.VisualStudio.Shell.Interop.12.0.dll</HintPath>
663+
<Reference Include="Microsoft.VisualStudio.Shell.Immutable.14.0">
664+
<HintPath>..\packages\vs15\Microsoft.VisualStudio.Shell.Immutable.14.0\lib\net45\Microsoft.VisualStudio.Shell.Immutable.14.0.dll</HintPath>
665665
<Private>True</Private>
666666
<Paket>True</Paket>
667667
</Reference>
@@ -671,8 +671,8 @@
671671
<Choose>
672672
<When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And $(TargetFrameworkVersion) == 'v4.6.1'">
673673
<ItemGroup>
674-
<Reference Include="Microsoft.VisualStudio.Shell.Interop.15.3.DesignTime">
675-
<HintPath>..\packages\vs15\Microsoft.VisualStudio.Shell.Interop.15.3.DesignTime\lib\net20\Microsoft.VisualStudio.Shell.Interop.15.3.DesignTime.dll</HintPath>
674+
<Reference Include="Microsoft.VisualStudio.Shell.Interop">
675+
<HintPath>..\packages\vs15\Microsoft.VisualStudio.Shell.Interop\lib\net11\Microsoft.VisualStudio.Shell.Interop.dll</HintPath>
676676
<Private>True</Private>
677677
<Paket>True</Paket>
678678
</Reference>
@@ -682,8 +682,8 @@
682682
<Choose>
683683
<When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And $(TargetFrameworkVersion) == 'v4.6.1'">
684684
<ItemGroup>
685-
<Reference Include="Microsoft.VisualStudio.Shell.Interop.15.6.DesignTime">
686-
<HintPath>..\packages\vs15\Microsoft.VisualStudio.Shell.Interop.15.6.DesignTime\lib\net20\Microsoft.VisualStudio.Shell.Interop.15.6.DesignTime.dll</HintPath>
685+
<Reference Include="Microsoft.VisualStudio.Shell.Interop.10.0">
686+
<HintPath>..\packages\vs15\Microsoft.VisualStudio.Shell.Interop.10.0\lib\net20\Microsoft.VisualStudio.Shell.Interop.10.0.dll</HintPath>
687687
<Private>True</Private>
688688
<Paket>True</Paket>
689689
</Reference>
@@ -693,8 +693,8 @@
693693
<Choose>
694694
<When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And $(TargetFrameworkVersion) == 'v4.6.1'">
695695
<ItemGroup>
696-
<Reference Include="Microsoft.VisualStudio.Shell.Interop.8.0">
697-
<HintPath>..\packages\vs15\Microsoft.VisualStudio.Shell.Interop.8.0\lib\net11\Microsoft.VisualStudio.Shell.Interop.8.0.dll</HintPath>
696+
<Reference Include="Microsoft.VisualStudio.Shell.Interop.11.0">
697+
<HintPath>..\packages\vs15\Microsoft.VisualStudio.Shell.Interop.11.0\lib\net20\Microsoft.VisualStudio.Shell.Interop.11.0.dll</HintPath>
698698
<Private>True</Private>
699699
<Paket>True</Paket>
700700
</Reference>
@@ -704,8 +704,19 @@
704704
<Choose>
705705
<When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And $(TargetFrameworkVersion) == 'v4.6.1'">
706706
<ItemGroup>
707-
<Reference Include="Microsoft.VisualStudio.Shell.Interop.9.0">
708-
<HintPath>..\packages\vs15\Microsoft.VisualStudio.Shell.Interop.9.0\lib\net11\Microsoft.VisualStudio.Shell.Interop.9.0.dll</HintPath>
707+
<Reference Include="Microsoft.VisualStudio.Shell.Interop.12.0">
708+
<HintPath>..\packages\vs15\Microsoft.VisualStudio.Shell.Interop.12.0\lib\net20\Microsoft.VisualStudio.Shell.Interop.12.0.dll</HintPath>
709+
<Private>True</Private>
710+
<Paket>True</Paket>
711+
</Reference>
712+
</ItemGroup>
713+
</When>
714+
</Choose>
715+
<Choose>
716+
<When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And $(TargetFrameworkVersion) == 'v4.6.1'">
717+
<ItemGroup>
718+
<Reference Include="Microsoft.VisualStudio.Shell.Interop.8.0">
719+
<HintPath>..\packages\vs15\Microsoft.VisualStudio.Shell.Interop.8.0\lib\net11\Microsoft.VisualStudio.Shell.Interop.8.0.dll</HintPath>
709720
<Private>True</Private>
710721
<Paket>True</Paket>
711722
</Reference>
@@ -715,8 +726,8 @@
715726
<Choose>
716727
<When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And $(TargetFrameworkVersion) == 'v4.6.1'">
717728
<ItemGroup>
718-
<Reference Include="Microsoft.VisualStudio.Text.Data">
719-
<HintPath>..\packages\vs15\Microsoft.VisualStudio.Text.Data\lib\net46\Microsoft.VisualStudio.Text.Data.dll</HintPath>
729+
<Reference Include="Microsoft.VisualStudio.Shell.Interop.9.0">
730+
<HintPath>..\packages\vs15\Microsoft.VisualStudio.Shell.Interop.9.0\lib\net11\Microsoft.VisualStudio.Shell.Interop.9.0.dll</HintPath>
720731
<Private>True</Private>
721732
<Paket>True</Paket>
722733
</Reference>
@@ -761,7 +772,6 @@
761772
</Choose>
762773
<Import Project="..\packages\xunit.core\build\xunit.core.targets" Condition="Exists('..\packages\xunit.core\build\xunit.core.targets')" Label="Paket" />
763774
<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" />
764-
<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" />
765775
<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" />
766776
<ItemGroup>
767777
<Analyzer Include="..\packages\vs15\Microsoft.VisualStudio.Threading.Analyzers\analyzers\cs\Microsoft.VisualStudio.Threading.Analyzers.dll">
Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,28 @@
11
<UserControl x:Class="vs_commitizen.vs2015.Controls.TextBoxWithHint"
22
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
33
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4-
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
5-
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
4+
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
5+
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
66
xmlns:local="clr-namespace:vs_commitizen.vs2015.Controls"
7-
mc:Ignorable="d" >
7+
xmlns:platformUi="clr-namespace:Microsoft.VisualStudio.PlatformUI;assembly=Microsoft.VisualStudio.Shell.14.0"
8+
mc:Ignorable="d">
89
<UserControl.Resources>
910
<BooleanToVisibilityConverter x:Key="MyBoolToVisibilityConverter" />
1011
</UserControl.Resources>
11-
<Grid Background="White" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
12+
<Grid Background="{DynamicResource {x:Static platformUi:CommonControlsColors.TextBoxBackgroundBrushKey}}" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
1213
<!-- overlay with hint text -->
13-
<TextBlock Margin="5,0,5,0" Text="{Binding Path=HintText}"
14-
Foreground="LightSteelBlue"
14+
<TextBlock Margin="5,0,5,0" Text="{Binding Path=HintText}"
15+
Foreground="LightSteelBlue"
1516
Visibility="{Binding ElementName=txtInputBox, Path=Text.IsEmpty, Converter={StaticResource MyBoolToVisibilityConverter}}"
1617
HorizontalAlignment="Stretch"
1718
VerticalAlignment="Center" />
1819
<!-- enter term here -->
1920
<TextBox Name="txtInputBox" Background="Transparent" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
2021
AcceptsReturn="{Binding Path=AcceptReturn, RelativeSource={RelativeSource FindAncestor,AncestorType={x:Type UserControl}}}"
21-
Text="{Binding Path=Text, UpdateSourceTrigger=PropertyChanged, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}}"
22-
MaxLength="{Binding Path=MaxLength, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}}" />
22+
Text="{Binding Path=Text, UpdateSourceTrigger=PropertyChanged, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}}"
23+
MaxLength="{Binding Path=MaxLength, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}}"
24+
Foreground="{DynamicResource {x:Static platformUi:CommonControlsColors.TextBoxTextBrushKey}}"
25+
GotFocus="TxtInputBox_OnGotFocus">
26+
</TextBox>
2327
</Grid>
24-
</UserControl>
28+
</UserControl>

vs-commitizen.vs2015/Controls/TextBoxWithHint.xaml.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,5 +53,10 @@ private void OnPropertyChanged([CallerMemberName] string propertyName = null)
5353
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
5454
}
5555
public event PropertyChangedEventHandler PropertyChanged;
56+
57+
private void TxtInputBox_OnGotFocus(object sender, RoutedEventArgs e)
58+
{
59+
((TextBox)sender).SelectAll();
60+
}
5661
}
5762
}

0 commit comments

Comments
 (0)