Skip to content

Commit 2bee74e

Browse files
committed
Remove ToggleSwitchStyles
1 parent a865604 commit 2bee74e

File tree

11 files changed

+61
-837
lines changed

11 files changed

+61
-837
lines changed

src/Files.App/Styles/ToggleSwitchStyles.xaml

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

src/Files.App/UserControls/Toolbar.xaml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
<ResourceDictionary>
1919
<ResourceDictionary.MergedDictionaries>
2020
<ResourceDictionary Source="ms-appx:///Styles/ToolbarButtonStyle.xaml" />
21-
<ResourceDictionary Source="ms-appx:///Styles/ToggleSwitchStyles.xaml" />
2221
</ResourceDictionary.MergedDictionaries>
2322

2423
<SolidColorBrush x:Key="CommandBarBackground" Color="Transparent" />
@@ -1176,11 +1175,11 @@
11761175
<ToggleSwitch
11771176
Grid.Row="0"
11781177
Grid.Column="1"
1178+
MinWidth="68"
11791179
HorizontalAlignment="Right"
11801180
AccessKey="H"
11811181
AutomationProperties.Name="{x:Bind Commands.ToggleShowHiddenItems.AutomationName}"
11821182
IsOn="{x:Bind Commands.ToggleShowHiddenItems.IsOn, Mode=TwoWay}"
1183-
Style="{StaticResource RightAlignedToggleSwitchStyle}"
11841183
ToolTipService.ToolTip="{x:Bind Commands.ToggleShowHiddenItems.HotKeyText, Mode=OneWay}" />
11851184

11861185
<!-- Show File Extensions -->
@@ -1193,12 +1192,12 @@
11931192
<ToggleSwitch
11941193
Grid.Row="1"
11951194
Grid.Column="1"
1195+
MinWidth="68"
11961196
HorizontalAlignment="Right"
11971197
AccessKey="E"
11981198
AutomationProperties.Name="{x:Bind Commands.ToggleShowFileExtensions.AutomationName}"
11991199
IsOn="{x:Bind Commands.ToggleShowFileExtensions.IsOn, Mode=TwoWay}"
12001200
Rotation="1"
1201-
Style="{StaticResource RightAlignedToggleSwitchStyle}"
12021201
ToolTipService.ToolTip="{x:Bind Commands.ToggleShowFileExtensions.HotKeyText, Mode=OneWay}" />
12031202

12041203
<!-- Adaptive Layout -->
@@ -1214,13 +1213,13 @@
12141213
x:Name="AdaptiveLayoutToggleSwitch"
12151214
Grid.Row="2"
12161215
Grid.Column="1"
1216+
MinWidth="68"
12171217
HorizontalAlignment="Right"
12181218
x:Load="{x:Bind Commands.LayoutAdaptive.IsExecutable, Mode=OneWay}"
12191219
AutomationProperties.Name="{x:Bind Commands.LayoutAdaptive.AutomationName}"
12201220
IsEnabled="{x:Bind Commands.LayoutAdaptive.IsExecutable, Mode=OneWay}"
12211221
IsOn="{x:Bind Commands.LayoutAdaptive.IsOn, Mode=TwoWay}"
12221222
Rotation="1"
1223-
Style="{StaticResource RightAlignedToggleSwitchStyle}"
12241223
ToolTipService.ToolTip="{x:Bind Commands.LayoutAdaptive.LabelWithHotKey, Mode=OneWay}" />
12251224
</Grid>
12261225

src/Files.App/Views/Properties/CompatibilityPage.xaml

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
<ResourceDictionary>
1919
<ResourceDictionary.MergedDictionaries>
2020
<ResourceDictionary Source="ms-appx:///Styles/PropertiesStyles.xaml" />
21-
<ResourceDictionary Source="/Styles/ToggleSwitchStyles.xaml" />
2221
</ResourceDictionary.MergedDictionaries>
2322

2423
<converters:NullToTrueConverter x:Key="NullToFalseConverter" Inverse="True" />
@@ -57,34 +56,22 @@
5756

