Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/Files.App.Controls/BladeView/BladeView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,8 @@
FontSize="14"
Foreground="{TemplateBinding CloseButtonForeground}"
Style="{StaticResource ButtonRevealStyle}"
Visibility="{TemplateBinding CloseButtonVisibility}"
TabIndex="0" />
TabIndex="0"
Visibility="{TemplateBinding CloseButtonVisibility}" />
</Grid>
</ControlTemplate>
</Setter.Value>
Expand Down
14 changes: 7 additions & 7 deletions src/Files.App/Data/Contexts/ContentPage/ContentPageContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -160,15 +160,15 @@ private void ToolbarViewModel_PropertyChanged(object? sender, PropertyChangedEve
{
switch (e.PropertyName)
{
case nameof(AddressToolbarViewModel.CanGoBack):
case nameof(AddressToolbarViewModel.CanGoForward):
case nameof(AddressToolbarViewModel.CanNavigateToParent):
case nameof(AddressToolbarViewModel.HasItem):
case nameof(AddressToolbarViewModel.CanRefresh):
case nameof(AddressToolbarViewModel.IsSearchBoxVisible):
case nameof(NavigationToolbarViewModel.CanGoBack):
case nameof(NavigationToolbarViewModel.CanGoForward):
case nameof(NavigationToolbarViewModel.CanNavigateToParent):
case nameof(NavigationToolbarViewModel.HasItem):
case nameof(NavigationToolbarViewModel.CanRefresh):
case nameof(NavigationToolbarViewModel.IsSearchBoxVisible):
OnPropertyChanged(e.PropertyName);
break;
case nameof(AddressToolbarViewModel.SelectedItems):
case nameof(NavigationToolbarViewModel.SelectedItems):
UpdateSelectedItems();
break;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Files.App/Data/Contracts/IShellPage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public interface IShellPage : ITabBarItemContent, IMultiPaneInfo, IDisposable, I

IFilesystemHelpers FilesystemHelpers { get; }

AddressToolbarViewModel ToolbarViewModel { get; }
NavigationToolbarViewModel ToolbarViewModel { get; }

bool CanNavigateBackward { get; }

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!-- Copyright (c) Files Community. Licensed under the MIT License. -->
<UserControl
x:Class="Files.App.UserControls.AddressToolbar"
x:Class="Files.App.UserControls.NavigationToolbar"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:animatedvisuals="using:Microsoft.UI.Xaml.Controls.AnimatedVisuals"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

namespace Files.App.UserControls
{
public sealed partial class AddressToolbar : UserControl
public sealed partial class NavigationToolbar : UserControl
{
// Dependency injections

Expand All @@ -39,15 +39,15 @@ public sealed partial class AddressToolbar : UserControl
public partial bool ShowSearchBox { get; set; }

[GeneratedDependencyProperty]
public partial AddressToolbarViewModel ViewModel { get; set; }
public partial NavigationToolbarViewModel ViewModel { get; set; }

// Commands

private readonly ICommand historyItemClickedCommand;

// Constructor

public AddressToolbar()
public NavigationToolbar()
{
InitializeComponent();

Expand Down
2 changes: 1 addition & 1 deletion src/Files.App/UserControls/PathBreadcrumb.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ namespace Files.App.UserControls
public sealed partial class PathBreadcrumb : UserControl
{
[GeneratedDependencyProperty]
public partial AddressToolbarViewModel ViewModel { get; set; }
public partial NavigationToolbarViewModel ViewModel { get; set; }

public PathBreadcrumb()
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!-- Copyright (c) Files Community. Licensed under the MIT License. -->
<UserControl
x:Class="Files.App.UserControls.InnerNavigationToolbar"
x:Class="Files.App.UserControls.Toolbar"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:contract8Present="http://schemas.microsoft.com/winfx/2006/xaml/presentation?IsApiContractPresent(Windows.Foundation.UniversalApiContract,8)"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Copyright (c) Files Community
// Licensed under the MIT License.

using CommunityToolkit.WinUI;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
using Microsoft.UI.Xaml.Input;
Expand All @@ -10,50 +11,27 @@

namespace Files.App.UserControls
{
public sealed partial class InnerNavigationToolbar : UserControl
public sealed partial class Toolbar : UserControl
{
public InnerNavigationToolbar()
{
InitializeComponent();
}

public IUserSettingsService UserSettingsService { get; } = Ioc.Default.GetRequiredService<IUserSettingsService>();
public ICommandManager Commands { get; } = Ioc.Default.GetRequiredService<ICommandManager>();
public IModifiableCommandManager ModifiableCommands { get; } = Ioc.Default.GetRequiredService<IModifiableCommandManager>();

private readonly IUserSettingsService UserSettingsService = Ioc.Default.GetRequiredService<IUserSettingsService>();
private readonly ICommandManager Commands = Ioc.Default.GetRequiredService<ICommandManager>();
private readonly IModifiableCommandManager ModifiableCommands = Ioc.Default.GetRequiredService<IModifiableCommandManager>();
private readonly IAddItemService addItemService = Ioc.Default.GetRequiredService<IAddItemService>();

public AppModel AppModel => App.AppModel;

public AddressToolbarViewModel? ViewModel
{
get => (AddressToolbarViewModel)GetValue(ViewModelProperty);
set => SetValue(ViewModelProperty, value);
}

// Using a DependencyProperty as the backing store for ViewModel. This enables animation, styling, binding, etc...
public static readonly DependencyProperty ViewModelProperty =
DependencyProperty.Register(nameof(ViewModel), typeof(AddressToolbarViewModel), typeof(InnerNavigationToolbar), new PropertyMetadata(null));
[GeneratedDependencyProperty]
public partial NavigationToolbarViewModel? ViewModel { get; set; }

public bool ShowViewControlButton
{
get { return (bool)GetValue(ShowViewControlButtonProperty); }
set { SetValue(ShowViewControlButtonProperty, value); }
}
[GeneratedDependencyProperty]
public partial bool ShowViewControlButton { get; set; }

// Using a DependencyProperty as the backing store for ShowViewControlButton. This enables animation, styling, binding, etc...
public static readonly DependencyProperty ShowViewControlButtonProperty =
DependencyProperty.Register("ShowViewControlButton", typeof(bool), typeof(AddressToolbar), new PropertyMetadata(null));
[GeneratedDependencyProperty]
public partial bool ShowPreviewPaneButton { get; set; }

public bool ShowPreviewPaneButton
public Toolbar()
{
get { return (bool)GetValue(ShowPreviewPaneButtonProperty); }
set { SetValue(ShowPreviewPaneButtonProperty, value); }
InitializeComponent();
}

// Using a DependencyProperty as the backing store for ShowPreviewPaneButton. This enables animation, styling, binding, etc...
public static readonly DependencyProperty ShowPreviewPaneButtonProperty =
DependencyProperty.Register("ShowPreviewPaneButton", typeof(bool), typeof(AddressToolbar), new PropertyMetadata(null));
private void NewEmptySpace_Opening(object sender, object e)
{
var shell = NewEmptySpace.Items.Where(x => (x.Tag as string) == "CreateNewFile").Reverse().ToList();
Expand Down Expand Up @@ -131,4 +109,4 @@ private void AppBarButton_AccessKeyInvoked(UIElement sender, AccessKeyInvokedEve
args.Handled = true;
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

namespace Files.App.ViewModels.UserControls
{
public sealed partial class AddressToolbarViewModel : ObservableObject, IAddressToolbarViewModel, IDisposable
public sealed partial class NavigationToolbarViewModel : ObservableObject, IAddressToolbarViewModel, IDisposable
{
private const int MAX_SUGGESTIONS = 10;

Expand Down Expand Up @@ -197,7 +197,7 @@ public Style LayoutThemedIcon

private PointerRoutedEventArgs? pointerRoutedEventArgs;

public AddressToolbarViewModel()
public NavigationToolbarViewModel()
{
dispatcherQueue = DispatcherQueue.GetForCurrentThread();
dragOverTimer = dispatcherQueue.CreateTimer();
Expand Down Expand Up @@ -578,7 +578,7 @@ public void UpdateAdditionalActions()
OnPropertyChanged(nameof(HasAdditionalAction));
}

private AddressToolbar? AddressToolbar => (MainWindow.Instance.Content as Frame)?.FindDescendant<AddressToolbar>();
private NavigationToolbar? AddressToolbar => (MainWindow.Instance.Content as Frame)?.FindDescendant<NavigationToolbar>();

private void CloseSearchBox(bool doFocus = false)
{
Expand Down
4 changes: 2 additions & 2 deletions src/Files.App/Views/Layouts/BaseLayoutPage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ public abstract class BaseLayoutPage : Page, IBaseLayoutPage, INotifyPropertyCha

// Properties

protected AddressToolbar? NavToolbar
=> (MainWindow.Instance.Content as Frame)?.FindDescendant<AddressToolbar>();
protected NavigationToolbar? NavToolbar
=> (MainWindow.Instance.Content as Frame)?.FindDescendant<NavigationToolbar>();

public LayoutPreferencesManager? FolderSettings
=> ParentShellPageInstance?.InstanceViewModel.FolderSettings;
Expand Down
4 changes: 2 additions & 2 deletions src/Files.App/Views/MainPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@
TabIndex="0" />

<!-- Address Bar -->
<uc:AddressToolbar
<uc:NavigationToolbar
x:Name="NavToolbar"
Grid.Row="1"
HorizontalAlignment="Stretch"
Expand Down Expand Up @@ -196,7 +196,7 @@
</Grid.ColumnDefinitions>

<!-- File Navigation Toolbar -->
<uc:InnerNavigationToolbar
<uc:Toolbar
x:Name="InnerNavigationToolbar"
Grid.Row="0"
Grid.ColumnSpan="3"
Expand Down
2 changes: 1 addition & 1 deletion src/Files.App/Views/Shells/BaseShellPage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public abstract class BaseShellPage : Page, IShellPage, INotifyPropertyChanged

protected readonly ICommandManager commands = Ioc.Default.GetRequiredService<ICommandManager>();

public AddressToolbarViewModel ToolbarViewModel { get; } = new AddressToolbarViewModel();
public NavigationToolbarViewModel ToolbarViewModel { get; } = new NavigationToolbarViewModel();

public IBaseLayoutPage SlimContentPage => ContentPage;

Expand Down
Loading