/
githubmirror
/
Files
Обзор
Документация
Войти
/
githubmirror
/
Files
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
src/Files.App/Views/Settings/FoldersPage.xaml
215 строк
11 KB
yair100
Feature: Separate mouse and touch settings for single click (#18433)
27 апр 2026, 18:39
Не верифицирован
27 апр 2026, 18:39
b90e7da
Код
Авторство
О чём код?
<!-- Copyright (c) Files Community. Licensed under the MIT License. --> <Page x:Class="Files.App.Views.Settings.FoldersPage" 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: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:FoldersViewModel 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=FilesAndFolders}" /> <!-- Display --> <TextBlock Padding="0,16,0,4" FontSize="16" FontWeight="Medium" Text="{helpers:ResourceString Name=Display}" /> <!-- Hidden Items --> <wctcontrols:SettingsExpander Header="{helpers:ResourceString Name=HiddenItems}"> <wctcontrols:SettingsExpander.HeaderIcon> <PathIcon Data="{StaticResource App.Theme.PathIcon.Hide}" /> </wctcontrols:SettingsExpander.HeaderIcon> <wctcontrols:SettingsExpander.Items> <!-- Hidden Files --> <wctcontrols:SettingsCard Header="{helpers:ResourceString Name=SettingsFilesAndFoldersShowHiddenItems}"> <ToggleSwitch AutomationProperties.Name="{helpers:ResourceString Name=SettingsFilesAndFoldersShowHiddenItems}" IsOn="{x:Bind ViewModel.ShowHiddenItems, Mode=TwoWay}" /> </wctcontrols:SettingsCard> <!-- Dots Files --> <wctcontrols:SettingsCard Header="{helpers:ResourceString Name=ShowDotFiles}"> <ToggleSwitch AutomationProperties.Name="{helpers:ResourceString Name=ShowDotFiles}" IsOn="{x:Bind ViewModel.ShowDotFiles, Mode=TwoWay}" /> </wctcontrols:SettingsCard> <!-- System Files --> <wctcontrols:SettingsCard Header="{helpers:ResourceString Name=ShowProtectedSystemFiles}"> <ToggleSwitch AutomationProperties.Name="{helpers:ResourceString Name=ShowProtectedSystemFiles}" IsOn="{x:Bind ViewModel.ShowProtectedSystemFiles, Mode=TwoWay}" /> </wctcontrols:SettingsCard> <!-- Alternate Data Streams --> <wctcontrols:SettingsCard Header="{helpers:ResourceString Name=ShowAlternateStreams}"> <ToggleSwitch AutomationProperties.Name="{helpers:ResourceString Name=ShowAlternateStreams}" IsOn="{x:Bind ViewModel.AreAlternateStreamsVisible, Mode=TwoWay}" /> </wctcontrols:SettingsCard> </wctcontrols:SettingsExpander.Items> </wctcontrols:SettingsExpander> <!-- File Extensions --> <wctcontrols:SettingsCard Header="{helpers:ResourceString Name=SettingsFilesAndFoldersShowFileExtensions}"> <wctcontrols:SettingsCard.HeaderIcon> <FontIcon Glyph="" /> </wctcontrols:SettingsCard.HeaderIcon> <ToggleSwitch AutomationProperties.Name="{helpers:ResourceString Name=SettingsFilesAndFoldersShowFileExtensions}" IsOn="{x:Bind ViewModel.ShowFileExtensions, Mode=TwoWay}" /> </wctcontrols:SettingsCard> <!-- Show Thumbnails --> <wctcontrols:SettingsCard Header="{helpers:ResourceString Name=SettingsFilesAndFoldersShowThumbnails}"> <wctcontrols:SettingsCard.HeaderIcon> <FontIcon Glyph="" /> </wctcontrols:SettingsCard.HeaderIcon> <ToggleSwitch AutomationProperties.Name="{helpers:ResourceString Name=SettingsFilesAndFoldersShowThumbnails}" IsOn="{x:Bind ViewModel.ShowThumbnails, Mode=TwoWay}" /> </wctcontrols:SettingsCard> <!-- Show Checkboxes When Selecting Items --> <wctcontrols:SettingsCard Header="{helpers:ResourceString Name=ShowCheckboxesWhenSelectingItems}"> <wctcontrols:SettingsCard.HeaderIcon> <FontIcon Glyph="" /> </wctcontrols:SettingsCard.HeaderIcon> <ToggleSwitch AutomationProperties.Name="{helpers:ResourceString Name=ShowCheckboxesWhenSelectingItems}" IsOn="{x:Bind ViewModel.ShowCheckboxesWhenSelectingItems, Mode=TwoWay}" /> </wctcontrols:SettingsCard> <!-- Behaviors --> <TextBlock Padding="0,16,0,4" FontSize="16" FontWeight="Medium" Text="{helpers:ResourceString Name=Behaviors}" /> <!-- Single-click to open --> <wctcontrols:SettingsExpander Header="{helpers:ResourceString Name=SingleClickToOpen}"> <wctcontrols:SettingsExpander.HeaderIcon> <FontIcon Glyph="" /> </wctcontrols:SettingsExpander.HeaderIcon> <wctcontrols:SettingsExpander.Items> <wctcontrols:SettingsCard Header="{helpers:ResourceString Name=Files}"> <uc:ComboBoxEx AutomationProperties.Name="{helpers:ResourceString Name=OpenFilesWithOneClick}" ItemsSource="{x:Bind ViewModel.SingleClickOpenModeOptions.Values}" SelectedItem="{x:Bind ViewModel.SelectedOpenFilesWithSingleClickOption, Mode=TwoWay}" /> </wctcontrols:SettingsCard> <wctcontrols:SettingsCard Header="{helpers:ResourceString Name=Folders}"> <uc:ComboBoxEx AutomationProperties.Name="{helpers:ResourceString Name=OpenFolderWithOneClick}" ItemsSource="{x:Bind ViewModel.SingleClickOpenModeOptions.Values}" SelectedItem="{x:Bind ViewModel.SelectedOpenFoldersWithSingleClickOption, Mode=TwoWay}" /> </wctcontrols:SettingsCard> <wctcontrols:SettingsCard Header="{helpers:ResourceString Name=SingleClickFoldersInColumnsViewHeader}"> <uc:ComboBoxEx AutomationProperties.Name="{helpers:ResourceString Name=OpenFolderWithOneClickInColumnsView}" ItemsSource="{x:Bind ViewModel.SingleClickOpenModeOptions.Values}" SelectedItem="{x:Bind ViewModel.SelectedOpenFoldersInColumnsViewWithSingleClickOption, Mode=TwoWay}" /> </wctcontrols:SettingsCard> </wctcontrols:SettingsExpander.Items> </wctcontrols:SettingsExpander> <!-- Open Folders in New Tab --> <wctcontrols:SettingsCard Header="{helpers:ResourceString Name=OpenFoldersInNewTab}"> <wctcontrols:SettingsCard.HeaderIcon> <PathIcon Data="m2.5,13c-.83,0-1.5-.67-1.5-1.5V2.5c0-.83.67-1.5,1.5-1.5h2.5v1.5c0,.83.67,1.5,1.5,1.5h6.5v2.21c.35.1.68.23,1,.39V2.5C14,1.12,12.88,0,11.5,0H2.5C1.12,0,0,1.12,0,2.5v9c0,1.38,1.12,2.5,2.5,2.5h4.1c-.16-.32-.29-.65-.39-1h-3.71ZM6,1h5.5c.83,0,1.5.67,1.5,1.5v.5h-6.5c-.28,0-.5-.22-.5-.5v-1.5Zm8.68,7.32c-.84-.84-1.99-1.32-3.18-1.32s-2.34.47-3.18,1.32c-.84.84-1.32,1.99-1.32,3.18s.47,2.34,1.32,3.18c.84.84,1.99,1.32,3.18,1.32s2.34-.47,3.18-1.32c.84-.84,1.32-1.99,1.32-3.18s-.47-2.34-1.32-3.18Zm-.68,4.18c0,.13-.05.26-.15.35-.09.09-.22.15-.35.15s-.26-.05-.35-.15c-.09-.09-.15-.22-.15-.35v-1.74l-2.62,2.62c-.1.1-.24.16-.38.16s-.28-.06-.38-.16c-.1-.1-.16-.24-.16-.38s.06-.28.16-.38l2.62-2.62h-1.74c-.13,0-.26-.05-.35-.15-.09-.09-.15-.22-.15-.35s.05-.26.15-.35c.09-.09.22-.15.35-.15h3c.13,0,.26.05.35.15.09.09.15.22.15.35v3Z" /> </wctcontrols:SettingsCard.HeaderIcon> <ToggleSwitch x:Name="OpenFoldersNewTab" AutomationProperties.Name="{helpers:ResourceString Name=OpenFoldersInNewTab}" IsOn="{x:Bind ViewModel.OpenFoldersNewTab, Mode=TwoWay}" /> </wctcontrols:SettingsCard> <!-- Confirm Delete --> <wctcontrols:SettingsCard Header="{helpers:ResourceString Name=ShowConfirmationWhenDeletingItems}"> <wctcontrols:SettingsCard.HeaderIcon> <FontIcon Glyph="" /> </wctcontrols:SettingsCard.HeaderIcon> <uc:ComboBoxEx AutomationProperties.Name="{helpers:ResourceString Name=ShowConfirmationWhenDeletingItems}" SelectedIndex="{x:Bind ViewModel.SelectedDeleteConfirmationPolicyIndex, Mode=TwoWay}"> <ComboBoxItem Content="{helpers:ResourceString Name=Always}" /> <ComboBoxItem Content="{helpers:ResourceString Name=PermanentDeletionOnly}" /> <ComboBoxItem Content="{helpers:ResourceString Name=Never}" /> </uc:ComboBoxEx> </wctcontrols:SettingsCard> <!-- File Extension Warning --> <wctcontrols:SettingsCard Header="{helpers:ResourceString Name=ShowFileExtensionWarning}"> <wctcontrols:SettingsCard.HeaderIcon> <FontIcon Glyph="" /> </wctcontrols:SettingsCard.HeaderIcon> <ToggleSwitch AutomationProperties.Name="{helpers:ResourceString Name=ShowFileExtensionWarning}" IsOn="{x:Bind ViewModel.ShowFileExtensionWarning, Mode=TwoWay}" /> </wctcontrols:SettingsCard> <!-- Select On Hover --> <wctcontrols:SettingsCard Header="{helpers:ResourceString Name=SelectFilesAndFoldersOnHover}"> <wctcontrols:SettingsCard.HeaderIcon> <FontIcon Glyph="" /> </wctcontrols:SettingsCard.HeaderIcon> <ToggleSwitch AutomationProperties.Name="{helpers:ResourceString Name=SelectFilesAndFoldersOnHover}" IsOn="{x:Bind ViewModel.SelectFilesOnHover, Mode=TwoWay}" /> </wctcontrols:SettingsCard> <!-- Double click to go up --> <wctcontrols:SettingsCard Header="{helpers:ResourceString Name=DoubleClickBlankSpaceToGoUp}"> <wctcontrols:SettingsCard.HeaderIcon> <FontIcon Glyph="" /> </wctcontrols:SettingsCard.HeaderIcon> <ToggleSwitch AutomationProperties.Name="{helpers:ResourceString Name=DoubleClickBlankSpaceToGoUp}" IsOn="{x:Bind ViewModel.DoubleClickToGoUp, Mode=TwoWay}" /> </wctcontrols:SettingsCard> <!-- Scroll to parent folder when navigating up --> <wctcontrols:SettingsCard Header="{helpers:ResourceString Name=ScrollToPreviousFolderWhenNavigatingUp}"> <wctcontrols:SettingsCard.HeaderIcon> <FontIcon Glyph="" /> </wctcontrols:SettingsCard.HeaderIcon> <ToggleSwitch AutomationProperties.Name="{helpers:ResourceString Name=ScrollToPreviousFolderWhenNavigatingUp}" IsOn="{x:Bind ViewModel.ScrollToPreviousFolderWhenNavigatingUp, Mode=TwoWay}" /> </wctcontrols:SettingsCard> <!-- Size format --> <wctcontrols:SettingsCard Header="{helpers:ResourceString Name=SizeFormat}"> <wctcontrols:SettingsCard.HeaderIcon> <FontIcon Glyph="" /> </wctcontrols:SettingsCard.HeaderIcon> <uc:ComboBoxEx AutomationProperties.Name="{helpers:ResourceString Name=SizeFormat}" ItemsSource="{x:Bind ViewModel.SizeUnitsOptions.Values}" SelectedItem="{x:Bind ViewModel.SizeUnitFormat, Mode=TwoWay}" /> </wctcontrols:SettingsCard> <!-- Calculate folder sizes --> <wctcontrols:SettingsExpander Header="{helpers:ResourceString Name=CalculateFolderSizes}" IsExpanded="True"> <wctcontrols:SettingsExpander.HeaderIcon> <FontIcon Glyph="" /> </wctcontrols:SettingsExpander.HeaderIcon> <ToggleSwitch AutomationProperties.Name="{helpers:ResourceString Name=CalculateFolderSizes}" IsOn="{x:Bind ViewModel.CalculateFolderSizes, Mode=TwoWay}" /> <wctcontrols:SettingsExpander.ItemsHeader> <InfoBar CornerRadius="0" IsClosable="False" IsIconVisible="True" IsOpen="True" Message="{helpers:ResourceString Name=ShowFolderSizesWarning}" Severity="Warning" /> </wctcontrols:SettingsExpander.ItemsHeader> </wctcontrols:SettingsExpander> </StackPanel> </Grid> </Page>