Skip to content
This repository was archived by the owner on Jun 21, 2023. It is now read-only.

Commit e9e2449

Browse files
Merge pull request #2357 from github/fixes/2356-theme-dialog-window-borders
Theme GitHub dialog window borders
2 parents 4949e32 + 52466ab commit e9e2449

13 files changed

+101
-31
lines changed
539 KB
Binary file not shown.

src/GitHub.VisualStudio.UI/GitHub.VisualStudio.UI.csproj

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
<Import Project="$(SolutionDir)\src\common\signing.props" />
1010

1111
<ItemGroup>
12+
<Reference Include="Microsoft.VisualStudio.Shell.ViewManager">
13+
<HintPath>..\..\lib\14.0\Microsoft.VisualStudio.Shell.ViewManager.dll</HintPath>
14+
</Reference>
1215
<Reference Include="System.ComponentModel.Composition" />
1316
<Reference Include="System.Windows.Forms" />
1417
<Reference Include="System.Xaml" />

src/GitHub.VisualStudio.UI/Styles/TextBlocks.xaml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
22
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
33
xmlns:ui="clr-namespace:GitHub.UI;assembly=GitHub.UI"
4-
xmlns:vs="clr-namespace:Microsoft.VisualStudio.PlatformUI;assembly=Microsoft.VisualStudio.Shell.14.0"
5-
xmlns:local="clr-namespace:GitHub.VisualStudio.Styles"
6-
xmlns:vsui="clr-namespace:GitHub.VisualStudio.UI">
4+
xmlns:vs="clr-namespace:Microsoft.VisualStudio.PlatformUI;assembly=Microsoft.VisualStudio.Shell.14.0"
5+
xmlns:shell="clr-namespace:Microsoft.VisualStudio.Shell;assembly=Microsoft.VisualStudio.Shell.14.0">
76

87
<Style x:Key="GitHubVsPromptTextBox" TargetType="{x:Type ui:PromptTextBox}">
9-
<Setter Property="Background" Value="{DynamicResource GitHubVsBrandedUIBackground}"/>
10-
<Setter Property="Foreground" Value="{DynamicResource GitHubVsToolWindowText}"/>
11-
<Setter Property="BorderBrush" Value="{DynamicResource GitHubVsBrandedUIBorder}"/>
8+
<Setter Property="Background" Value="{DynamicResource {x:Static vs:CommonControlsColors.TextBoxBackgroundBrushKey}}"/>
9+
<Setter Property="Foreground" Value="{DynamicResource {x:Static vs:CommonControlsColors.TextBoxTextBrushKey}}"/>
10+
<Setter Property="BorderBrush" Value="{DynamicResource {x:Static vs:CommonControlsColors.TextBoxBorderBrushKey}}"/>
1211
<Setter Property="KeyboardNavigation.TabNavigation" Value="None"/>
1312
<Setter Property="HorizontalContentAlignment" Value="Left"/>
1413
<Setter Property="FocusVisualStyle" Value="{x:Null}"/>
@@ -31,7 +30,7 @@
3130
<Grid>
3231
<ScrollViewer x:Name="PART_ContentHost" Padding="{TemplateBinding Padding}" Focusable="false" HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Hidden" VerticalAlignment="Top" Margin="0"/>
3332
<Label x:Name="PromptLabel" HorizontalAlignment="Left"
34-
Foreground="{DynamicResource GitHubVsGrayText}"
33+
Foreground="{DynamicResource {x:Static shell:VsBrushes.GrayTextKey}}"
3534
FontSize="{TemplateBinding FontSize}" Padding="{TemplateBinding Padding}" Opacity="0"
3635
Target="{Binding ElementName=Bd}"
3736
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" Focusable="False" IsHitTestVisible="False"

