Skip to content

Commit

Permalink
Merge pull request #19 from Apollo199999999/LauncherX-v2.1.2
Browse files Browse the repository at this point in the history
LauncherX v2.1.2
  • Loading branch information
Apollo199999999 authored Jan 3, 2025
2 parents 0b0599e + 892b918 commit 74992b8
Show file tree
Hide file tree
Showing 2,292 changed files with 6,606 additions and 1,998 deletions.
Binary file modified .vs/LauncherX/v17/.suo
Binary file not shown.
12 changes: 12 additions & 0 deletions LauncherXWinUI/Controls/GridViewItems/EditItemWindow.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using LauncherXWinUI.Classes;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Media.Imaging;
using WinUIEx;

// To learn more about WinUI, the WinUI project structure,
Expand All @@ -13,6 +14,9 @@ namespace LauncherXWinUI.Controls.GridViewItems
/// </summary>
public sealed partial class EditItemWindow : WinUIEx.WindowEx
{
// Variables to store the original DecodeWidth in the EditDialogImage
public int OriginalDecodeWidth = 0;

public EditItemWindow()
{
this.InitializeComponent();
Expand All @@ -33,10 +37,18 @@ private void Container_Loaded(object sender, RoutedEventArgs e)

// Disable maximise
UIFunctionsClass.PreventWindowMaximise(this);

// Properly set the decode pixel width and height of the icon rendered
BitmapImage ItemIcon = EditDialogImage.Source as BitmapImage;
OriginalDecodeWidth = ItemIcon.DecodePixelWidth;
ItemIcon.DecodePixelWidth = (int)EditDialogImage.Width * 2;
}

private void CloseBtn_Click(object sender, RoutedEventArgs e)
{
// Reset DecodePixelWidth and DecodePixelHeight of the BitmapImage in the EditDialogImage control - otherwise things will look weird in the main items grid
BitmapImage ItemIcon = EditDialogImage.Source as BitmapImage;
ItemIcon.DecodePixelWidth = OriginalDecodeWidth;
this.Close();
}
}
Expand Down
9 changes: 4 additions & 5 deletions LauncherXWinUI/Controls/GridViewItems/GridViewTile.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@
VerticalAlignment="Stretch"
AllowDrop="True">
<Grid.RowDefinitions>
<RowDefinition Height="auto" />
<RowDefinition Height="*" />
<RowDefinition Height="5*" />
<RowDefinition Height="2*" />
</Grid.RowDefinitions>

<Grid
Grid.Row="0"
HorizontalAlignment="Stretch"
VerticalAlignment="Center"
VerticalAlignment="Stretch"
AllowDrop="True">
<Image x:Name="TileImage" Stretch="Uniform" />

