Skip to content

Commit 41ce29e

Browse files
committed
remove toggle button style and rename button style
1 parent 38f2820 commit 41ce29e

9 files changed

Lines changed: 187 additions & 317 deletions

src/Notepads/App.xaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
<ResourceDictionary Source="Notepads.Controls/Themes/Generic.xaml" />
2323
<ResourceDictionary Source="Controls/TextEditor/TextEditorCore.xaml" />
2424
<ResourceDictionary Source="Controls/FindAndReplace/FindAndReplacePlaceholder.xaml"></ResourceDictionary>
25-
<ResourceDictionary Source="Resource/ChromelessIconButtonStyle.xaml" />
25+
<ResourceDictionary Source="Resource/TransparentButtonStyle.xaml" />
2626
<ResourceDictionary Source="Resource/TransparentTextBoxStyle.xaml"></ResourceDictionary>
2727
<ResourceDictionary Source="Resource/CustomSplitViewStyle.xaml"></ResourceDictionary>
2828
<ResourceDictionary Source="Resource/InAppNotificationNoDismissButton.xaml"></ResourceDictionary>
@@ -32,7 +32,6 @@
3232
<ResourceDictionary Source="Resource/CustomNavigationViewItemStyle.xaml"></ResourceDictionary>
3333
<ResourceDictionary Source="Resource/CustomAppBarButtonStyle.xaml"></ResourceDictionary>
3434
<ResourceDictionary Source="Resource/CustomCheckBoxStyle.xaml"></ResourceDictionary>
35-
<ResourceDictionary Source="Resource/ExpanderToggleButtonStyle.xaml" />
3635
</ResourceDictionary.MergedDictionaries>
3736

3837
<Style x:Key="CompactSubtitleTextBlockStyle" TargetType="TextBlock" BasedOn="{StaticResource SubtitleTextBlockStyle}">

src/Notepads/Controls/DiffViewer/SideBySideDiffViewer.xaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,13 @@
3939
<Grid Grid.Row="0" Background="{ThemeResource HeaderBackgroundThemeBrush}">
4040
<Button x:Name="DismissButton"
4141
x:Uid="FindAndReplace_DismissButton"
42-
Style="{StaticResource ChromelessIconButtonStyle}"
42+
Style="{StaticResource TransparentButtonStyle}"
4343
Width="42"
44+
Padding="0"
4445
HorizontalAlignment="Left"
4546
VerticalAlignment="Stretch"
46-
Content="&#xE894;"
47-
FontSize="12"
4847
IsTabStop="False">
48+
<FontIcon FontSize="12" Glyph="&#xE894;" />
4949
<Button.KeyboardAccelerators>
5050
<KeyboardAccelerator Key="Escape" />
5151
</Button.KeyboardAccelerators>

src/Notepads/Controls/FindAndReplace/FindAndReplaceControl.xaml

Lines changed: 51 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -26,18 +26,38 @@
2626
<Grid x:Name="ToggleReplaceModeButtonGrid"
2727
Grid.Row="0"
2828
Grid.Column="0">
29-
<ToggleButton x:Name="ToggleReplaceModeButton"
30-
x:Uid="FindAndReplace_ToggleReplaceModeButton"
31-
Style="{StaticResource ExpanderToggleButtonStyle}"
32-
Width="20"
33-
MinHeight="32"
34-
Content="{StaticResource ExpanderChevronRightGlyph}"
35-
Click="ToggleReplaceModeButton_OnClick"
36-
IsTabStop="False">
37-
<ToggleButton.Resources>
38-
<x:Double x:Key="ExpandCollapseChevronCheckedAngle">90.0</x:Double>
39-
</ToggleButton.Resources>
40-
</ToggleButton>
29+
<Button x:Name="ToggleReplaceModeButton"
30+
x:Uid="FindAndReplace_ToggleReplaceModeButton"
31+
Style="{StaticResource TransparentButtonStyle}"
32+
Width="20"
33+
MinHeight="32"
34+
Padding="0"
35+
Click="ToggleReplaceModeButton_OnClick"
36+
IsTabStop="False">
37+
<Button.Resources>
38+
<x:String x:Key="ExpandCollapseChevronAnimationDuration">00:00:00.200</x:String>
39+
<x:String x:Key="ExpandCollapseChevronKeySpline">0.1,0.25,0.1,0.75</x:String>
40+
41+
<Storyboard x:Name="ReplaceBarClosed">
42+
<DoubleAnimationUsingKeyFrames Storyboard.TargetName="ExpandCollapseChevronTransform" Storyboard.TargetProperty="Rotation">
43+
<SplineDoubleKeyFrame KeyTime="{StaticResource ExpandCollapseChevronAnimationDuration}" Value="0" KeySpline="{StaticResource ExpandCollapseChevronKeySpline}" />
44+
</DoubleAnimationUsingKeyFrames>
45+
</Storyboard>
46+
47+
<Storyboard x:Name="ReplaceBarOpened">
48+
<DoubleAnimationUsingKeyFrames Storyboard.TargetName="ExpandCollapseChevronTransform" Storyboard.TargetProperty="Rotation">
49+
<SplineDoubleKeyFrame KeyTime="{StaticResource ExpandCollapseChevronAnimationDuration}" Value="90" KeySpline="{StaticResource ExpandCollapseChevronKeySpline}" />
50+
</DoubleAnimationUsingKeyFrames>
51+
</Storyboard>
52+
</Button.Resources>
53+
<FontIcon FontSize="12"
54+
Glyph="&#xE974;"
55+
RenderTransformOrigin="0.5 0.5">
56+
<FontIcon.RenderTransform>
57+
<CompositeTransform x:Name="ExpandCollapseChevronTransform" />
58+
</FontIcon.RenderTransform>
59+
</FontIcon>
60+
</Button>
4161
</Grid>
4262

