Skip to content

Commit

Permalink
update QuickHomePage
Browse files Browse the repository at this point in the history
  • Loading branch information
Valkirie committed Nov 28, 2024
1 parent 67f7744 commit 226a1ae
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
12 changes: 3 additions & 9 deletions HandheldCompanion/ViewModels/Pages/QuickHomePageViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -75,18 +75,12 @@ private void HotkeysManager_Updated(Hotkey hotkey)
HotkeyViewModel? foundHotkey = HotkeysList.ToList().FirstOrDefault(p => p.Hotkey.ButtonFlags == hotkey.ButtonFlags);
if (foundHotkey is null)
{
if (hotkey.IsPinned)
{
HotkeyViewModel hotkeyViewModel = new HotkeyViewModel(hotkey);
HotkeysList.SafeAdd(hotkeyViewModel);
}
HotkeyViewModel hotkeyViewModel = new HotkeyViewModel(hotkey);
HotkeysList.SafeAdd(hotkeyViewModel);
}
else
{
if (hotkey.IsPinned)
foundHotkey.Hotkey = hotkey;
else
HotkeysManager_Deleted(hotkey);
foundHotkey.Hotkey = hotkey;
}
}

Expand Down
11 changes: 10 additions & 1 deletion HandheldCompanion/Views/QuickPages/QuickHomePage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,16 @@
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>

<ItemsControl.ItemContainerStyle>
<Style TargetType="ContentPresenter">
<Style.Triggers>
<DataTrigger Binding="{Binding IsPinned}" Value="False">
<Setter Property="Visibility" Value="Collapsed" />
</DataTrigger>
</Style.Triggers>
</Style>
</ItemsControl.ItemContainerStyle>

<ItemsControl.ItemTemplate>
<DataTemplate>
<ToggleButton
Expand All @@ -56,7 +66,6 @@
IsChecked="{Binding IsToggled, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}"
IsEnabled="{Binding IsEnabled, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}"
ScrollViewer.PanningMode="HorizontalOnly">

<StackPanel HorizontalAlignment="Stretch" Orientation="Vertical">
<ui:FontIcon
Width="24"
Expand Down

0 comments on commit 226a1ae

Please sign in to comment.