5857
<!-- Run In Low Resolution -->
5958
<wctcontrols:SettingsCard Header="{helpers:ResourceString Name=CompatibilityRunIn640x480Resolution}">
60-
<ToggleSwitch
61-
AutomationProperties.Name="{helpers:ResourceString Name=CompatibilityRunIn640x480Resolution}"
62-
IsOn="{x:Bind CompatibilityViewModel.RunIn40x480Resolution, Mode=TwoWay}"
63-
Style="{StaticResource RightAlignedToggleSwitchStyle}" />
59+
<ToggleSwitch AutomationProperties.Name="{helpers:ResourceString Name=CompatibilityRunIn640x480Resolution}" IsOn="{x:Bind CompatibilityViewModel.RunIn40x480Resolution, Mode=TwoWay}" />
6460
</wctcontrols:SettingsCard>
6561

6662
<!-- Disable Full Screen Optimizations -->
6763
<wctcontrols:SettingsCard Header="{helpers:ResourceString Name=CompatibilityDisableFullscreenOptimizations}">
68-
<ToggleSwitch
69-
AutomationProperties.Name="{helpers:ResourceString Name=CompatibilityDisableFullscreenOptimizations}"
70-
IsOn="{x:Bind CompatibilityViewModel.DisableFullscreenOptimization, Mode=TwoWay}"
71-
Style="{StaticResource RightAlignedToggleSwitchStyle}" />
64+
<ToggleSwitch AutomationProperties.Name="{helpers:ResourceString Name=CompatibilityDisableFullscreenOptimizations}" IsOn="{x:Bind CompatibilityViewModel.DisableFullscreenOptimization, Mode=TwoWay}" />
7265
</wctcontrols:SettingsCard>
7366

7467
<!-- Run As Admin -->
7568
<wctcontrols:SettingsCard Header="{helpers:ResourceString Name=RunAsAdministrator}">
76-
<ToggleSwitch
77-
AutomationProperties.Name="{helpers:ResourceString Name=RunAsAdministrator}"
78-
IsOn="{x:Bind CompatibilityViewModel.RunAsAdministrator, Mode=TwoWay}"
79-
Style="{StaticResource RightAlignedToggleSwitchStyle}" />
69+
<ToggleSwitch AutomationProperties.Name="{helpers:ResourceString Name=RunAsAdministrator}" IsOn="{x:Bind CompatibilityViewModel.RunAsAdministrator, Mode=TwoWay}" />
8070
</wctcontrols:SettingsCard>
8171

8272
<!-- Register App For Restart -->
8373
<wctcontrols:SettingsCard Header="{helpers:ResourceString Name=CompatibilityRegisterThisProgramForRestart}">
84-
<ToggleSwitch
85-
AutomationProperties.Name="{helpers:ResourceString Name=CompatibilityRegisterThisProgramForRestart}"
86-
IsOn="{x:Bind CompatibilityViewModel.RegisterForRestart, Mode=TwoWay}"
87-
Style="{StaticResource RightAlignedToggleSwitchStyle}" />
74+
<ToggleSwitch AutomationProperties.Name="{helpers:ResourceString Name=CompatibilityRegisterThisProgramForRestart}" IsOn="{x:Bind CompatibilityViewModel.RegisterForRestart, Mode=TwoWay}" />
8875
</wctcontrols:SettingsCard>
8976

9077
<!-- High DPI Options -->

