Skip to content

Commit

Permalink
🎨 Add drop shadow to the custom menu editor.
Browse files Browse the repository at this point in the history
  • Loading branch information
hexawyz committed Apr 5, 2024
1 parent d3bdfbe commit d030aa1
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Exo.Settings.Ui/CustomMenuPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
CanReorderItems="True" />
<TextBox
Grid.Row="3"
Margin="0,6,0,6"
Margin="0,18,0,6"
Visibility="{Binding SelectedMenuItemHasText, Converter={StaticResource BooleanToVisibilityConverter}}"
Text="{Binding SelectedMenuItem.Text, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
MaxWidth="{ThemeResource FlyoutThemeMaxWidth}" />
Expand Down
17 changes: 15 additions & 2 deletions Exo.Settings.Ui/DataTemplates.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:Exo.Settings.Ui"
xmlns:vm="using:Exo.Settings.Ui.ViewModels">
xmlns:vm="using:Exo.Settings.Ui.ViewModels"
xmlns:numerics="using:System.Numerics">

<!-- Monitor setting UI templates -->
<DataTemplate x:Key="MonitorBrightnessSettingTemplate" x:DataType="vm:MonitorDeviceSettingViewModel">
Expand Down Expand Up @@ -197,6 +198,11 @@

<!-- Derived from DefaultMenuFlyoutPresenterStyle -->
<Style x:Key="MenuPreviewStyle" TargetType="ListView">
<Setter Property="Shadow">
<Setter.Value>
<ThemeShadow />
</Setter.Value>
</Setter>
<Setter Property="Background" Value="{ThemeResource MenuFlyoutPresenterBackground}" />
<Setter Property="BorderBrush" Value="{ThemeResource MenuFlyoutPresenterBorderBrush}" />
<Setter Property="BorderThickness" Value="{ThemeResource MenuFlyoutPresenterBorderThemeThickness}" />
Expand All @@ -222,7 +228,14 @@
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ListView">
<Border Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="{TemplateBinding CornerRadius}" BackgroundSizing="InnerBorderEdge">
<Border
Shadow="{TemplateBinding Shadow}"
Translation="0,0,32"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="{TemplateBinding CornerRadius}"
BackgroundSizing="InnerBorderEdge">
<ScrollViewer x:Name="MenuFlyoutPresenterScrollViewer" Margin="{TemplateBinding Padding}" MinWidth="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.FlyoutContentMinWidth}" HorizontalScrollMode="{TemplateBinding ScrollViewer.HorizontalScrollMode}" HorizontalScrollBarVisibility="{TemplateBinding ScrollViewer.HorizontalScrollBarVisibility}" VerticalScrollMode="{TemplateBinding ScrollViewer.VerticalScrollMode}" VerticalScrollBarVisibility="{TemplateBinding ScrollViewer.VerticalScrollBarVisibility}" IsHorizontalRailEnabled="{TemplateBinding ScrollViewer.IsHorizontalRailEnabled}" IsVerticalRailEnabled="{TemplateBinding ScrollViewer.IsVerticalRailEnabled}" ZoomMode="{TemplateBinding ScrollViewer.ZoomMode}" AutomationProperties.AccessibilityView="Raw">
<ItemsPresenter />
</ScrollViewer>
Expand Down

0 comments on commit d030aa1

Please sign in to comment.