src/GitHub.VisualStudio.UI/Views/Dialog/Clone/RepositoryCloneView.xaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
xmlns:local="clr-namespace:GitHub.VisualStudio.Views.Dialog.Clone"
88
xmlns:uic="clr-namespace:GitHub.VisualStudio.UI.Controls"
99
xmlns:vs="clr-namespace:Microsoft.VisualStudio.PlatformUI;assembly=Microsoft.VisualStudio.Shell.14.0"
10-
Background="{DynamicResource {x:Static vs:EnvironmentColors.ToolWindowBackgroundBrushKey}}"
11-
Foreground="{DynamicResource {x:Static vs:EnvironmentColors.ToolWindowTextBrushKey}}"
12-
Margin="12,12"
10+
Background="{DynamicResource {x:Static vs:ThemedDialogColors.WindowPanelBrushKey}}"
11+
Foreground="{DynamicResource {x:Static vs:ThemedDialogColors.WindowPanelTextBrushKey}}"
12+
Margin="12,0,12,12"
1313
mc:Ignorable="d" d:DesignHeight="414" d:DesignWidth="440">
1414
<d:DesignData.DataContext>
1515
<ghfvs:RepositoryCloneViewModelDesigner/>

src/GitHub.VisualStudio.UI/Views/Dialog/ForkRepositoryExecuteView.xaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
VerticalAlignment="Top"
1111
Margin="8"
1212
xmlns:vs="clr-namespace:Microsoft.VisualStudio.PlatformUI;assembly=Microsoft.VisualStudio.Shell.14.0"
13-
Background="{DynamicResource {x:Static vs:EnvironmentColors.ToolWindowBackgroundBrushKey}}"
14-
Foreground="{DynamicResource {x:Static vs:EnvironmentColors.ToolWindowTextBrushKey}}"
13+
Background="{DynamicResource {x:Static vs:ThemedDialogColors.WindowPanelBrushKey}}"
14+
Foreground="{DynamicResource {x:Static vs:ThemedDialogColors.WindowPanelTextBrushKey}}"
1515
mc:Ignorable="d" d:DesignWidth="300" Height="315.179">
1616

1717
<Control.Resources>

src/GitHub.VisualStudio.UI/Views/Dialog/ForkRepositorySelectView.xaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
xmlns:sampleData="clr-namespace:GitHub.SampleData;assembly=GitHub.App"
1111
mc:Ignorable="d"
1212
xmlns:vs="clr-namespace:Microsoft.VisualStudio.PlatformUI;assembly=Microsoft.VisualStudio.Shell.14.0"
13-
Background="{DynamicResource {x:Static vs:EnvironmentColors.ToolWindowBackgroundBrushKey}}"
14-
Foreground="{DynamicResource {x:Static vs:EnvironmentColors.ToolWindowTextBrushKey}}"
13+
Background="{DynamicResource {x:Static vs:ThemedDialogColors.WindowPanelBrushKey}}"
14+
Foreground="{DynamicResource {x:Static vs:ThemedDialogColors.WindowPanelTextBrushKey}}"
1515
d:DesignHeight="414" d:DesignWidth="440">
1616

1717
<Control.Resources>