src/Files.App/Views/Properties/ShortcutPage.xaml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
<ResourceDictionary>
1717
<ResourceDictionary.MergedDictionaries>
1818
<ResourceDictionary Source="ms-appx:///Styles/PropertiesStyles.xaml" />
19-
<ResourceDictionary Source="ms-appx:///Styles/ToggleSwitchStyles.xaml" />
2019
</ResourceDictionary.MergedDictionaries>
2120
</ResourceDictionary>
2221
</vm:BasePropertiesPage.Resources>
@@ -148,10 +147,7 @@
148147
x:Name="RunAsAdminCheckbox"
149148
x:Load="{x:Bind ViewModel.RunAsAdminEnabled, Mode=OneWay}"
150149
Header="{helpers:ResourceString Name=RunAsAdministrator}">
151-
<ToggleSwitch
152-
AutomationProperties.Name="{helpers:ResourceString Name=RunAsAdministrator}"
153-
IsOn="{x:Bind ViewModel.RunAsAdminEditedValue, Mode=TwoWay}"
154-
Style="{StaticResource RightAlignedToggleSwitchStyle}" />
150+
<ToggleSwitch AutomationProperties.Name="{helpers:ResourceString Name=RunAsAdministrator}" IsOn="{x:Bind ViewModel.RunAsAdminEditedValue, Mode=TwoWay}" />
155151
</wctcontrols:SettingsCard>
156152

157153
<wctcontrols:SettingsCard

src/Files.App/Views/Settings/ActionsPage.xaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535
</ResourceDictionary.ThemeDictionaries>
3636

3737
<ResourceDictionary.MergedDictionaries>
38-
<ResourceDictionary Source="ms-appx:///Styles/ToggleSwitchStyles.xaml" />
3938
<ResourceDictionary Source="ms-appx:///UserControls/KeyboardShortcut/KeyboardShortcut.xaml" />
4039
</ResourceDictionary.MergedDictionaries>
4140

src/Files.App/Views/Settings/AdvancedPage.xaml

Lines changed: 6 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,6 @@
1414

1515
<Page.Resources>
1616
<ResourceDictionary>
17-
<ResourceDictionary.MergedDictionaries>
18-
<ResourceDictionary Source="/Styles/ToggleSwitchStyles.xaml" />
19-
</ResourceDictionary.MergedDictionaries>
20-
2117
<converters:BoolNegationConverter x:Key="BoolNegationConverter" />
2218
</ResourceDictionary>
2319
</Page.Resources>
@@ -98,8 +94,7 @@
9894
<ToggleSwitch
9995
AutomationProperties.Name="{helpers:ResourceString Name=SettingsOpenInLogin}"
10096
IsEnabled="{x:Bind ViewModel.CanOpenOnWindowsStartup, Mode=OneWay}"
101-
IsOn="{x:Bind ViewModel.OpenOnWindowsStartup, Mode=TwoWay}"
102-
Style="{StaticResource RightAlignedToggleSwitchStyle}">
97+
IsOn="{x:Bind ViewModel.OpenOnWindowsStartup, Mode=TwoWay}">
10398
<i:Interaction.Behaviors>
10499
<i:EventTriggerBehavior EventName="Toggled">
105100
<i:InvokeCommandAction Command="{x:Bind ViewModel.OpenFilesOnWindowsStartupCommand, Mode=OneWay}" />
@@ -114,21 +109,15 @@
114109
<wctcontrols:SettingsCard.HeaderIcon>
115110
<FontIcon Glyph="&#xE8E6;" />
116111
</wctcontrols:SettingsCard.HeaderIcon>
117-
<ToggleSwitch
118-
AutomationProperties.Name="{helpers:ResourceString Name=SettingsLeaveAppRunning}"
119-
IsOn="{x:Bind ViewModel.LeaveAppRunning, Mode=TwoWay}"
120-
Style="{StaticResource RightAlignedToggleSwitchStyle}" />
112+
<ToggleSwitch AutomationProperties.Name="{helpers:ResourceString Name=SettingsLeaveAppRunning}" IsOn="{x:Bind ViewModel.LeaveAppRunning, Mode=TwoWay}" />
121113
</wctcontrols:SettingsCard>
122114

