/
githubmirror
/
Files
Обзор
Документация
Войти
/
githubmirror
/
Files
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
src/Files.App/Views/Settings/GeneralPage.xaml
399 строк
18 KB
yair100
Feature: Added setting to reverse tab scroll direction (#18593)
16 июн 2026, 17:55
Не верифицирован
16 июн 2026, 17:55
734831e
Код
Авторство
О чём код?
<!-- Copyright (c) Files Community. Licensed under the MIT License. --> <Page x:Class="Files.App.Views.Settings.GeneralPage" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:helpers="using:Files.App.Helpers" xmlns:i="using:Microsoft.Xaml.Interactivity" xmlns:items="using:Files.App.Data.Items" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:uc="using:Files.App.UserControls" xmlns:vm="using:Files.App.ViewModels.Settings" xmlns:wctcontrols="using:CommunityToolkit.WinUI.Controls" mc:Ignorable="d"> <Page.DataContext> <vm:GeneralViewModel x:Name="ViewModel" /> </Page.DataContext> <Grid> <StackPanel HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Spacing="4"> <!-- Title --> <TextBlock Padding="0,0,0,12" Style="{StaticResource App.Theme.SubtitleTextBlockStyle}" Text="{helpers:ResourceString Name=General}" /> <!-- Language settings --> <wctcontrols:SettingsCard Header="{helpers:ResourceString Name=Language}"> <wctcontrols:SettingsCard.HeaderIcon> <FontIcon Glyph="" /> </wctcontrols:SettingsCard.HeaderIcon> <uc:ComboBoxEx x:Name="AppLanguagesComboBox" HorizontalAlignment="Left" AutomationProperties.Name="{helpers:ResourceString Name=Language}" ItemsSource="{x:Bind ViewModel.AppLanguages}" SelectedIndex="{x:Bind ViewModel.SelectedAppLanguageIndex, Mode=TwoWay}"> <uc:ComboBoxEx.ItemTemplate> <DataTemplate x:DataType="items:AppLanguageItem"> <TextBlock Text="{x:Bind Name}" /> </DataTemplate> </uc:ComboBoxEx.ItemTemplate> </uc:ComboBoxEx> </wctcontrols:SettingsCard> <!-- Date settings --> <wctcontrols:SettingsCard HorizontalAlignment="Stretch" Description="{x:Bind ViewModel.DateFormatSample}" Header="{helpers:ResourceString Name=DateFormat}"> <wctcontrols:SettingsCard.HeaderIcon> <FontIcon Glyph="" /> </wctcontrols:SettingsCard.HeaderIcon> <uc:ComboBoxEx x:Name="DateFormatChooser" Grid.Column="1" AutomationProperties.Name="{helpers:ResourceString Name=DateFormat}" ItemsSource="{x:Bind ViewModel.DateFormats}" SelectedIndex="{x:Bind ViewModel.SelectedDateTimeFormatIndex, Mode=TwoWay}"> <uc:ComboBoxEx.ItemTemplate> <DataTemplate x:DataType="vm:DateTimeFormatItem"> <StackPanel Orientation="Vertical"> <TextBlock Text="{x:Bind Label}" /> <TextBlock FontSize="12" FontWeight="Light" Text="{x:Bind Sample1}" Visibility="{Binding IsDropDownOpen, ElementName=DateFormatChooser}" /> <TextBlock FontSize="12" FontWeight="Light" Text="{x:Bind Sample2}" Visibility="{Binding IsDropDownOpen, ElementName=DateFormatChooser}" /> </StackPanel> </DataTemplate> </uc:ComboBoxEx.ItemTemplate> </uc:ComboBoxEx> </wctcontrols:SettingsCard> <!-- Startup settings --> <wctcontrols:SettingsExpander Header="{helpers:ResourceString Name=StartupSettings}" IsExpanded="False"> <wctcontrols:SettingsExpander.HeaderIcon> <FontIcon Glyph="" /> </wctcontrols:SettingsExpander.HeaderIcon> <uc:ComboBoxEx AutomationProperties.Name="{helpers:ResourceString Name=StartupSettings}" SelectedIndex="{x:Bind ViewModel.SelectedStartupSettingIndex, Mode=OneWay}"> <ComboBoxItem Content="{helpers:ResourceString Name=SettingsOnStartupOpenANewTab/Content}" IsSelected="{x:Bind ViewModel.OpenNewTabPageOnStartup, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" /> <ComboBoxItem Content="{helpers:ResourceString Name=SettingsOnStartupContinueWhereYouLeftOff/Content}" IsSelected="{x:Bind ViewModel.ContinueLastSessionOnStartUp, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" /> <ComboBoxItem x:Name="OpenSpecificPage" Content="{helpers:ResourceString Name=SettingsOnStartupOpenASpecificPage/Content}" IsSelected="{x:Bind ViewModel.OpenASpecificPageOnStartup, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" /> </uc:ComboBoxEx> <wctcontrols:SettingsExpander.ItemsHeader> <Grid Padding="8" HorizontalAlignment="Stretch" Background="{ThemeResource CardBackgroundFillColorDefaultBrush}" RowSpacing="4" Visibility="{x:Bind ViewModel.OpenASpecificPageOnStartup, Mode=OneWay}"> <Grid.RowDefinitions> <RowDefinition Height="Auto" /> <RowDefinition Height="*" /> </Grid.RowDefinitions> <Button Margin="12,0,0,0"> <Button.Flyout> <MenuFlyout Placement="RightEdgeAlignedBottom"> <MenuFlyoutItem Command="{x:Bind ViewModel.AddPageCommand}" CommandParameter="Home" Text="{helpers:ResourceString Name=Home}" /> <MenuFlyoutItem Command="{x:Bind ViewModel.AddPageCommand}" Text="{helpers:ResourceString Name=Browse}" /> </MenuFlyout> </Button.Flyout> <StackPanel Orientation="Horizontal" Spacing="8"> <FontIcon VerticalAlignment="Center" FontSize="14" Glyph="" /> <TextBlock VerticalAlignment="Center" Text="{helpers:ResourceString Name=AddPage}" /> </StackPanel> </Button> <ListView x:Name="PagesList" Grid.Row="1" HorizontalAlignment="Stretch" AllowDrop="True" CanReorderItems="True" IsItemClickEnabled="False" ItemsSource="{x:Bind ViewModel.PagesOnStartupList, Mode=TwoWay}" SelectedIndex="{x:Bind ViewModel.SelectedPageIndex, Mode=TwoWay}" SelectionMode="None"> <ListView.Resources> <SolidColorBrush x:Key="ButtonBackground" Color="Transparent" /> <SolidColorBrush x:Key="ButtonBorderBrush" Color="Transparent" /> </ListView.Resources> <ListView.ItemContainerStyle> <Style BasedOn="{StaticResource DefaultListViewItemStyle}" TargetType="ListViewItem"> <Setter Property="Margin" Value="0" /> <Setter Property="Padding" Value="12,0" /> </Style> </ListView.ItemContainerStyle> <ListView.ItemTemplate> <DataTemplate xmlns:vm="using:Files.App.ViewModels.Settings" x:DataType="vm:PageOnStartupViewModel"> <Grid HorizontalAlignment="Stretch"> <TextBlock HorizontalAlignment="Left" VerticalAlignment="Center" Text="{x:Bind Text}" TextTrimming="CharacterEllipsis" ToolTipService.ToolTip="{x:Bind Text}" /> <Button HorizontalAlignment="Right" AutomationProperties.Name="{helpers:ResourceString Name=Remove}" Click="RemoveStartupPage" ToolTipService.ToolTip="{helpers:ResourceString Name=Remove}"> <FontIcon FontSize="16" Glyph="" /> </Button> </Grid> </DataTemplate> </ListView.ItemTemplate> </ListView> </Grid> </wctcontrols:SettingsExpander.ItemsHeader> <wctcontrols:SettingsExpander.Items> <wctcontrols:SettingsCard Header="{helpers:ResourceString Name=OpenTabInExistingInstance}"> <ToggleSwitch AutomationProperties.Name="{helpers:ResourceString Name=OpenTabInExistingInstance}" IsOn="{x:Bind ViewModel.OpenTabInExistingInstance, Mode=TwoWay}" /> </wctcontrols:SettingsCard> </wctcontrols:SettingsExpander.Items> </wctcontrols:SettingsExpander> <!-- Switch to new tab --> <wctcontrols:SettingsCard Header="{helpers:ResourceString Name=AlwaysSwitchToNewlyOpenedTab}"> <wctcontrols:SettingsCard.HeaderIcon> <FontIcon Glyph="" /> </wctcontrols:SettingsCard.HeaderIcon> <ToggleSwitch x:Name="AlwaysSwitchToNewlyOpenedTab" AutomationProperties.Name="{helpers:ResourceString Name=AlwaysSwitchToNewlyOpenedTab}" IsOn="{x:Bind ViewModel.AlwaysSwitchToNewlyOpenedTab, Mode=TwoWay}" /> </wctcontrols:SettingsCard> <!-- Widgets --> <wctcontrols:SettingsExpander Header="{helpers:ResourceString Name=Widgets}"> <wctcontrols:SettingsExpander.HeaderIcon> <FontIcon Glyph="" /> </wctcontrols:SettingsExpander.HeaderIcon> <wctcontrols:SettingsExpander.Items> <wctcontrols:SettingsCard Header="{helpers:ResourceString Name=QuickAccess}"> <ToggleSwitch AutomationProperties.Name="{helpers:ResourceString Name=QuickAccess}" IsOn="{x:Bind ViewModel.ShowQuickAccessWidget, Mode=TwoWay}" /> </wctcontrols:SettingsCard> <wctcontrols:SettingsCard Header="{helpers:ResourceString Name=Drives}"> <ToggleSwitch AutomationProperties.Name="{helpers:ResourceString Name=Drives}" IsOn="{x:Bind ViewModel.ShowDrivesWidget, Mode=TwoWay}" /> </wctcontrols:SettingsCard> <wctcontrols:SettingsCard Header="{helpers:ResourceString Name=NetworkLocations}"> <ToggleSwitch AutomationProperties.Name="{helpers:ResourceString Name=NetworkLocations}" IsOn="{x:Bind ViewModel.ShowNetworkLocationsWidget, Mode=TwoWay}" /> </wctcontrols:SettingsCard> <wctcontrols:SettingsCard Header="{helpers:ResourceString Name=FileTags}"> <ToggleSwitch AutomationProperties.Name="{helpers:ResourceString Name=FileTags}" IsOn="{x:Bind ViewModel.ShowFileTagsWidget, Mode=TwoWay}" /> </wctcontrols:SettingsCard> <wctcontrols:SettingsCard Header="{helpers:ResourceString Name=RecentFiles}"> <ToggleSwitch AutomationProperties.Name="{helpers:ResourceString Name=RecentFiles}" IsOn="{x:Bind ViewModel.ShowRecentFilesWidget, Mode=TwoWay}" /> </wctcontrols:SettingsCard> </wctcontrols:SettingsExpander.Items> </wctcontrols:SettingsExpander> <!-- Dual Pane --> <TextBlock Padding="0,16,0,4" FontSize="16" FontWeight="Medium" Text="{helpers:ResourceString Name=DualPane}" /> <!-- Open tabs in Dual Pane mode --> <wctcontrols:SettingsCard Header="{helpers:ResourceString Name=SettingsMultitaskingAlwaysOpenDualPane}"> <wctcontrols:SettingsCard.HeaderIcon> <FontIcon Glyph="" /> </wctcontrols:SettingsCard.HeaderIcon> <ToggleSwitch AutomationProperties.Name="{helpers:ResourceString Name=SettingsMultitaskingAlwaysOpenDualPane}" IsOn="{x:Bind ViewModel.AlwaysOpenDualPaneInNewTab, Mode=TwoWay}" /> </wctcontrols:SettingsCard> <!-- Dual Pane split direction --> <wctcontrols:SettingsCard Header="{helpers:ResourceString Name=DualPaneSplitDirection}"> <wctcontrols:SettingsCard.HeaderIcon> <FontIcon Glyph="" /> </wctcontrols:SettingsCard.HeaderIcon> <uc:ComboBoxEx AutomationProperties.Name="{helpers:ResourceString Name=DualPaneSplitDirection}" ItemsSource="{x:Bind ViewModel.ShellPaneArrangementTypes.Values}" SelectedItem="{x:Bind ViewModel.SelectedShellPaneArrangementType, Mode=TwoWay}" /> </wctcontrols:SettingsCard> <!-- Right Click Menu --> <TextBlock Padding="0,16,0,4" FontSize="16" FontWeight="Medium" Text="{helpers:ResourceString Name=SettingsContextMenu/Text}" /> <!-- Context menu options --> <wctcontrols:SettingsExpander Header="{helpers:ResourceString Name=ContextMenuOptions}"> <wctcontrols:SettingsExpander.HeaderIcon> <FontIcon Glyph="" /> </wctcontrols:SettingsExpander.HeaderIcon> <wctcontrols:SettingsExpander.Items> <!-- Open in new tab --> <wctcontrols:SettingsCard Header="{helpers:ResourceString Name=ShowOpenInNewTab}"> <ToggleSwitch AutomationProperties.Name="{helpers:ResourceString Name=ShowOpenInNewTab}" IsOn="{x:Bind ViewModel.ShowOpenInNewTab, Mode=TwoWay}" /> </wctcontrols:SettingsCard> <!-- Open in new window --> <wctcontrols:SettingsCard Header="{helpers:ResourceString Name=ShowOpenInNewWindow}"> <ToggleSwitch AutomationProperties.Name="{helpers:ResourceString Name=ShowOpenInNewWindow}" IsOn="{x:Bind ViewModel.ShowOpenInNewWindow, Mode=TwoWay}" /> </wctcontrols:SettingsCard> <!-- Open in new pane --> <wctcontrols:SettingsCard Header="{helpers:ResourceString Name=ShowOpenInNewPane}"> <ToggleSwitch AutomationProperties.Name="{helpers:ResourceString Name=ShowOpenInNewPane}" IsOn="{x:Bind ViewModel.ShowOpenInNewPane, Mode=TwoWay}" /> </wctcontrols:SettingsCard> <!-- Copy path --> <wctcontrols:SettingsCard Header="{helpers:ResourceString Name=ShowCopyPath}"> <ToggleSwitch AutomationProperties.Name="{helpers:ResourceString Name=ShowCopyPath}" IsOn="{x:Bind ViewModel.ShowCopyPath, Mode=TwoWay}" /> </wctcontrols:SettingsCard> <!-- Create folder with selection --> <wctcontrols:SettingsCard Header="{helpers:ResourceString Name=ShowCreateFolderWithSelection}"> <ToggleSwitch AutomationProperties.Name="{helpers:ResourceString Name=ShowCreateFolderWithSelection}" IsOn="{x:Bind ViewModel.ShowCreateFolderWithSelection, Mode=TwoWay}" /> </wctcontrols:SettingsCard> <!-- Create alternate data stream --> <wctcontrols:SettingsCard Header="{helpers:ResourceString Name=ShowCreateAlternateDataStream}"> <ToggleSwitch AutomationProperties.Name="{helpers:ResourceString Name=ShowCreateAlternateDataStream}" IsOn="{x:Bind ViewModel.ShowCreateAlternateDataStream, Mode=TwoWay}" /> </wctcontrols:SettingsCard> <!-- Create shortcut --> <wctcontrols:SettingsCard Header="{helpers:ResourceString Name=ShowCreateShortcut}"> <ToggleSwitch AutomationProperties.Name="{helpers:ResourceString Name=ShowCreateShortcut}" IsOn="{x:Bind ViewModel.ShowCreateShortcut, Mode=TwoWay}" /> </wctcontrols:SettingsCard> <!-- Pin to Sidebar --> <wctcontrols:SettingsCard Header="{helpers:ResourceString Name=ShowPinToSideBar}"> <ToggleSwitch AutomationProperties.Name="{helpers:ResourceString Name=ShowPinToSideBar}" IsOn="{x:Bind ViewModel.ShowPinToSideBar, Mode=TwoWay}" /> </wctcontrols:SettingsCard> <!-- Compression options --> <wctcontrols:SettingsCard Header="{helpers:ResourceString Name=ShowCompressionOptions}"> <ToggleSwitch AutomationProperties.Name="{helpers:ResourceString Name=ShowCompressionOptions}" IsOn="{x:Bind ViewModel.ShowCompressionOptions, Mode=TwoWay}" /> </wctcontrols:SettingsCard> <!-- Flatten options --> <!-- TODO uncomment code when feature is marked as stable --> <!--<wctcontrols:SettingsCard Header="{helpers:ResourceString Name=ShowFlattenOptions}"> <ToggleSwitch AutomationProperties.Name="{helpers:ResourceString Name=ShowFlattenOptions}" IsOn="{x:Bind ViewModel.ShowFlattenOptions, Mode=TwoWay}" /> </wctcontrols:SettingsCard>--> <!-- Send To --> <wctcontrols:SettingsCard Header="{helpers:ResourceString Name=ShowSendToMenu}"> <ToggleSwitch AutomationProperties.Name="{helpers:ResourceString Name=ShowSendToMenu}" IsOn="{x:Bind ViewModel.ShowSendToMenu, Mode=TwoWay}" /> </wctcontrols:SettingsCard> <!-- Open in Windows Terminal --> <wctcontrols:SettingsCard Header="{helpers:ResourceString Name=ShowOpenTerminal}"> <ToggleSwitch AutomationProperties.Name="{helpers:ResourceString Name=ShowOpenTerminal}" IsOn="{x:Bind ViewModel.ShowOpenTerminal, Mode=TwoWay}" /> </wctcontrols:SettingsCard> <!-- Edit tags --> <wctcontrols:SettingsCard Header="{helpers:ResourceString Name=ShowEditTagsMenu}"> <ToggleSwitch AutomationProperties.Name="{helpers:ResourceString Name=ShowEditTagsMenu}" IsOn="{x:Bind ViewModel.ShowEditTagsMenu, Mode=TwoWay}" /> </wctcontrols:SettingsCard> <!-- Pin to Start --> <wctcontrols:SettingsCard Header="{helpers:ResourceString Name=ShowPinToStart}"> <ToggleSwitch AutomationProperties.Name="{helpers:ResourceString Name=ShowPinToStart}" IsOn="{x:Bind ViewModel.ShowPinToStart, Mode=TwoWay}" /> </wctcontrols:SettingsCard> </wctcontrols:SettingsExpander.Items> </wctcontrols:SettingsExpander> <!-- Overflow Options --> <wctcontrols:SettingsCard Header="{helpers:ResourceString Name=SettingsContextMenuOverflow}"> <wctcontrols:SettingsCard.HeaderIcon> <FontIcon Glyph="" /> </wctcontrols:SettingsCard.HeaderIcon> <ToggleSwitch AutomationProperties.Name="{helpers:ResourceString Name=SettingsContextMenuOverflow}" IsOn="{x:Bind ViewModel.MoveShellExtensionsToSubMenu, Mode=TwoWay}" /> </wctcontrols:SettingsCard> <!-- Scrolling --> <TextBlock Padding="0,16,0,4" FontSize="16" FontWeight="Medium" Text="{helpers:ResourceString Name=Scrolling}" /> <!-- Enable Smooth Scrolling --> <wctcontrols:SettingsCard Header="{helpers:ResourceString Name=EnableSmoothScrolling}"> <wctcontrols:SettingsCard.HeaderIcon> <FontIcon Glyph="" /> </wctcontrols:SettingsCard.HeaderIcon> <ToggleSwitch AutomationProperties.Name="{helpers:ResourceString Name=EnableSmoothScrolling}" IsOn="{x:Bind ViewModel.EnableSmoothScrolling, Mode=TwoWay}" /> </wctcontrols:SettingsCard> <!-- Reverse tab scroll direction --> <wctcontrols:SettingsCard Header="{helpers:ResourceString Name=ReverseTabScrollDirection}"> <wctcontrols:SettingsCard.HeaderIcon> <FontIcon Glyph="" /> </wctcontrols:SettingsCard.HeaderIcon> <uc:ComboBoxEx HorizontalAlignment="Left" AutomationProperties.Name="{helpers:ResourceString Name=ReverseTabScrollDirection}" SelectedIndex="{x:Bind ViewModel.SelectedTabScrollDirectionIndex, Mode=TwoWay}"> <ComboBoxItem Content="{helpers:ResourceString Name=DownMotionScrollsLeft}" /> <ComboBoxItem Content="{helpers:ResourceString Name=DownMotionScrollsRight}" /> </uc:ComboBoxEx> </wctcontrols:SettingsCard> </StackPanel> <!-- Restart Teaching Tip --> <TeachingTip IsLightDismissEnabled="True" IsOpen="{x:Bind ViewModel.ShowRestartControl, Mode=TwoWay}" Subtitle="{helpers:ResourceString Name=RestartNotificationText/Text}" Target="{x:Bind AppLanguagesComboBox}"> <StackPanel x:Name="ButtonsStackPanel" Padding="0,8,0,0" HorizontalAlignment="Right" Orientation="Horizontal" Spacing="8"> <Button x:Name="YesButton" MinWidth="140" Command="{x:Bind ViewModel.RestartCommand, Mode=OneWay}" Content="{helpers:ResourceString Name=Yes}" Style="{ThemeResource AccentButtonStyle}" /> <Button x:Name="NoButton" MinWidth="140" Command="{x:Bind ViewModel.CancelRestartCommand, Mode=OneWay}" Content="{helpers:ResourceString Name=No}" /> </StackPanel> </TeachingTip> </Grid> </Page>