|
1 | 1 | using CommunityToolkit.Mvvm.DependencyInjection;
|
2 | 2 | using CommunityToolkit.Mvvm.Input;
|
| 3 | +using Files.Backend.Extensions; |
3 | 4 | using Files.Backend.Services.Settings;
|
4 | 5 | using Files.Shared.Enums;
|
5 | 6 | using Files.Shared.EventArguments;
|
|
27 | 28 | using Windows.UI.Xaml.Controls;
|
28 | 29 | using Windows.UI.Xaml.Input;
|
29 | 30 | using Windows.UI.Xaml.Navigation;
|
30 |
| -using Files.Backend.Extensions; |
31 | 31 |
|
32 | 32 | namespace Files.Uwp.Views
|
33 | 33 | {
|
@@ -383,6 +383,21 @@ private void Page_Loaded(object sender, RoutedEventArgs e)
|
383 | 383 | }
|
384 | 384 | }
|
385 | 385 |
|
| 386 | + private void Page_SizeChanged(object sender, SizeChangedEventArgs e) |
| 387 | + { |
| 388 | + switch (Pane?.Position) |
| 389 | + { |
| 390 | + case PanePositions.Right when ContentColumn.ActualWidth == ContentColumn.MinWidth: |
| 391 | + UserSettingsService.PaneSettingsService.VerticalSizePx += e.NewSize.Width - e.PreviousSize.Width; |
| 392 | + UpdatePositioning(); |
| 393 | + break; |
| 394 | + case PanePositions.Bottom when ContentRow.ActualHeight == ContentRow.MinHeight: |
| 395 | + UserSettingsService.PaneSettingsService.HorizontalSizePx += e.NewSize.Height - e.PreviousSize.Height; |
| 396 | + UpdatePositioning(); |
| 397 | + break; |
| 398 | + } |
| 399 | + } |
| 400 | + |
386 | 401 | private void ToggleFullScreenAccelerator(KeyboardAcceleratorInvokedEventArgs e)
|
387 | 402 | {
|
388 | 403 | ApplicationView view = ApplicationView.GetForCurrentView();
|
@@ -474,17 +489,14 @@ private void UpdatePositioning()
|
474 | 489 |
|
475 | 490 | private void PaneSplitter_ManipulationCompleted(object sender, ManipulationCompletedRoutedEventArgs e)
|
476 | 491 | {
|
477 |
| - if (Pane is IPane p) |
| 492 | + switch (Pane?.Position) |
478 | 493 | {
|
479 |
| - switch (p.Position) |
480 |
| - { |
481 |
| - case PanePositions.Right: |
482 |
| - UserSettingsService.PaneSettingsService.VerticalSizePx = Pane.ActualWidth; |
483 |
| - break; |
484 |
| - case PanePositions.Bottom: |
485 |
| - UserSettingsService.PaneSettingsService.HorizontalSizePx = Pane.ActualHeight; |
486 |
| - break; |
487 |
| - } |
| 494 | + case PanePositions.Right: |
| 495 | + UserSettingsService.PaneSettingsService.VerticalSizePx = Pane.ActualWidth; |
| 496 | + break; |
| 497 | + case PanePositions.Bottom: |
| 498 | + UserSettingsService.PaneSettingsService.HorizontalSizePx = Pane.ActualHeight; |
| 499 | + break; |
488 | 500 | }
|
489 | 501 | }
|
490 | 502 |
|
|
0 commit comments