src/GitHub.VisualStudio.UI/Views/Dialog/GistCreationView.xaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
d:DesignWidth="414"
1111
d:DesignHeight="440"
1212
xmlns:vs="clr-namespace:Microsoft.VisualStudio.PlatformUI;assembly=Microsoft.VisualStudio.Shell.14.0"
13-
Background="{DynamicResource {x:Static vs:EnvironmentColors.ToolWindowBackgroundBrushKey}}"
14-
Foreground="{DynamicResource {x:Static vs:EnvironmentColors.ToolWindowTextBrushKey}}"
13+
Background="{DynamicResource {x:Static vs:ThemedDialogColors.WindowPanelBrushKey}}"
14+
Foreground="{DynamicResource {x:Static vs:ThemedDialogColors.WindowPanelTextBrushKey}}"
1515
AutomationProperties.AutomationId="{x:Static ghfvs:AutomationIDs.GistCreationControlCustom}">
1616
<Control.Resources>
1717
<ResourceDictionary Source="DialogStyles.xaml" />
Lines changed: 63 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
<pfui:DialogWindow x:Class="GitHub.VisualStudio.Views.Dialog.GitHubDialogWindow"
1+
<ui:DialogWindow x:Class="GitHub.VisualStudio.Views.Dialog.GitHubDialogWindow"
22
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
33
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
44
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
55
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
6-
xmlns:pfui="clr-namespace:Microsoft.VisualStudio.PlatformUI;assembly=Microsoft.VisualStudio.Shell.14.0"
6+
xmlns:ui="clr-namespace:Microsoft.VisualStudio.PlatformUI;assembly=Microsoft.VisualStudio.Shell.14.0"
7+
xmlns:shellControls="clr-namespace:Microsoft.VisualStudio.PlatformUI.Shell.Controls;assembly=Microsoft.VisualStudio.Shell.ViewManager"
78
xmlns:local="clr-namespace:GitHub.VisualStudio.Views"
89
xmlns:ghfvs="https://github.com/github/VisualStudio"
910
mc:Ignorable="d"
@@ -13,19 +14,26 @@
1314
MinWidth="414"
1415
MinHeight="460"
1516
xmlns:vs="clr-namespace:Microsoft.VisualStudio.PlatformUI;assembly=Microsoft.VisualStudio.Shell.14.0"
16-
Background="{DynamicResource {x:Static vs:EnvironmentColors.ToolWindowBackgroundBrushKey}}"
17-
Foreground="{DynamicResource {x:Static vs:EnvironmentColors.ToolWindowTextBrushKey}}"
17+
Background="{DynamicResource {x:Static vs:ThemedDialogColors.WindowPanelBrushKey}}"
18+
Foreground="{DynamicResource {x:Static vs:ThemedDialogColors.WindowPanelTextBrushKey}}"
1819
FontFamily="Segoe UI"
1920
FontSize="12"
2021
FontStretch="Normal"
2122
FontStyle="Normal"
2223
FontWeight="Normal"
23-
HasMaximizeButton="False"
24-
HasMinimizeButton="False"
2524
SnapsToDevicePixels="True"
2625
UseLayoutRounding="True"
2726
WindowStartupLocation="CenterOwner"
27+
WindowStyle="None"
28+
WindowState="Normal"
29+
ResizeMode="CanResize"
30+
ShowInTaskbar="false"
2831
Content="{Binding Content}">
32+
<WindowChrome.WindowChrome>
33+
<WindowChrome
34+
CaptionHeight="0"
35+
ResizeBorderThickness="5" />
36+
</WindowChrome.WindowChrome>
2937
<Window.Resources>
3038
<ResourceDictionary>
3139
<local:ViewLocator x:Key="viewLocator"/>
@@ -34,4 +42,52 @@
3442
</DataTemplate>
3543
</ResourceDictionary>
3644
</Window.Resources>
37-
</pfui:DialogWindow>
45+
<Window.ContentTemplate>
46+
<DataTemplate>
47+
<Border MouseDown="Border_MouseDown"
48+
BorderThickness="1"
49+
Background="{DynamicResource {x:Static vs:ThemedDialogColors.WindowPanelBrushKey}}"
50+
BorderBrush="{DynamicResource {x:Static vs:ThemedDialogColors.WindowBorderBrushKey}}">
51+
<DockPanel>
52+
<DockPanel DockPanel.Dock="Top">
53+
<Label Content="{Binding Title}"
54+
Foreground="{DynamicResource {x:Static ui:ThemedDialogColors.WindowPanelTextBrushKey}}"
55+
DockPanel.Dock="Left"
56+
Margin="9,5,0,0"
57+
/>
58+
59+
<!-- close button and padding -->
60+
<shellControls:GlyphButton x:Uid="button_Close"
61+
x:Name="CloseButton"
62+
Width="46"
63+
Height="33"
64+
DockPanel.Dock="Right"
65+
HorizontalAlignment="Right"
66+
VerticalAlignment="Top"
67+
BorderBrush="Transparent"
68+
BorderThickness="0"
69+
Background="{DynamicResource {x:Static ui:ThemedDialogColors.WindowButtonBrushKey}}"
70+
GlyphForeground="{DynamicResource {x:Static ui:ThemedDialogColors.WindowButtonGlyphBrushKey}}"
71+
HoverBackground="{DynamicResource {x:Static ui:ThemedDialogColors.WindowButtonHoverBrushKey}}"
72+
HoverForeground="{DynamicResource {x:Static ui:ThemedDialogColors.WindowButtonHoverGlyphBrushKey}}"
73+
HoverBorderBrush="{DynamicResource {x:Static ui:ThemedDialogColors.WindowButtonHoverBorderBrushKey}}"
74+
PressedBackground="{DynamicResource {x:Static ui:ThemedDialogColors.WindowButtonDownBrushKey}}"
75+
PressedForeground="{DynamicResource {x:Static ui:ThemedDialogColors.WindowButtonDownGlyphBrushKey}}"
76+
PressedBorderBrush="{DynamicResource {x:Static ui:ThemedDialogColors.WindowButtonDownBorderBrushKey}}"
77+
Click="CloseButton_Click">
78+
<Path x:Uid="path_CloseButton"
79+
Width="16"
80+
Height="16"
81+
Fill="{Binding Path=(TextElement.Foreground), RelativeSource={RelativeSource Self}}"
82+
Data="F1M8.583,8L13,12.424 12.424,13 8,8.583 3.576,13 3,12.424 7.417,8 3,3.576 3.576,3 8,7.417 12.424,3 13,3.576z"/>
83+
</shellControls:GlyphButton>
84+
85+
</DockPanel>
86+
87+
<!-- content -->
88+
<ContentControl Content="{Binding Converter={StaticResource viewLocator}}"/>
89+
</DockPanel>
90+
</Border>
91+
</DataTemplate>
92+
</Window.ContentTemplate>
93+
</ui:DialogWindow>

