mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Merge pull request #3088 from Jack251970/dev2
Fix possible content frame navigation issue in welcome window & setting window
This commit is contained in:
commit
db5b773bb0
4 changed files with 31 additions and 4 deletions
|
|
@ -171,6 +171,7 @@
|
||||||
IsPaneToggleButtonVisible="False"
|
IsPaneToggleButtonVisible="False"
|
||||||
IsSettingsVisible="False"
|
IsSettingsVisible="False"
|
||||||
IsTabStop="False"
|
IsTabStop="False"
|
||||||
|
Loaded="NavView_Loaded"
|
||||||
OpenPaneLength="240"
|
OpenPaneLength="240"
|
||||||
PaneDisplayMode="Left"
|
PaneDisplayMode="Left"
|
||||||
SelectionChanged="NavigationView_SelectionChanged">
|
SelectionChanged="NavigationView_SelectionChanged">
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,6 @@ public partial class SettingWindow
|
||||||
_api = api;
|
_api = api;
|
||||||
InitializePosition();
|
InitializePosition();
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
NavView.SelectedItem = NavView.MenuItems[0]; /* Set First Page */
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnLoaded(object sender, RoutedEventArgs e)
|
private void OnLoaded(object sender, RoutedEventArgs e)
|
||||||
|
|
@ -169,7 +168,11 @@ public partial class SettingWindow
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
var selectedItem = (NavigationViewItem)args.SelectedItem;
|
var selectedItem = (NavigationViewItem)args.SelectedItem;
|
||||||
if (selectedItem == null) return;
|
if (selectedItem == null)
|
||||||
|
{
|
||||||
|
NavView_Loaded(sender, null); /* Reset First Page */
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
var pageType = selectedItem.Name switch
|
var pageType = selectedItem.Name switch
|
||||||
{
|
{
|
||||||
|
|
@ -186,5 +189,22 @@ public partial class SettingWindow
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void NavView_Loaded(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
if (ContentFrame.IsLoaded)
|
||||||
|
{
|
||||||
|
ContentFrame_Loaded(sender, e);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ContentFrame.Loaded += ContentFrame_Loaded;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ContentFrame_Loaded(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
NavView.SelectedItem ??= NavView.MenuItems[0]; /* Set First Page */
|
||||||
|
}
|
||||||
|
|
||||||
public record PaneData(Settings Settings, Updater Updater, IPortable Portable);
|
public record PaneData(Settings Settings, Updater Updater, IPortable Portable);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -82,6 +82,7 @@
|
||||||
<ui:Frame
|
<ui:Frame
|
||||||
x:Name="ContentFrame"
|
x:Name="ContentFrame"
|
||||||
HorizontalAlignment="Stretch"
|
HorizontalAlignment="Stretch"
|
||||||
|
Loaded="ContentFrame_Loaded"
|
||||||
ScrollViewer.CanContentScroll="True"
|
ScrollViewer.CanContentScroll="True"
|
||||||
ScrollViewer.HorizontalScrollBarVisibility="Visible"
|
ScrollViewer.HorizontalScrollBarVisibility="Visible"
|
||||||
ScrollViewer.VerticalScrollBarVisibility="Visible">
|
ScrollViewer.VerticalScrollBarVisibility="Visible">
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,6 @@ namespace Flow.Launcher
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
BackButton.IsEnabled = false;
|
BackButton.IsEnabled = false;
|
||||||
this.settings = settings;
|
this.settings = settings;
|
||||||
ContentFrame.Navigate(PageTypeSelector(1), settings);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private NavigationTransitionInfo _transitionInfo = new SlideNavigationTransitionInfo()
|
private NavigationTransitionInfo _transitionInfo = new SlideNavigationTransitionInfo()
|
||||||
|
|
@ -102,9 +101,15 @@ namespace Flow.Launcher
|
||||||
var tRequest = new TraversalRequest(FocusNavigationDirection.Next);
|
var tRequest = new TraversalRequest(FocusNavigationDirection.Next);
|
||||||
textBox.MoveFocus(tRequest);
|
textBox.MoveFocus(tRequest);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnActivated(object sender, EventArgs e)
|
private void OnActivated(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
Keyboard.ClearFocus();
|
Keyboard.ClearFocus();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void ContentFrame_Loaded(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
ContentFrame.Navigate(PageTypeSelector(1), settings); /* Set First Page */
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue