Skip to content

Commit 9100f58

Browse files
committed
Change Back/Forward Accelerator Key Behavior
1 parent e4f24bc commit 9100f58

File tree

4 files changed

+47
-15
lines changed

4 files changed

+47
-15
lines changed

Files UWP/ProHome.xaml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -617,16 +617,14 @@
617617
</Grid.ColumnDefinitions>
618618
<StackPanel Grid.Column="0" Orientation="Horizontal">
619619
<AppBarButton Icon="Back" LabelPosition="Collapsed" x:Name="Back">
620-
621620
<AppBarButton.KeyboardAccelerators>
622-
<KeyboardAccelerator Modifiers="Control" Key="Left"/>
621+
<KeyboardAccelerator Modifiers="Menu" Key="Left"/>
623622
</AppBarButton.KeyboardAccelerators>
624623
</AppBarButton>
625624

626625
<AppBarButton Icon="Forward" LabelPosition="Collapsed" x:Name="Forward">
627-
628626
<AppBarButton.KeyboardAccelerators>
629-
<KeyboardAccelerator Modifiers="Control" Key="Right"/>
627+
<KeyboardAccelerator Modifiers="Menu" Key="Right"/>
630628
</AppBarButton.KeyboardAccelerators>
631629
</AppBarButton>
632630

@@ -646,7 +644,11 @@
646644
</TextBox>
647645

648646
<StackPanel Margin="0,0,5,0" Grid.Column="2" Orientation="Horizontal">
649-
<TextBox Style="{StaticResource TextBoxStyleForPathBar}" Padding="5" Windows10version1809:CornerRadius="5,0,0,5" BorderThickness="1" Margin="0,5,0,5" VerticalAlignment="Stretch" PlaceholderText="Search" Width="260"/>
647+
<TextBox Style="{StaticResource TextBoxStyleForPathBar}" Padding="5" Windows10version1809:CornerRadius="5,0,0,5" BorderThickness="1" Margin="0,5,0,5" VerticalAlignment="Stretch" PlaceholderText="Search" Width="260">
648+
<TextBox.KeyboardAccelerators>
649+
<KeyboardAccelerator Modifiers="Control" Key="F"/>
650+
</TextBox.KeyboardAccelerators>
651+
</TextBox>
650652
<Button BorderBrush="{StaticResource SystemAccentColor}" Width="35" BorderThickness="1" Margin="0,5,0,5.5" VerticalAlignment="Stretch" Windows10version1809:CornerRadius="0,5,5,0" Background="{StaticResource SystemAccentColor}">
651653
<FontIcon FontSize="12" Foreground="White" Glyph="&#xEBE7;"/>
652654
</Button>

Files UWP/ProHome.xaml.cs

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,15 @@
88
using System.Diagnostics;
99
using System.IO;
1010
using System.Linq;
11+
using Windows.Foundation.Metadata;
1112
using Windows.Storage;
1213
using Windows.System;
1314
using Windows.UI.Core;
1415
using Windows.UI.Popups;
16+
using Windows.UI.WindowManagement;
1517
using Windows.UI.Xaml;
1618
using Windows.UI.Xaml.Controls;
19+
using Windows.UI.Xaml.Hosting;
1720
using Windows.UI.Xaml.Input;
1821
using Windows.UI.Xaml.Media;
1922
using Windows.UI.Xaml.Media.Animation;
@@ -105,6 +108,8 @@ public ProHome()
105108

106109
}
107110

111+
112+
108113
List<string> LinesToRemoveFromFile = new List<string>();
109114

110115
public async void PopulatePinnedSidebarItems()
@@ -891,22 +896,42 @@ private void NameDialog_SecondaryButtonClick(ContentDialog sender, ContentDialog
891896
{
892897
inputForRename = null;
893898
}
894-
899+
//AppWindow propertiesWindow;
895900
public async void ShowPropertiesButton_Click(object sender, RoutedEventArgs e)
896901
{
897902
var instance = (this.accessibleContentFrame.Content as GenericFileBrowser).instanceViewModel;
898903
if (this.accessibleContentFrame.SourcePageType == typeof(GenericFileBrowser))
899904
{
900-
propertiesFrame.Navigate(typeof(Properties), ((ItemViewModel<ProHome>.GetCurrentSelectedTabInstance<ProHome>().accessibleContentFrame.Content as GenericFileBrowser).data.SelectedItem as ListedItem).FilePath, new SuppressNavigationTransitionInfo());
905+
906+
//if (ApiInformation.IsTypePresent("Windows.UI.WindowManagement.AppWindow"))
907+
//{
908+
// propertiesWindow = await AppWindow.TryCreateAsync();
909+
// Frame propertiesWindowContent = new Frame();
910+
// propertiesWindowContent.Navigate(typeof(Properties), ((ItemViewModel<ProHome>.GetCurrentSelectedTabInstance<ProHome>().accessibleContentFrame.Content as GenericFileBrowser).data.SelectedItem as ListedItem).FilePath, new SuppressNavigationTransitionInfo());
911+
// ElementCompositionPreview.SetAppWindowContent(propertiesWindow, propertiesWindowContent);
912+
// propertiesWindow.Title = "Properties";
913+
// await propertiesWindow.TryShowAsync();
914+
915+
//}
916+
//else
917+
//{
918+
919+
//}
920+
921+
901922
}
902923
else if (this.accessibleContentFrame.SourcePageType == typeof(PhotoAlbum))
903924
{
904925
propertiesFrame.Navigate(typeof(Properties), ((ItemViewModel<ProHome>.GetCurrentSelectedTabInstance<ProHome>().accessibleContentFrame.Content as PhotoAlbum).gv.SelectedItem as ListedItem).FilePath, new SuppressNavigationTransitionInfo());
905926
}
906-
await PropertiesDialog.ShowAsync();
907927

908928
}
909929

930+
public void PropertiesWindow_CancelButton_Click(object sender, RoutedEventArgs e)
931+
{
932+
//propertiesWindow.RequestSize(new Windows.Foundation.Size(200, 450));
933+
}
934+
910935
private void RibbonTip_Loaded(object sender, RoutedEventArgs e)
911936
{
912937
if (ApplicationData.Current.LocalSettings.Values["HasBeenWelcomed"] == null)

Files UWP/Properties.xaml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,10 @@
66
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
77
xmlns:Custom="using:Microsoft.Toolkit.Uwp.UI.Controls"
88
xmlns:converters="using:Microsoft.Toolkit.Uwp.UI.Converters"
9+
xmlns:Windows10version1809="http://schemas.microsoft.com/winfx/2006/xaml/presentation?IsApiContractPresent(Windows.Foundation.UniversalApiContract, 7)"
910
x:Class="Files.Properties"
1011
mc:Ignorable="d"
11-
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}" Width="400" Height="450">
12+
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
1213
<Page.Resources>
1314
<SolidColorBrush x:Key="TabViewItemHeaderBackgroundSelected" Color="{StaticResource SystemChromeLowColor}"/>
1415
<SolidColorBrush x:Key="TabViewItemHeaderBackgroundPointerOver" Color="{StaticResource SystemChromeLowColor}"/>
@@ -338,6 +339,12 @@
338339
</Custom:TabViewItem.Icon>
339340
</Custom:TabViewItem>
340341
</Custom:TabView>
342+
343+
<StackPanel HorizontalAlignment="Center" Spacing="5" Padding="10" Orientation="Horizontal" VerticalAlignment="Bottom">
344+
<Button Foreground="White" Background="#0078d4" Windows10version1809:CornerRadius="2" Width="120" Content="OK" HorizontalAlignment="Stretch" />
345+
<Button Windows10version1809:CornerRadius="2" Width="120" Content="Apply" HorizontalAlignment="Stretch" />
346+
<Button x:Name="CancelButton" Windows10version1809:CornerRadius="2" Width="120" Content="Cancel" HorizontalAlignment="Stretch" />
341347

348+
</StackPanel>
342349
</Grid>
343350
</Page>

Files UWP/Properties.xaml.cs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
using System;
1+
using Files.Filesystem;
2+
using Files.Interacts;
3+
using System;
24
using System.Collections.Generic;
35
using System.IO;
46
using System.Linq;
@@ -25,18 +27,14 @@ public sealed partial class Properties : Page
2527
public Properties()
2628
{
2729
this.InitializeComponent();
30+
CancelButton.Click += ItemViewModel<GenericFileBrowser>.GetCurrentSelectedTabInstance<ProHome>().PropertiesWindow_CancelButton_Click;
2831
}
2932

3033
private void OK_Button_Click(object sender, RoutedEventArgs e)
3134
{
3235

3336
}
3437

35-
private void Cancel_Button_Click(object sender, RoutedEventArgs e)
36-
{
37-
38-
}
39-
4038
private void Apply_Button_Click(object sender, RoutedEventArgs e)
4139
{
4240

0 commit comments

Comments
 (0)