Expand All @@ -52,9 +52,8 @@
<TextBlock
x:Name="TileText"
Grid.Row="1"
Margin="5,5,5,5"
HorizontalAlignment="Center"
VerticalAlignment="Bottom"
VerticalAlignment="Center"
AllowDrop="True"
TextAlignment="Center"
TextTrimming="CharacterEllipsis" />
Expand Down
5 changes: 1 addition & 4 deletions LauncherXWinUI/Controls/GridViewItems/GridViewTile.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,9 @@ private static void OnSizeChanged(DependencyObject d, DependencyPropertyChangedE
gridViewTile.ControlBorder.Height = newHeight;

// Update image margin and dimensions
gridViewTile.TileImage.Margin = new Thickness(newSize * 22.5, newSize * 5, newSize * 22.5, 0);
gridViewTile.TileImage.Height = newWidth - newSize * 22.5 - newSize * 22.5;
gridViewTile.TileImage.Margin = new Thickness(0, newSize * 5, 0, 0);
gridViewTile.TileImage.Stretch = Stretch.Uniform;
gridViewTile.LinkedFolderImage.Margin = new Thickness(newSize * 10, newSize * 5, newSize * 22.5, 0);
gridViewTile.LinkedFolderImage.Height = newWidth - newSize * 22.5 - newSize * 22.5;
gridViewTile.LinkedFolderImage.Stretch = Stretch.Uniform;

// Update the font size of the textblock
Expand Down Expand Up @@ -542,7 +540,6 @@ private void MenuEditOption_Click(object sender, RoutedEventArgs e)
{
// Show the EditItemWindow
editItemWindow = new EditItemWindow();

editItemWindow.EditDialogImage.Source = this.ImageSource;
editItemWindow.EditDisplayTextTextBox.Text = this.DisplayText;
TempCustomImagePath = this.CustomImagePath;
Expand Down
15 changes: 11 additions & 4 deletions LauncherXWinUI/Controls/GridViewItems/GridViewTileGroup.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,23 @@
AllowDrop="True"
BorderThickness="2,2,2,3"
CornerRadius="{ThemeResource ControlCornerRadius}">
<StackPanel
<Grid
x:Name="GroupPanel"
AllowDrop="True"
PointerPressed="GroupPanel_PointerPressed"
PointerReleased="GroupPanel_PointerReleased"
RightTapped="GroupPanel_RightTapped"
Tapped="GroupPanel_Tapped">
<Grid.RowDefinitions>
<RowDefinition Height="5*" />
<RowDefinition Height="2*" />
</Grid.RowDefinitions>

<Grid
x:Name="ItemsPreviewGrid"
Grid.Row="0"
Height="Auto"
MinWidth="{Binding ActualHeight, RelativeSource={RelativeSource Self}}"
HorizontalAlignment="Center"
VerticalAlignment="Center"
AllowDrop="True">
Expand All @@ -47,9 +54,9 @@

<TextBlock
x:Name="TileText"
Margin="5,5,5,5"
Grid.Row="1"
HorizontalAlignment="Center"
VerticalAlignment="Bottom"
VerticalAlignment="Center"
AllowDrop="True"
TextAlignment="Center"
TextTrimming="CharacterEllipsis" />
Expand Down Expand Up @@ -113,6 +120,6 @@
Text="Remove group from LauncherX" />
</MenuFlyout>
</FlyoutBase.AttachedFlyout>
</StackPanel>
</Grid>
</Border>
</UserControl>
12 changes: 5 additions & 7 deletions LauncherXWinUI/Controls/GridViewItems/GridViewTileGroup.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
using System.Collections.Specialized;
using System.Diagnostics;
using System.Threading.Tasks;
using Windows.Security.Cryptography.Certificates;
using Windows.UI;

// To learn more about WinUI, the WinUI project structure,
Expand Down Expand Up @@ -77,15 +78,12 @@ private static void OnSizeChanged(DependencyObject d, DependencyPropertyChangedE
// Update control dimensions
gridViewTileGroup.ControlBorder.Width = newWidth;
gridViewTileGroup.ControlBorder.Height = newHeight;
gridViewTileGroup.ItemsPreviewGrid.Margin = new Thickness(newSize * 22.5, newSize * 5, newSize * 22.5, 0);
gridViewTileGroup.ItemsPreviewGrid.Height = newWidth - newSize * 22.5 - newSize * 22.5;
gridViewTileGroup.ItemsPreviewGrid.Width = newWidth - newSize * 22.5 - newSize * 22.5;
gridViewTileGroup.ItemsPreviewGrid.Margin = new Thickness(0, newSize * 2.5, 0, 0);

// Update image controls
foreach (Image image in gridViewTileGroup.ItemsPreviewGrid.Children)
{
image.Width = gridViewTileGroup.ItemsPreviewGrid.Width / 2.5;
image.Height = gridViewTileGroup.ItemsPreviewGrid.Width / 2.5;
image.Margin = new Thickness(newSize * 2.5);
image.Stretch = Stretch.Uniform;
}

Expand Down Expand Up @@ -162,10 +160,10 @@ public void UpdatePreview()
break;
}

double ControlSize = Math.Sqrt(Size);
Image image = new Image();
image.Source = Items[i].ImageSource;
image.Width = ItemsPreviewGrid.Width / 2.5;
image.Height = ItemsPreviewGrid.Width / 2.5;
image.Margin = new Thickness(ControlSize * 2.5);
image.Stretch = Stretch.Uniform;
image.HorizontalAlignment = HorizontalAlignment.Center;
image.VerticalAlignment = VerticalAlignment.Center;
Expand Down
18 changes: 9 additions & 9 deletions LauncherXWinUI/LauncherXWinUI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
<Description>LauncherX - Modern app launcher for Windows</Description>
<Copyright>Copyright © 2020-present ClickPhase</Copyright>
<PackageProjectUrl>https://clickphase.vercel.app/launcherx</PackageProjectUrl>
<AssemblyVersion>2.1.1.0</AssemblyVersion>
<FileVersion>2.1.1.0</FileVersion>
<Version>2.1.1.0</Version>
<AssemblyVersion>2.1.2.0</AssemblyVersion>
<FileVersion>2.1.2.0</FileVersion>
<Version>2.1.2.0</Version>
<PackageIcon>icon.png</PackageIcon>
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
<BuiltInComInteropSupport>true</BuiltInComInteropSupport>
Expand Down Expand Up @@ -54,13 +54,13 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="CommunityToolkit.WinUI.Controls.SettingsControls" Version="8.1.240821" />
<PackageReference Include="CommunityToolkit.WinUI.Extensions" Version="8.1.240821" />
<PackageReference Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.26100.1" />
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.6.240829007" />
<PackageReference Include="CommunityToolkit.WinUI.Controls.SettingsControls" Version="8.1.240916" />
<PackageReference Include="CommunityToolkit.WinUI.Extensions" Version="8.1.240916" />
<PackageReference Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.26100.1742" />
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.6.241114003" />
<PackageReference Include="Octokit" Version="13.0.1" />
<PackageReference Include="System.Text.Json" Version="8.0.4" />
<PackageReference Include="WinUIEx" Version="2.3.4" />
<PackageReference Include="System.Text.Json" Version="9.0.0" />
<PackageReference Include="WinUIEx" Version="2.5.0" />
<Manifest Include="$(ApplicationManifest)" />
</ItemGroup>

Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading

0 comments on commit 74992b8

Please sign in to comment.