Skip to content

Commit

Permalink
Carousel adjustments (#334)
Browse files Browse the repository at this point in the history
  • Loading branch information
shatyuka authored Dec 7, 2023
1 parent 7c1a6b1 commit 01eac5a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 2 additions & 4 deletions CollapseLauncher/XAMLs/MainApp/Pages/HomePage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -326,14 +326,12 @@
</Grid>
<StackPanel x:Name="ImageCarouselAndPostPanel" Grid.Column="0" Grid.Row="0" Grid.ColumnSpan="2" Grid.RowSpan="2"
Margin="{x:Bind localWindowSize:WindowSize.CurrentWindowSize.PostPanelBottomMargin}" Orientation="Vertical" HorizontalAlignment="Left" VerticalAlignment="Bottom">
<StackPanel HorizontalAlignment="Left">
<StackPanel HorizontalAlignment="Left" PointerEntered="CarouselStopScroll" PointerExited="CarouselRestartScroll">
<FlipView x:Name="ImageCarousel" Shadow="{ThemeResource SharedShadow}" Visibility="Collapsed"
MaxWidth="{x:Bind localWindowSize:WindowSize.CurrentWindowSize.EventPostCarouselBounds.Width}" Height="{x:Bind localWindowSize:WindowSize.CurrentWindowSize.EventPostCarouselBounds.Height}"
CornerRadius="8" ItemsSource="{x:Bind MenuPanels.imageCarouselPanel}"
Style="{ThemeResource CollapseFlipViewStyle}"
HorizontalAlignment="Center"
PointerEntered="CarouselStopScroll"
PointerExited="CarouselRestartScroll">
HorizontalAlignment="Center">
<FlipView.ItemTemplate>
<DataTemplate>
<imageex:ImageEx IsCacheEnabled="True" EnableLazyLoading="True" PlaceholderSource="ms-appx:///Assets/Images/default.png" Source="{Binding Icon}" Tag="{Binding URL}" ToolTipService.ToolTip="{Binding Description}" PointerPressed="OpenImageLinkFromTag"/>
Expand Down
2 changes: 2 additions & 0 deletions CollapseLauncher/XAMLs/MainApp/Pages/HomePage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -409,6 +409,7 @@ private async void HideImageEventImg(bool hide)
#region Open Link from Tag
private void OpenImageLinkFromTag(object sender, PointerRoutedEventArgs e)
{
if (!e.GetCurrentPoint((UIElement) sender).Properties.IsLeftButtonPressed) return;
SpawnWebView2.SpawnWebView2Window(((ImageEx.ImageEx)sender).Tag.ToString());
}

Expand Down Expand Up @@ -465,6 +466,7 @@ private void OpenLinkFromButtonWithTag(object sender, RoutedEventArgs e)

private void ClickImageEventSpriteLink(object sender, PointerRoutedEventArgs e)
{
if (!e.GetCurrentPoint((UIElement)sender).Properties.IsLeftButtonPressed) return;
object ImageTag = ((Image)sender).Tag;
if (ImageTag == null) return;
SpawnWebView2.SpawnWebView2Window((string)ImageTag);
Expand Down

0 comments on commit 01eac5a

Please sign in to comment.