Skip to content
This repository has been archived by the owner on Feb 13, 2024. It is now read-only.

Commit

Permalink
TextBox context menu (win)
Browse files Browse the repository at this point in the history
Tweak context menu width
  • Loading branch information
skel35 committed Mar 5, 2020
1 parent 4aea7d8 commit 08ecfb8
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@
<Setter Property="BorderBrush" Value="{DynamicResource Toggl.LightGrayBrush}" />
<Setter Property="Foreground" Value="{DynamicResource Toggl.PrimaryTextBrush}" />
<Setter Property="FontSize" Value="{StaticResource NormalFontSize}" />
<Setter Property="Width" Value="280" />
<Setter Property="Padding" Value="0 4" />
</Style>

<Style TargetType="MenuItem" BasedOn="{StaticResource MahApps.Styles.MenuItem}">
<Setter Property="Background" Value="{DynamicResource Toggl.CardBackground}" />
<Setter Property="Width" Value="300" />
<Setter Property="Height" Value="32" />
<Style.Triggers>
<Trigger Property="Role" Value="SubmenuItem">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Controls.TextBlock.xaml" />
</ResourceDictionary.MergedDictionaries>

<ContextMenu x:Key="Toggl.TextBox.ContextMenu" Width="200">
<MenuItem Command="ApplicationCommands.Cut" />
<MenuItem Command="ApplicationCommands.Copy" />
<MenuItem Command="ApplicationCommands.Paste" />
</ContextMenu>

<Style x:Key="MahApps.Styles.TextBlock.Watermark"
BasedOn="{StaticResource MahApps.Styles.TextBlock}"
TargetType="{x:Type TextBlock}">
Expand All @@ -28,6 +34,7 @@
<Setter Property="Height" Value="32" />
<Setter Property="behaviors:TextBoxHelper.IsPaddingClickable" Value="True" />
<Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="ContextMenu" Value="{StaticResource Toggl.TextBox.ContextMenu}" />
<Style.Triggers>
<Trigger Property="IsEnabled" Value="False">
<Setter Property="Foreground" Value="{DynamicResource Toggl.DisabledTextBrush}" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
Style="{StaticResource Toggl.CogwheelButton}">
<Button.ContextMenu>
<ContextMenu Name="mainContextMenu" x:FieldModifier="private"
Width="300"
Closed="onMainContextMenuClosed">
<ContextMenu.Resources>
<Style TargetType="TextBlock" BasedOn="{StaticResource Toggl.CaptionText}">
Expand Down

0 comments on commit 08ecfb8

Please sign in to comment.