Skip to content

Commit c53114a

Browse files
committed
继续汉化和更改外观
1 parent b2391e4 commit c53114a

File tree

2 files changed

+114
-12
lines changed

2 files changed

+114
-12
lines changed

GitSquash.VisualStudio.Extension/GitSquash.VisualStudio.Extension/View/SquashView.xaml

Lines changed: 113 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,108 @@
2424
<converters1:TrueToVisibleConverter x:Key="TrueToVisibleConverter" />
2525
<converters:FalseToVisibilityConverter x:Key="FalseToVisibleConverter" />
2626
<converters1:AnyTrueToVisibleConverter x:Key="AnyTrueToVisibleConverter"/>
27+
<!--<Style x:Key="SectionControlStyle1" TargetType="{x:Type framework:SectionControl}"/>-->
28+
<Style TargetType="DataGrid">
29+
<!--网格线颜色-->
30+
<Setter Property="CanUserResizeColumns" Value="false"/>
31+
<Setter Property="Background" Value="#E6DBBB" />
32+
<Setter Property="BorderBrush" Value="#d6c79b" />
33+
<Setter Property="HorizontalGridLinesBrush">
34+
<Setter.Value>
35+
<SolidColorBrush Color="#d6c79b"/>
36+
</Setter.Value>
37+
</Setter>
38+
<Setter Property="VerticalGridLinesBrush">
39+
<Setter.Value>
40+
<SolidColorBrush Color="#d6c79b"/>
41+
</Setter.Value>
42+
</Setter>
43+
</Style>
44+
45+
<!--标题栏样式-->
46+
<!--<Style TargetType="DataGridColumnHeader" >
47+
<Setter Property="Width" Value="50"/>
48+
<Setter Property="Height" Value="30"/>
49+
<Setter Property="FontSize" Value="14" />
50+
<Setter Property="Background" Value="White" />
51+
<Setter Property="FontWeight" Value="Bold"/>
52+
</Style>-->
53+
54+
<Style TargetType="DataGridColumnHeader">
55+
<Setter Property="SnapsToDevicePixels" Value="True" />
56+
<Setter Property="MinWidth" Value="0" />
57+
<Setter Property="MinHeight" Value="28" />
58+
<Setter Property="Foreground" Value="#323433" />
59+
<Setter Property="FontSize" Value="14" />
60+
<Setter Property="Cursor" Value="Hand" />
61+
<Setter Property="Template">
62+
<Setter.Value>
63+
<ControlTemplate TargetType="DataGridColumnHeader">
64+
<Border x:Name="BackgroundBorder" BorderThickness="0,1,0,1"
65+
BorderBrush="#e6dbba"
66+
Width="Auto">
67+
<Grid >
68+
<Grid.ColumnDefinitions>
69+
<ColumnDefinition Width="*" />
70+
</Grid.ColumnDefinitions>
71+
<ContentPresenter Margin="0,0,0,0" VerticalAlignment="Center" HorizontalAlignment="Center"/>
72+
<Path x:Name="SortArrow" Visibility="Collapsed" Data="M0,0 L1,0 0.5,1 z" Stretch="Fill" Grid.Column="2" Width="8" Height="6" Fill="White" Margin="0,0,50,0"
73+
VerticalAlignment="Center" RenderTransformOrigin="1,1" />
74+
<Rectangle Width="1" Fill="#d6c79b" HorizontalAlignment="Right" Grid.ColumnSpan="1" />
75+
<!--<TextBlock Background="Red">
76+
<ContentPresenter></ContentPresenter></TextBlock>-->
77+
</Grid>
78+
</Border>
79+
</ControlTemplate>
80+
</Setter.Value>
81+
</Setter>
82+
<Setter Property="Height" Value="25"/>
83+
</Style>
84+
<!--行样式触发-->
85+
<!--背景色改变必须先设置cellStyle 因为cellStyle会覆盖rowStyle样式-->
86+
<Style TargetType="DataGridRow">
87+
<Setter Property="Background" Value="#F2F2F2" />
88+
<Setter Property="Height" Value="25"/>
89+
<Setter Property="Foreground" Value="Black" />
90+
<Style.Triggers>
91+
<!--隔行换色-->
92+
<Trigger Property="AlternationIndex" Value="0" >
93+
<Setter Property="Background" Value="#e7e7e7" />
94+
</Trigger>
95+
<Trigger Property="AlternationIndex" Value="1" >
96+
<Setter Property="Background" Value="#f2f2f2" />
97+
</Trigger>
98+
99+
<Trigger Property="IsMouseOver" Value="True">
100+
<Setter Property="Background" Value="LightGray"/>
101+
<!--<Setter Property="Foreground" Value="White"/>-->
102+
</Trigger>
103+
104+
<Trigger Property="IsSelected" Value="True">
105+
<Setter Property="Foreground" Value="Black"/>
106+
</Trigger>
107+
</Style.Triggers>
108+
</Style>
109+
110+
<!--单元格样式触发-->
111+
<Style TargetType="DataGridCell">
112+
<Setter Property="Template">
113+
<Setter.Value>
114+
<ControlTemplate TargetType="DataGridCell">
115+
<TextBlock TextAlignment="Center" VerticalAlignment="Center" >
116+
<ContentPresenter />
117+
</TextBlock>
118+
</ControlTemplate>
119+
</Setter.Value>
120+
</Setter>
121+
<Style.Triggers>
122+
<Trigger Property="IsSelected" Value="True">
123+
<!--<Setter Property="Background" Value="White"/>
124+
<Setter Property="BorderThickness" Value="0"/>-->
125+
<Setter Property="Foreground" Value="Black"/>
126+
</Trigger>
127+
</Style.Triggers>
128+
</Style>
27129
</Grid.Resources>
28130
<Grid.RowDefinitions>
29131
<RowDefinition Height="Auto" />
@@ -35,10 +137,10 @@
35137
<Separator Style="{StaticResource VerticalSeparator}" />
36138
<teamExplorer:TextLink Text="拉取(变基)" Localization.Attributes="Text (Modifiable Readable Text)" Command="{Binding Rebase}" />
37139
<Separator Style="{StaticResource VerticalSeparator}" />
38-
<teamExplorer:TextLink Text="Push" Localization.Attributes="Text (Modifiable Readable Text)" Command="{Binding Push}" />
140+
<teamExplorer:TextLink Text="推送" Localization.Attributes="Text (Modifiable Readable Text)" Command="{Binding Push}" />
39141

