Skip to content

Commit 81bd6a4

Browse files
authored
Removed extra controls from the Visual Tree (#7824)
1 parent 5e0619b commit 81bd6a4

File tree

7 files changed

+693
-677
lines changed

7 files changed

+693
-677
lines changed

src/Files/UserControls/Widgets/DrivesWidget.xaml

Lines changed: 160 additions & 161 deletions
Large diffs are not rendered by default.

src/Files/UserControls/Widgets/FolderWidget.xaml

Lines changed: 89 additions & 91 deletions
Original file line numberDiff line numberDiff line change
@@ -28,99 +28,97 @@
2828
</muxc:ItemsRepeater.Layout>
2929
<muxc:ItemsRepeater.ItemTemplate>
3030
<DataTemplate x:DataType="local:LibraryCardItem">
31-
<Grid>
32-
<Button
33-
Padding="0"
31+
<Button
32+
Padding="0"
33+
HorizontalAlignment="Stretch"
34+
VerticalAlignment="Stretch"
35+
HorizontalContentAlignment="Stretch"
36+
VerticalContentAlignment="Stretch"
37+
AutomationProperties.Name="{x:Bind AutomationProperties}"
38+
Command="{x:Bind SelectCommand}"
39+
CommandParameter="{x:Bind}"
40+
CornerRadius="{StaticResource ControlCornerRadius}"
41+
PointerPressed="Button_PointerPressed"
42+
Tag="{x:Bind Path}">
43+
<Button.ContextFlyout>
44+
<MenuFlyout Opening="MenuFlyout_Opening">
45+
<MenuFlyout.Items>
46+
<MenuFlyoutItem
47+
x:Name="OpenInNewPane"
48+
x:Uid="SideBarOpenInNewPane"
49+
x:Load="{x:Bind HasPath}"
50+
Click="OpenInNewPane_Click"
51+
DataContext="{x:Bind}"
52+
Text="Open in new pane"
53+
Visibility="Collapsed">
54+
<MenuFlyoutItem.Icon>
55+
<FontIcon FontFamily="{StaticResource CustomGlyph}" Glyph="&#xF117;" />
56+
</MenuFlyoutItem.Icon>
57+
</MenuFlyoutItem>
58+
<MenuFlyoutItem
59+
x:Name="OpenInNewTab"
60+
x:Uid="SideBarOpenInNewTab"
61+
x:Load="{x:Bind HasPath}"
62+
Click="OpenInNewTab_Click"
63+
DataContext="{x:Bind}"
64+
Text="Open in new tab">
65+
<MenuFlyoutItem.Icon>
66+
<FontIcon FontFamily="{StaticResource CustomGlyph}" Glyph="&#xF113;" />
67+
</MenuFlyoutItem.Icon>
68+
</MenuFlyoutItem>
69+
<MenuFlyoutItem
70+
x:Name="OpenInNewWindow"
71+
x:Uid="SideBarOpenInNewWindow"
72+
x:Load="{x:Bind HasPath}"
73+
Click="OpenInNewWindow_Click"
74+
DataContext="{x:Bind}"
75+
Text="Open in new window">
76+
<MenuFlyoutItem.Icon>
77+
<FontIcon Glyph="&#xE737;" />
78+
</MenuFlyoutItem.Icon>
79+
</MenuFlyoutItem>
80+
<MenuFlyoutItem
81+
x:Name="Properties"
82+
x:Uid="BaseLayoutContextFlyoutPropertiesFolder"
83+
x:Load="{x:Bind IsLibrary}"
84+
Click="OpenLibraryProperties_Click"
85+
DataContext="{x:Bind}"
86+
Text="Properties">
87+
<MenuFlyoutItem.Icon>
88+
<FontIcon Glyph="&#xE946;" />
89+
</MenuFlyoutItem.Icon>
90+
</MenuFlyoutItem>
91+
</MenuFlyout.Items>
92+
</MenuFlyout>
93+
</Button.ContextFlyout>
94+
95+
<Grid
96+
Margin="8,12"
3497
HorizontalAlignment="Stretch"
3598
VerticalAlignment="Stretch"
36-
HorizontalContentAlignment="Stretch"
37-
VerticalContentAlignment="Stretch"
38-
AutomationProperties.Name="{x:Bind AutomationProperties}"
39-
Command="{x:Bind SelectCommand}"
40-
CommandParameter="{x:Bind}"
41-
CornerRadius="{StaticResource ControlCornerRadius}"
42-
PointerPressed="Button_PointerPressed"
43-
Tag="{x:Bind Path}">
44-
<Button.ContextFlyout>
45-
<MenuFlyout Opening="MenuFlyout_Opening">
46-
<MenuFlyout.Items>
47-
<MenuFlyoutItem
48-
x:Name="OpenInNewPane"
49-
x:Uid="SideBarOpenInNewPane"
50-
x:Load="{x:Bind HasPath}"
51-
Click="OpenInNewPane_Click"
52-
DataContext="{x:Bind}"
53-
Text="Open in new pane"
54-
Visibility="Collapsed">
55-
<MenuFlyoutItem.Icon>
56-
<FontIcon FontFamily="{StaticResource CustomGlyph}" Glyph="&#xF117;" />
57-
</MenuFlyoutItem.Icon>
58-
</MenuFlyoutItem>
59-
<MenuFlyoutItem
60-
x:Name="OpenInNewTab"
61-
x:Uid="SideBarOpenInNewTab"
62-
x:Load="{x:Bind HasPath}"
63-
Click="OpenInNewTab_Click"
64-
DataContext="{x:Bind}"
65-
Text="Open in new tab">
66-
<MenuFlyoutItem.Icon>
67-
<FontIcon FontFamily="{StaticResource CustomGlyph}" Glyph="&#xF113;" />
68-
</MenuFlyoutItem.Icon>
69-
</MenuFlyoutItem>
70-
<MenuFlyoutItem
71-
x:Name="OpenInNewWindow"
72-
x:Uid="SideBarOpenInNewWindow"
73-
x:Load="{x:Bind HasPath}"
74-
Click="OpenInNewWindow_Click"
75-
DataContext="{x:Bind}"
76-
Text="Open in new window">
77-
<MenuFlyoutItem.Icon>
78-
<FontIcon Glyph="&#xE737;" />
79-
</MenuFlyoutItem.Icon>
80-
</MenuFlyoutItem>
81-
<MenuFlyoutItem
82-
x:Name="Properties"
83-
x:Uid="BaseLayoutContextFlyoutPropertiesFolder"
84-
x:Load="{x:Bind IsLibrary}"
85-
Click="OpenLibraryProperties_Click"
86-
DataContext="{x:Bind}"
87-
Text="Properties">
88-
<MenuFlyoutItem.Icon>
89-
<FontIcon Glyph="&#xE946;" />
90-
</MenuFlyoutItem.Icon>
91-
</MenuFlyoutItem>
92-
</MenuFlyout.Items>
93-
</MenuFlyout>
94-
</Button.ContextFlyout>
95-
96-
<Grid
97-
Margin="8,12"
98-
HorizontalAlignment="Stretch"
99-
VerticalAlignment="Stretch"
100-
RowSpacing="2">
101-
<Grid.RowDefinitions>
102-
<RowDefinition Height="*" />
103-
<RowDefinition Height="Auto" />
104-
</Grid.RowDefinitions>
105-
<Image
106-
Grid.Row="0"
107-
Height="40"
108-
HorizontalAlignment="Center"
109-
VerticalAlignment="Center"
110-
Source="{x:Bind Icon, Mode=OneWay}" />
111-
<TextBlock
112-
x:Name="ItemLocationName"
113-
Grid.Row="1"
114-
HorizontalAlignment="Center"
115-
VerticalAlignment="Center"
116-
FontSize="14"
117-
HorizontalTextAlignment="Center"
118-
Text="{x:Bind Text}"
119-
TextTrimming="WordEllipsis"
120-
TextWrapping="NoWrap" />
121-
</Grid>
122-
</Button>
123-
</Grid>
99+
RowSpacing="2">
100+
<Grid.RowDefinitions>
101+
<RowDefinition Height="*" />
102+
<RowDefinition Height="Auto" />
103+
</Grid.RowDefinitions>
104+
<Image
105+
Grid.Row="0"
106+
Height="40"
107+
HorizontalAlignment="Center"
108+
VerticalAlignment="Center"
109+
Source="{x:Bind Icon, Mode=OneWay}" />
110+
<TextBlock
111+
x:Name="ItemLocationName"
112+
Grid.Row="1"
113+
HorizontalAlignment="Center"
114+
VerticalAlignment="Center"
115+
FontSize="14"
116+
HorizontalTextAlignment="Center"
117+
Text="{x:Bind Text}"
118+
TextTrimming="WordEllipsis"
119+
TextWrapping="NoWrap" />
120+
</Grid>
121+
</Button>
124122
</DataTemplate>
125123
</muxc:ItemsRepeater.ItemTemplate>
126124
</muxc:ItemsRepeater>

0 commit comments

Comments
 (0)