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
6 changes: 3 additions & 3 deletions src/Files.App/UserControls/Toolbar.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@
x:Name="SelectionOptions"
Width="Auto"
MinWidth="46"
x:Load="{x:Bind ShowViewControlButton, Mode=OneWay}"
x:Load="{x:Bind ViewModel.InstanceViewModel.IsPageTypeNotHome, Mode=OneWay}"
AccessKey="S"
AccessKeyInvoked="AppBarButton_AccessKeyInvoked"
AutomationProperties.Name="{helpers:ResourceString Name=SelectionOptions}"
Expand Down Expand Up @@ -155,7 +155,7 @@
x:Name="ArrangementOptions"
Width="Auto"
MinWidth="46"
x:Load="{x:Bind ShowViewControlButton, Mode=OneWay}"
x:Load="{x:Bind ViewModel.InstanceViewModel.IsPageTypeNotHome, Mode=OneWay}"
AccessKey="A"
AccessKeyInvoked="AppBarButton_AccessKeyInvoked"
AutomationProperties.Name="{helpers:ResourceString Name=Sort}"
Expand Down Expand Up @@ -266,7 +266,7 @@
x:Name="LayoutOptionsButton"
Width="Auto"
MinWidth="46"
x:Load="{x:Bind ShowViewControlButton, Mode=OneWay}"
x:Load="{x:Bind ViewModel.InstanceViewModel.IsPageTypeNotHome, Mode=OneWay}"
AccessKey="L"
AccessKeyInvoked="AppBarButton_AccessKeyInvoked"
AutomationProperties.Name="{helpers:ResourceString Name=Layout}"
Expand Down
3 changes: 0 additions & 3 deletions src/Files.App/UserControls/Toolbar.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,6 @@ public sealed partial class Toolbar : UserControl
[GeneratedDependencyProperty]
public partial NavigationToolbarViewModel? ViewModel { get; set; }

[GeneratedDependencyProperty]
public partial bool ShowViewControlButton { get; set; }

[GeneratedDependencyProperty]
public partial bool ShowPreviewPaneButton { get; set; }

Expand Down
7 changes: 0 additions & 7 deletions src/Files.App/ViewModels/MainPageViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,6 @@ public TabBarItem? SelectedTabItem
set => SetProperty(ref selectedTabItem, value);
}

private bool shouldViewControlBeDisplayed;
public bool ShouldViewControlBeDisplayed
{
get => shouldViewControlBeDisplayed;
set => SetProperty(ref shouldViewControlBeDisplayed, value);
}

private bool shouldPreviewPaneBeActive;
public bool ShouldPreviewPaneBeActive
{
Expand Down
1 change: 0 additions & 1 deletion src/Files.App/Views/MainPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,6 @@
x:Load="False"
Loaded="NavToolbar_Loaded"
ShowPreviewPaneButton="{x:Bind ViewModel.ShouldPreviewPaneBeDisplayed, Mode=OneWay}"
ShowViewControlButton="{x:Bind ViewModel.ShouldViewControlBeDisplayed, Mode=OneWay}"
TabIndex="2"
Visibility="{x:Bind ViewModel.ShowToolbar, Mode=OneWay}" />

Expand Down
8 changes: 7 additions & 1 deletion src/Files.App/Views/MainPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ public MainPage()

ViewModel.PropertyChanged += ViewModel_PropertyChanged;
UserSettingsService.OnSettingChangedEvent += UserSettingsService_OnSettingChangedEvent;
ContentPageContext.PropertyChanged += ContentPageContext_PropertyChanged;

_updateDateDisplayTimer = DispatcherQueue.CreateTimer();
_updateDateDisplayTimer.Interval = TimeSpan.FromSeconds(1);
Expand Down Expand Up @@ -188,6 +189,12 @@ private void PaneHolder_PropertyChanged(object? sender, PropertyChangedEventArgs
LoadPaneChanged();
}

private void ContentPageContext_PropertyChanged(object? sender, PropertyChangedEventArgs e)
{
if (e.PropertyName is nameof(IContentPageContext.PageType))
LoadPaneChanged();
}

private void UpdateStatusBarProperties()
{
if (StatusBar is not null)
Expand Down Expand Up @@ -420,7 +427,6 @@ private void LoadPaneChanged()

ViewModel.ShouldPreviewPaneBeDisplayed = ((!isHomePage && !isReleaseNotesPage && !isSettingsPage) || isMultiPane) && isBigEnough;
ViewModel.ShouldPreviewPaneBeActive = UserSettingsService.InfoPaneSettingsService.IsInfoPaneEnabled && ViewModel.ShouldPreviewPaneBeDisplayed;
ViewModel.ShouldViewControlBeDisplayed = SidebarAdaptiveViewModel.PaneHolder?.ActivePane?.InstanceViewModel?.IsPageTypeNotHome ?? false;

UpdatePositioning();
}
Expand Down
Loading