src/GitHub.VisualStudio.UI/Views/Dialog/GitHubDialogWindow.xaml.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
using System;
2+
using System.Windows;
3+
using System.Windows.Input;
24
using GitHub.ViewModels.Dialog;
35
using Microsoft.VisualStudio.PlatformUI;
46

@@ -15,5 +17,15 @@ public GitHubDialogWindow(IGitHubDialogWindowViewModel viewModel)
1517
viewModel.Done.Subscribe(_ => Close());
1618
InitializeComponent();
1719
}
20+
21+
void CloseButton_Click(object sender, RoutedEventArgs e)
22+
{
23+
Close();
24+
}
25+
26+
void Border_MouseDown(object sender, MouseButtonEventArgs e)
27+
{
28+
DragMove();
29+
}
1830
}
1931
}

src/GitHub.VisualStudio.UI/Views/Dialog/LogOutRequiredView.xaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
66
xmlns:ghfvs="https://github.com/github/VisualStudio"
77
xmlns:vs="clr-namespace:Microsoft.VisualStudio.PlatformUI;assembly=Microsoft.VisualStudio.Shell.14.0"
8-
Background="{DynamicResource {x:Static vs:EnvironmentColors.ToolWindowBackgroundBrushKey}}"
9-
Foreground="{DynamicResource {x:Static vs:EnvironmentColors.ToolWindowTextBrushKey}}"
8+
Background="{DynamicResource {x:Static vs:ThemedDialogColors.WindowPanelBrushKey}}"
9+
Foreground="{DynamicResource {x:Static vs:ThemedDialogColors.WindowPanelTextBrushKey}}"
1010
mc:Ignorable="d" d:DesignHeight="300" d:DesignWidth="300">
1111

1212
<Control.Resources>

0 commit comments

Comments
 (0)