Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(GH-4030) Fix ToggleSwitch Right Alignment #4052

Merged
merged 1 commit into from
Feb 25, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/MahApps.Metro/Styles/Controls.ContextMenu.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,9 @@
<Setter Property="VerticalContentAlignment" Value="Center" />
</Style>

<ContextMenu x:Key="MahApps.TextBox.ContextMenu" Style="{StaticResource MahApps.Styles.ContextMenu}" x:Shared="False">
<ContextMenu x:Key="MahApps.TextBox.ContextMenu"
x:Shared="False"
Style="{StaticResource MahApps.Styles.ContextMenu}">
<MenuItem Command="ApplicationCommands.Cut" Style="{DynamicResource MahApps.Styles.MenuItem}" />
<MenuItem Command="ApplicationCommands.Copy" Style="{DynamicResource MahApps.Styles.MenuItem}" />
<MenuItem Command="ApplicationCommands.Paste" Style="{DynamicResource MahApps.Styles.MenuItem}" />
Expand Down
4 changes: 3 additions & 1 deletion src/MahApps.Metro/Styles/VS/ContextMenu.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,9 @@
<Setter Property="VerticalContentAlignment" Value="Center" />
</Style>

<ContextMenu x:Key="MahApps.TextBox.ContextMenu" Style="{StaticResource MahApps.Styles.ContextMenu.VisualStudio}" x:Shared="False">
<ContextMenu x:Key="MahApps.TextBox.ContextMenu"
x:Shared="False"
Style="{StaticResource MahApps.Styles.ContextMenu.VisualStudio}">
<MenuItem Command="ApplicationCommands.Cut" Style="{DynamicResource MahApps.Styles.MenuItem.VisualStudio}" />
<MenuItem Command="ApplicationCommands.Copy" Style="{DynamicResource MahApps.Styles.MenuItem.VisualStudio}" />
<MenuItem Command="ApplicationCommands.Paste" Style="{DynamicResource MahApps.Styles.MenuItem.VisualStudio}" />
Expand Down
6 changes: 4 additions & 2 deletions src/MahApps.Metro/Themes/ToggleSwitch.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
<Setter Property="Foreground" Value="{DynamicResource MahApps.Brushes.ToggleSwitch.ContentForeground}" />
<Setter Property="HorizontalAlignment" Value="Left" />
<Setter Property="HorizontalContentAlignment" Value="Left" />
<Setter Property="MinWidth" Value="{DynamicResource ToggleSwitchThemeMinWidth}" />
<Setter Property="SnapsToDevicePixels" Value="True" />
<Setter Property="Template">
<Setter.Value>
Expand Down Expand Up @@ -55,8 +56,8 @@
TextElement.Foreground="{TemplateBinding mah:HeaderedControlHelper.HeaderForeground}"
Visibility="Collapsed" />

<Grid Grid.Row="1"
MinWidth="{DynamicResource ToggleSwitchThemeMinWidth}"
<Grid x:Name="SwitchContentGrid"
Grid.Row="1"
HorizontalAlignment="Left"
VerticalAlignment="Top">

Expand Down Expand Up @@ -345,6 +346,7 @@
<Setter TargetName="OffContentPresenter" Property="Grid.Column" Value="0" />
<Setter TargetName="OnContentPresenter" Property="Grid.Column" Value="0" />
<Setter TargetName="Switch" Property="Grid.Column" Value="2" />
<Setter TargetName="SwitchContentGrid" Property="HorizontalAlignment" Value="Right" />
</Trigger>

<!-- MouseOver -->
Expand Down