Skip to content

Commit ed9be2d

Browse files
author
Yair Aichenbaum
committed
Improved shadow for the Ribbon
1 parent f2b2551 commit ed9be2d

File tree

3 files changed

+23
-41
lines changed

3 files changed

+23
-41
lines changed

Files/Controls/RibbonArea.xaml

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1822,13 +1822,14 @@
18221822
</Button.KeyboardAccelerators>
18231823
</Button>
18241824
</StackPanel>
1825-
1826-
1825+
1826+
18271827
<Grid
18281828
Grid.Column="1"
1829-
Padding="4,0,4,0" Height="34"
1829+
Height="40"
1830+
Padding="4,0,4,0"
18301831
VerticalAlignment="Center">
1831-
1832+
18321833
<TextBox
18331834
x:Name="VisiblePath"
18341835
Padding="4"
@@ -1847,7 +1848,7 @@
18471848
ScrollViewer.VerticalScrollBarVisibility="Hidden"
18481849
Text="{x:Bind local:App.CurrentInstance.PathControlDisplayText, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
18491850
Visibility="Collapsed" />
1850-
1851+
18511852
<Grid
18521853
x:Name="ClickablePath"
18531854
Height="32.5"
@@ -1866,13 +1867,13 @@
18661867
Text="Edit address" />
18671868
</MenuFlyout>
18681869
</Grid.ContextFlyout>
1869-
1870+
18701871
<ListView
18711872
x:Name="PathViewInteract"
1872-
x:FieldModifier="public"
18731873
VerticalAlignment="Stretch"
18741874
HorizontalContentAlignment="Stretch"
18751875
VerticalContentAlignment="Stretch"
1876+
x:FieldModifier="public"
18761877
Background="{ThemeResource TextControlBackground}"
18771878
CanReorderItems="False"
18781879
IsItemClickEnabled="True"
@@ -1908,11 +1909,11 @@
19081909
</ItemsPanelTemplate>
19091910
</ListView.ItemsPanel>
19101911
</ListView>
1911-
1912+
19121913
</Grid>
1913-
1914+
19141915
</Grid>
1915-
1916+
19161917
<Custom:GridSplitter
19171918
x:Name="SearchBoxResizer"
19181919
Grid.Column="1"

Files/ProHome.xaml

Lines changed: 12 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@
1313
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
1414
xmlns:muxc="using:Microsoft.UI.Xaml.Controls"
1515
x:Name="ProHomeInstance"
16-
NavigationCacheMode="Disabled"
1716
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"
1817
Loaded="Page_Loaded"
18+
NavigationCacheMode="Disabled"
1919
mc:Ignorable="d">
2020
<Page.Resources>
2121
<ResourceDictionary>
@@ -82,7 +82,7 @@
8282
</Setter.Value>
8383
</Setter>
8484
</Style>
85-
85+
8686
</ResourceDictionary>
8787
</Page.Resources>
8888

@@ -92,29 +92,15 @@
9292
<RowDefinition Height="*" />
9393
</Grid.RowDefinitions>
9494

95-
<StackPanel Grid.Row="0" Orientation="Vertical">
96-
<controls:RibbonArea
97-
x:Name="RibbonArea"
98-
x:FieldModifier="public"
99-
/>
100-
<Windows10version1903:Grid>
101-
<Grid.Resources>
102-
<Windows10version1903:ThemeShadow x:Name="themeShadow" />
103-
</Grid.Resources>
104-
<Grid
105-
x:Name="ShadowReceiver"
106-
Height="8"
107-
Background="Transparent" />
108-
<Grid
109-
x:Name="ShadowCaster"
110-
Height="4"
111-
VerticalAlignment="Top"
112-
Windows10version1903:Shadow="{x:Bind themeShadow}"
113-
Background="{ThemeResource RibbonBackgroundColor}"
114-
Canvas.ZIndex="2"
115-
Translation="0,0,4" />
116-
</Windows10version1903:Grid>
117-
</StackPanel>
95+
<Custom:DropShadowPanel
96+
Height="Auto"
97+
HorizontalAlignment="Stretch"
98+
HorizontalContentAlignment="Stretch"
99+
Canvas.ZIndex="100"
100+
OffsetY="3"
101+
ShadowOpacity=".1">
102+
<controls:RibbonArea x:Name="RibbonArea" x:FieldModifier="public" />
103+
</Custom:DropShadowPanel>
118104

119105
<SplitView
120106
x:Name="splitView"
@@ -128,7 +114,7 @@
128114
PaneBackground="{ThemeResource ApplicationPageBackgroundThemeBrush}">
129115
<SplitView.Pane>
130116
<ScrollViewer Margin="0,0,0,0" VerticalScrollBarVisibility="Auto">
131-
<controls:Sidebar x:FieldModifier="public" x:Name="SidebarControl"/>
117+
<controls:Sidebar x:Name="SidebarControl" x:FieldModifier="public" />
132118
</ScrollViewer>
133119
</SplitView.Pane>
134120

Files/ProHome.xaml.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -138,11 +138,6 @@ public ProHome()
138138
this.InitializeComponent();
139139
RibbonArea.VisiblePath.Text = "New tab";
140140

141-
if (ApiInformation.IsTypePresent("Windows.UI.Xaml.Media.ThemeShadow"))
142-
{
143-
themeShadow.Receivers.Add(ShadowReceiver);
144-
}
145-
146141
// Acrylic sidebar
147142
var localSettings = ApplicationData.Current.LocalSettings;
148143
if (localSettings.Values["acrylicSidebar"] != null && localSettings.Values["acrylicSidebar"].Equals(true))

0 commit comments

Comments
 (0)