123115
<!-- System Tray Icon -->
124116
<wctcontrols:SettingsCard HorizontalAlignment="Stretch" Header="{helpers:ResourceString Name=ShowSystemTrayIcon}">
125117
<wctcontrols:SettingsCard.HeaderIcon>
126118
<FontIcon Glyph="&#xE75B;" />
127119
</wctcontrols:SettingsCard.HeaderIcon>
128-
<ToggleSwitch
129-
AutomationProperties.Name="{helpers:ResourceString Name=ShowSystemTrayIcon}"
130-
IsOn="{x:Bind ViewModel.ShowSystemTrayIcon, Mode=TwoWay}"
131-
Style="{StaticResource RightAlignedToggleSwitchStyle}" />
120+
<ToggleSwitch AutomationProperties.Name="{helpers:ResourceString Name=ShowSystemTrayIcon}" IsOn="{x:Bind ViewModel.ShowSystemTrayIcon, Mode=TwoWay}" />
132121
</wctcontrols:SettingsCard>
133122

134123
<!-- Experimental Settings -->
@@ -147,10 +136,7 @@
147136
<wctcontrols:SettingsCard.HeaderIcon>
148137
<FontIcon Glyph="&#xEC50;" />
149138
</wctcontrols:SettingsCard.HeaderIcon>
150-
<ToggleSwitch
151-
AutomationProperties.Name="{helpers:ResourceString Name=SettingsSetAsDefaultFileManager}"
152-
IsOn="{x:Bind ViewModel.IsSetAsDefaultFileManager, Mode=TwoWay}"
153-
Style="{StaticResource RightAlignedToggleSwitchStyle}">
139+
<ToggleSwitch AutomationProperties.Name="{helpers:ResourceString Name=SettingsSetAsDefaultFileManager}" IsOn="{x:Bind ViewModel.IsSetAsDefaultFileManager, Mode=TwoWay}">
154140
<i:Interaction.Behaviors>
155141
<i:EventTriggerBehavior EventName="Toggled">
156142
<i:InvokeCommandAction Command="{x:Bind ViewModel.SetAsDefaultExplorerCommand, Mode=OneWay}" />
@@ -168,10 +154,7 @@
168154
<wctcontrols:SettingsCard.HeaderIcon>
169155
<FontIcon Glyph="&#xE8E5;" />
170156
</wctcontrols:SettingsCard.HeaderIcon>
171-
<ToggleSwitch
172-
IsEnabled="{x:Bind ViewModel.IsSetAsDefaultFileManager, Mode=OneWay}"
173-
IsOn="{x:Bind ViewModel.IsSetAsOpenFileDialog, Mode=TwoWay}"
174-
Style="{StaticResource RightAlignedToggleSwitchStyle}">
157+
<ToggleSwitch IsEnabled="{x:Bind ViewModel.IsSetAsDefaultFileManager, Mode=OneWay}" IsOn="{x:Bind ViewModel.IsSetAsOpenFileDialog, Mode=TwoWay}">
175158
<i:Interaction.Behaviors>
176159
<i:EventTriggerBehavior EventName="Toggled">
177160
<i:InvokeCommandAction Command="{x:Bind ViewModel.SetAsOpenFileDialogCommand, Mode=OneWay}" />
@@ -188,10 +171,7 @@
188171
<wctcontrols:SettingsCard.HeaderIcon>
189172
<FontIcon Glyph="&#xE8B7;" />
190173
</wctcontrols:SettingsCard.HeaderIcon>
191-
<ToggleSwitch
192-
AutomationProperties.Name="{helpers:ResourceString Name=ShowFlattenOptions}"
193-
IsOn="{x:Bind ViewModel.ShowFlattenOptions, Mode=TwoWay}"
194-
Style="{StaticResource RightAlignedToggleSwitchStyle}" />
174+
<ToggleSwitch AutomationProperties.Name="{helpers:ResourceString Name=ShowFlattenOptions}" IsOn="{x:Bind ViewModel.ShowFlattenOptions, Mode=TwoWay}" />
195175
</wctcontrols:SettingsCard>
196176
</StackPanel>
197177
</Grid>

src/Files.App/Views/Settings/AppearancePage.xaml

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,6 @@
1616