40-
<Separator Style="{StaticResource VerticalSeparator}" />
41-
<teamExplorer:TextLink Text="Push (Force)" Localization.Attributes="Text (Modifiable Readable Text)" Command="{Binding PushForce}" IsEnabled="{Binding Mode=TwoWay, Path=DoForcePush}" />
142+
<!--<Separator Style="{StaticResource VerticalSeparator}" />
143+
<teamExplorer:TextLink Text="Push (Force)" Localization.Attributes="Text (Modifiable Readable Text)" Command="{Binding PushForce}" IsEnabled="{Binding Mode=TwoWay, Path=DoForcePush}" />-->
42144
<Separator Style="{StaticResource VerticalSeparator}" />
43145
<teamExplorer:TextLink Text="获取" Localization.Attributes="Text (Modifiable Readable Text)" Command="{Binding FetchOrigin}" />
44146
</WrapPanel>
@@ -55,7 +157,7 @@
55157
</MultiBinding>
56158
</WrapPanel.Visibility>
57159
<Rectangle Margin="2,0,4,2" Width="14" Height="14" Fill="{StaticResource WarningIconBrush}" Visibility="{Binding Path=IsDirty, Converter={StaticResource TrueToVisibleConverter}, ConverterParameter=Hidden}" />
58-
<teamExplorer:TextLink Margin="0,0,0,0" Text="Pending changes in staging area. Please Resolve." Command="{Binding Path=ViewChangesPage}" Visibility="{Binding Path=IsDirty, Converter={StaticResource TrueToVisibleConverter}}" />
160+
<teamExplorer:TextLink Margin="0,0,0,0" Text="暂存区有等待处理的文件,请处理(提交或暂存或解决冲突)" Command="{Binding Path=ViewChangesPage}" Visibility="{Binding Path=IsDirty, Converter={StaticResource TrueToVisibleConverter}}" />
59161
</WrapPanel>
60162
<WrapPanel Margin="0,6,0,0" Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Stretch">
61163
<WrapPanel.Visibility>
@@ -65,11 +167,11 @@
65167
</MultiBinding>
66168
</WrapPanel.Visibility>
67169
<Rectangle Margin="2,0,4,2" Width="14" Height="14" Fill="{StaticResource WarningIconBrush}" Visibility="{Binding Path=IsConflicts, Converter={StaticResource TrueToVisibleConverter}, ConverterParameter=Hidden}" />
68-
<teamExplorer:TextLink Margin="0,0,0,0" Text="Conflicts Found" Command="{Binding Path=ViewConflictsPage}" Visibility="{Binding Path=IsConflicts, Converter={StaticResource TrueToVisibleConverter}}" />
170+
<teamExplorer:TextLink Margin="0,0,0,0" Text="发现冲突" Command="{Binding Path=ViewConflictsPage}" Visibility="{Binding Path=IsConflicts, Converter={StaticResource TrueToVisibleConverter}}" />
69171
<Separator Style="{StaticResource VerticalSeparator}" Visibility="{Binding Path=IsRebaseInProgress, Converter={StaticResource TrueToVisibleConverter}}" />
70-
<teamExplorer:TextLink Margin="0,0,6,0" Text="Continue" Localization.Attributes="Text (Modifiable Readable Text)" Command="{Binding Path=ContinueRebase}" Visibility="{Binding Path=IsRebaseInProgress, Converter={StaticResource TrueToVisibleConverter}}" />
71-
<teamExplorer:TextLink Margin="0,0,6,0" Text="Abort" Localization.Attributes="Text (Modifiable Readable Text)" Command="{Binding Path=AbortRebase}" Visibility="{Binding Path=IsRebaseInProgress, Converter={StaticResource TrueToVisibleConverter}}" />
72-
<teamExplorer:TextLink Margin="0,0,6,0" Text="Skip (use with care)" Localization.Attributes="Text (Modifiable Readable Text)" Command="{Binding Path=Skip}" Visibility="{Binding Path=IsRebaseInProgress, Converter={StaticResource TrueToVisibleConverter}}" />
172+
<teamExplorer:TextLink Margin="0,0,6,0" Text="继续变基" Localization.Attributes="Text (Modifiable Readable Text)" Command="{Binding Path=ContinueRebase}" Visibility="{Binding Path=IsRebaseInProgress, Converter={StaticResource TrueToVisibleConverter}}" />
173+
<teamExplorer:TextLink Margin="0,0,6,0" Text="终止变基" Localization.Attributes="Text (Modifiable Readable Text)" Command="{Binding Path=AbortRebase}" Visibility="{Binding Path=IsRebaseInProgress, Converter={StaticResource TrueToVisibleConverter}}" />
174+
<teamExplorer:TextLink Margin="0,0,6,0" Text="跳过 (慎点)" Localization.Attributes="Text (Modifiable Readable Text)" Command="{Binding Path=Skip}" Visibility="{Binding Path=IsRebaseInProgress, Converter={StaticResource TrueToVisibleConverter}}" />
73175
</WrapPanel>
74176
<WrapPanel Margin="0,6,0,0" Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Stretch" Visibility="{Binding OperationSuccess, Converter={StaticResource FalseToVisibleConverter}, FallbackValue=Collapsed}">
75177
<Rectangle Margin="2,0,4,2" Width="14" Height="14" Fill="{StaticResource WarningIconBrush}" />
@@ -84,7 +186,7 @@
84186
<wpf:TextBlockControl Text="分支:" Margin="6,6,3,0" />
85187
<teamExplorer:TextLink Text="{Binding CurrentBranch.FriendlyName}" Margin="3,6,3,0" Command="{Binding ChangeBranch}" />
86188
</StackPanel>
87-
<framework:SectionControl HeaderText="父提交" IsExpanded="True" Margin="0,6,0,0" IsBusy="{Binding IsBusy}" ShowProgressWhenBusy="True" >
189+
<framework:SectionControl HeaderText="父提交" IsExpanded="True" Margin="0,6,0,0" IsBusy="{Binding IsBusy}" ShowProgressWhenBusy="True" Style="{DynamicResource SectionControlStyle1}" >
88190
<framework:SectionControl.Content>
89191
<Grid>
90192
<Grid.RowDefinitions>
@@ -107,7 +209,7 @@
107209

108210
</ComboBox>
109211
</StackPanel>
110-
<DataGrid Grid.Row="1" IsReadOnly="True" SelectionMode="Single" SelectedValue="{Binding SelectedCommit}" ItemsSource="{Binding BranchCommits}" AutoGenerateColumns="False" Margin="0,0,6,0" Background="{x:Null}" BorderBrush="{x:Null}">
212+
<DataGrid Grid.Row="1" IsReadOnly="True" SelectionMode="Single" SelectedValue="{Binding SelectedCommit}" ItemsSource="{Binding BranchCommits}" AutoGenerateColumns="False" Margin="0,0,6,0" BorderBrush="{x:Null}" Background="{x:Null}">
111213
<DataGrid.Columns>
112214
<DataGridTextColumn MaxWidth="50" Binding="{Binding Sha, Converter={converters:PrefixValueConverter PrefixLength=6}}" Header="ID"/>
113215
<DataGridTextColumn Binding="{Binding MessageShort}" Width="250" Header="消息" />
@@ -130,7 +232,7 @@
130232
</framework:SectionControl.Content>
131233
</framework:SectionControl>
132234

133-
<framework:SectionControl HeaderText="推送" IsExpanded="False" Margin="0,6,0,0" IsBusy="{Binding IsBusy}" ShowProgressWhenBusy="True" >
235+
<framework:SectionControl HeaderText="推送" IsExpanded="False" Margin="0,6,0,0" IsBusy="{Binding IsBusy}" ShowProgressWhenBusy="True" Visibility="Collapsed" >
134236
<framework:SectionControl.Content>
135237
<CheckBox IsChecked="{Binding Mode=TwoWay, Path=DoForcePush}" Background="Transparent" Content="执行强制推送 (不建议)" Margin="6,6,3,0" ToolTip="如果你确定要这么做,请通知你的队友" />
136238
</framework:SectionControl.Content>

GitSquash.VisualStudio.Extension/GitSquash.VisualStudio.Extension/stylesheet.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ h1, h2, h3, h4, h5, h6 {
3333
*/
3434

3535
#header {
36-
color: #FFF;
36+
/*color: #FFF;*/
3737
background: #68217a;
3838
position:relative;
3939
}

0 commit comments

Comments
 (0)