4363
<RelativePanel x:Name="FindBarPlaceHolder"
@@ -95,12 +115,11 @@
95115
</Line>
96116
<Button x:Name="OptionButton"
97117
x:Uid="FindAndReplace_SearchOptionButton"
98-
Style="{StaticResource ChromelessIconButtonStyle}"
118+
Style="{StaticResource TransparentButtonStyle}"
99119
Width="32"
100120
Height="32"
101-
Content="&#xE712;"
102-
FontSize="16"
103121
IsTabStop="False">
122+
<FontIcon FontSize="16" Glyph="&#xE712;" />
104123
<Button.Flyout>
105124
<MenuFlyout Placement="BottomEdgeAlignedRight">
106125
<ToggleMenuFlyoutItem x:Name="MatchCaseToggle"
@@ -145,14 +164,14 @@
145164
<Button x:Name="SearchBackwardButton"
146165
x:Uid="FindAndReplace_SearchBackwardButton"
147166
Grid.Column="0"
148-
Style="{StaticResource ChromelessIconButtonStyle}"
167+
Style="{StaticResource TransparentButtonStyle}"
149168
Width="36"
150169
Height="32"
151-
Content="&#xE74A;"
152-
FontSize="16"
170+
Padding="0"
153171
Click="SearchBackwardButton_OnClick"
154172
IsEnabled="False"
155173
IsTabStop="False">
174+
<FontIcon FontSize="16" Glyph="&#xE74A;" />
156175
<Button.KeyboardAccelerators>
157176
<KeyboardAccelerator Modifiers="Shift" Key="F3" />
158177
</Button.KeyboardAccelerators>
@@ -161,14 +180,14 @@
161180
<Button x:Name="SearchForwardButton"
162181
x:Uid="FindAndReplace_SearchForwardButton"
163182
Grid.Column="1"
164-
Style="{StaticResource ChromelessIconButtonStyle}"
183+
Style="{StaticResource TransparentButtonStyle}"
165184
Width="36"
166185
Height="32"
167-
Content="&#xE74B;"
168-
FontSize="16"
186+
Padding="0"
169187
Click="SearchForwardButton_OnClick"
170188
IsEnabled="False"
171189
IsTabStop="False">
190+
<FontIcon FontSize="16" Glyph="&#xE74B;" />
172191
<Button.KeyboardAccelerators>
173192
<KeyboardAccelerator Key="F3" />
174193
</Button.KeyboardAccelerators>
@@ -177,13 +196,14 @@
177196
<Button x:Name="DismissButton"
178197
x:Uid="FindAndReplace_DismissButton"
179198
Grid.Column="2"
180-
Style="{StaticResource ChromelessIconButtonStyle}"
199+
Style="{StaticResource TransparentButtonStyle}"
181200
Width="36"
182201
Height="32"
183-
Content="&#xE894;"
184-
FontSize="16"
202+
Padding="0"
185203
Click="DismissButton_OnClick"
186-
IsTabStop="False" />
204+
IsTabStop="False">
205+
<FontIcon FontSize="16" Glyph="&#xE894;" />
206+
</Button>
187207
</Grid>
188208