1717
<Page.Resources>
1818
<ResourceDictionary>
19-
<ResourceDictionary.MergedDictionaries>
20-
<ResourceDictionary Source="/Styles/ToggleSwitchStyles.xaml" />
21-
</ResourceDictionary.MergedDictionaries>
22-
2319
<wctconverters:BoolNegationConverter x:Key="BoolNegationConverter" />
2420
<converters:StringToBrushConverter x:Key="StringToBrushConverter" />
2521

@@ -243,8 +239,7 @@
243239
<ToggleSwitch
244240
AutomationProperties.AutomationControlType="Custom"
245241
AutomationProperties.Name="{helpers:ResourceString Name=ShowTabActions}"
246-
IsOn="{x:Bind ViewModel.ShowTabActions, Mode=TwoWay}"
247-
Style="{StaticResource RightAlignedToggleSwitchStyle}" />
242+
IsOn="{x:Bind ViewModel.ShowTabActions, Mode=TwoWay}" />
248243
</wctcontrols:SettingsCard>
249244

250245
<!-- Toolbar -->
@@ -259,27 +254,20 @@
259254
<ToggleSwitch
260255
AutomationProperties.AutomationControlType="Custom"
261256
AutomationProperties.Name="{helpers:ResourceString Name=ShowHomeButton}"
262-
IsOn="{x:Bind ViewModel.ShowHomeButton, Mode=TwoWay}"
263-
Style="{StaticResource RightAlignedToggleSwitchStyle}" />
257+
IsOn="{x:Bind ViewModel.ShowHomeButton, Mode=TwoWay}" />
264258
</wctcontrols:SettingsCard>
265259

266260
<!-- Show shelf pane toggle button -->
267261
<wctcontrols:SettingsCard
268262
x:Name="ShowShelfPaneSetting"
269263
Header="{helpers:ResourceString Name=ShowShelfPaneButtonInAddressBar}"
270264
Visibility="{x:Bind ViewModel.IsAppEnvironmentDev, Mode=OneTime}">
271-
<ToggleSwitch
272-
AutomationProperties.Name="{helpers:ResourceString Name=ShowShelfPaneButtonInAddressBar}"
273-
IsOn="{x:Bind ViewModel.ShowShelfPaneToggleButton, Mode=TwoWay}"
274-
Style="{StaticResource RightAlignedToggleSwitchStyle}" />
265+
<ToggleSwitch AutomationProperties.Name="{helpers:ResourceString Name=ShowShelfPaneButtonInAddressBar}" IsOn="{x:Bind ViewModel.ShowShelfPaneToggleButton, Mode=TwoWay}" />
275266
</wctcontrols:SettingsCard>
276267

277268
<!-- Show toolbar -->
278269
<wctcontrols:SettingsCard Header="{helpers:ResourceString Name=ShowToolbar}">
279-
<ToggleSwitch
280-
AutomationProperties.Name="{helpers:ResourceString Name=ShowToolbar}"
281-
IsOn="{x:Bind ViewModel.ShowToolbar, Mode=TwoWay}"
282-
Style="{StaticResource RightAlignedToggleSwitchStyle}" />
270+
<ToggleSwitch AutomationProperties.Name="{helpers:ResourceString Name=ShowToolbar}" IsOn="{x:Bind ViewModel.ShowToolbar, Mode=TwoWay}" />
283271
</wctcontrols:SettingsCard>
284272
</wctcontrols:SettingsExpander.Items>
285273
</wctcontrols:SettingsExpander>

src/Files.App/Views/Settings/DevToolsPage.xaml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,6 @@
1616

1717
<Page.Resources>
1818
<ResourceDictionary>
19-
<ResourceDictionary.MergedDictionaries>
20-
<ResourceDictionary Source="/Styles/ToggleSwitchStyles.xaml" />
21-
</ResourceDictionary.MergedDictionaries>
22-
2319
<converters:BoolNegationConverter x:Key="BoolNegationConverter" />
2420
<wctconverters:BoolToVisibilityConverter
2521
x:Key="BoolVisibilityConverter"

0 commit comments

Comments
 (0)