189209
<Grid x:Name="ReplaceBarPlaceHolder"
@@ -218,14 +238,14 @@
218238
<Button x:Name="ReplaceButton"
219239
x:Uid="FindAndReplace_ReplaceButton"
220240
Grid.Column="0"
221-
Style="{StaticResource ChromelessIconButtonStyle}"
241+
Style="{StaticResource TransparentButtonStyle}"
222242
Width="36"
223243
Height="32"
224-
Content="&#xE8AB;"
225-
FontSize="16"
244+
Padding="0"
226245
Click="ReplaceButton_OnClick"
227246
IsEnabled="False"
228247
IsTabStop="False">
248+
<FontIcon FontSize="16" Glyph="&#xE8AB;" />
229249
<Button.KeyboardAccelerators>
230250
<KeyboardAccelerator Modifiers="Menu" Key="R" />
231251
</Button.KeyboardAccelerators>
@@ -234,14 +254,14 @@
234254
<Button x:Name="ReplaceAllButton"
235255
x:Uid="FindAndReplace_ReplaceAllButton"
236256
Grid.Column="1"
237-
Style="{StaticResource ChromelessIconButtonStyle}"
257+
Style="{StaticResource TransparentButtonStyle}"
238258
Width="36"
239259
Height="32"
240-
Content="&#xE7FD;"
241-
FontSize="16"
260+
Padding="0"
242261
Click="ReplaceAllButton_OnClick"
243262
IsEnabled="False"
244263
IsTabStop="False">
264+
<FontIcon FontSize="16" Glyph="&#xE7FD;" />
245265
<Button.KeyboardAccelerators>
246266
<KeyboardAccelerator Modifiers="Control,Menu" Key="Enter" />
247267
</Button.KeyboardAccelerators>

src/Notepads/Controls/FindAndReplace/FindAndReplaceControl.xaml.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,8 @@ public void ShowReplaceBar(bool showReplaceBar)
118118
if (showReplaceBar)
119119
{
120120
ToggleReplaceModeButtonGrid.SetValue(Grid.RowSpanProperty, 2);
121-
ToggleReplaceModeButton.IsChecked = true;
122121
ToggleReplaceModeButton.VerticalAlignment = VerticalAlignment.Stretch;
122+
ReplaceBarOpened.Begin();
123123
ReplaceBarPlaceHolder.Visibility = Visibility.Visible;
124124
if (!string.IsNullOrEmpty(FindBar.Text))
125125
{
@@ -130,7 +130,7 @@ public void ShowReplaceBar(bool showReplaceBar)
130130
else
131131
{
132132
ToggleReplaceModeButtonGrid.SetValue(Grid.RowSpanProperty, 1);
133-
ToggleReplaceModeButton.IsChecked = false;
133+
ReplaceBarClosed.Begin();
134134
ReplaceBarPlaceHolder.Visibility = Visibility.Collapsed;
135135
ReplaceButton.IsEnabled = false;
136136
ReplaceAllButton.IsEnabled = false;
@@ -140,7 +140,6 @@ public void ShowReplaceBar(bool showReplaceBar)
140140
private void DismissButton_OnClick(object sender, RoutedEventArgs e)
141141
{
142142
OnDismissKeyDown?.Invoke(sender, e);
143-
ToggleReplaceModeButton.IsChecked = false;
144143
}
145144

146145
private void FindBar_OnTextChanged(object sender, TextChangedEventArgs e)

src/Notepads/Controls/GoTo/GoToControl.xaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,10 @@
4848
<Button x:Name="SearchButton"
4949
x:Uid="GoTo_SearchButton"
5050
Grid.Column="2"
51-
Style="{StaticResource ChromelessIconButtonStyle}"
51+
Style="{StaticResource TransparentButtonStyle}"
5252
Width="36"
5353
Height="32"
54+
Padding="0"
5455
VerticalAlignment="Top"
5556
Content="&#xEBE7;"
5657
FontSize="16"
@@ -62,9 +63,10 @@
6263
<Button x:Name="DismissButton"
6364
x:Uid="FindAndReplace_DismissButton"
6465
Grid.Column="3"
65-
Style="{StaticResource ChromelessIconButtonStyle}"
66+
Style="{StaticResource TransparentButtonStyle}"
6667
Width="36"
6768
Height="32"
69+
Padding="0"
6870
VerticalAlignment="Top"
6971
Content="&#xE894;"
7072
FontSize="16"

src/Notepads/Notepads.csproj

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -401,11 +401,7 @@
401401
<SubType>Designer</SubType>
402402
<Generator>MSBuild:Compile</Generator>
403403
</Page>
404-
<Page Include="Resource\ChromelessIconButtonStyle.xaml">
405-
<SubType>Designer</SubType>
406-
<Generator>MSBuild:Compile</Generator>
407-
</Page>
408-
<Page Include="Resource\ExpanderToggleButtonStyle.xaml">
404+
<Page Include="Resource\TransparentButtonStyle.xaml">
409405
<SubType>Designer</SubType>
410406
<Generator>MSBuild:Compile</Generator>
411407
</Page>

src/Notepads/Resource/ChromelessIconButtonStyle.xaml

Lines changed: 0 additions & 89 deletions
This file was deleted.

0 commit comments

Comments
 (0)