Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/UniGetUI.Avalonia.slnx
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,12 @@
<Platform Solution="*|x64" Project="x64" />
</Project>
</Folder>
<Folder Name="/UniGetUI.PackageEngine.Managers.Homebrew/">
<Project Path="UniGetUI.PackageEngine.Managers.Homebrew/UniGetUI.PackageEngine.Managers.Homebrew.csproj">
<Platform Solution="*|arm64" Project="arm64" />
<Platform Solution="*|x64" Project="x64" />
</Project>
</Folder>
<Folder Name="/UniGetUI.PackageEngine.Managers.Vcpkg/">
<Project Path="UniGetUI.PackageEngine.Managers.Vcpkg/UniGetUI.PackageEngine.Managers.Vcpkg.csproj">
<Platform Solution="*|arm64" Project="arm64" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ public SettingsPageButton()
IconType.SaveAs => "save_as",
IconType.OpenFolder => "open_folder",
IconType.Experimental => "experimental",
IconType.ClipboardList => "clipboard_list",
_ => icon.ToString().ToLower(),
};
}
14 changes: 14 additions & 0 deletions src/UniGetUI.Avalonia/Views/Controls/SvgIcon.cs
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,20 @@ private void LoadSvg(string? uri)
catch { /* skip malformed path data */ }
}
}
foreach (XElement el in doc.Descendants(ns + "ellipse"))
{
if (double.TryParse(el.Attribute("cx")?.Value, System.Globalization.NumberStyles.Any,
System.Globalization.CultureInfo.InvariantCulture, out double cx) &&
double.TryParse(el.Attribute("cy")?.Value, System.Globalization.NumberStyles.Any,
System.Globalization.CultureInfo.InvariantCulture, out double cy) &&
double.TryParse(el.Attribute("rx")?.Value, System.Globalization.NumberStyles.Any,
System.Globalization.CultureInfo.InvariantCulture, out double rx) &&
double.TryParse(el.Attribute("ry")?.Value, System.Globalization.NumberStyles.Any,
System.Globalization.CultureInfo.InvariantCulture, out double ry))
{
_geometries.Add(new EllipseGeometry(new Rect(cx - rx, cy - ry, rx * 2, ry * 2)));
}
}
}
catch
{
Expand Down
84 changes: 69 additions & 15 deletions src/UniGetUI.Avalonia/Views/MainWindow.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@
mc:Ignorable="d" d:DesignWidth="1200" d:DesignHeight="750"
x:Class="UniGetUI.Avalonia.Views.MainWindow"
x:DataType="vm:MainWindowViewModel"
Title="UniGetUI"
Width="1450"
MinWidth="700"
MinHeight="500"
ExtendClientAreaToDecorationsHint="True"
ExtendClientAreaTitleBarHeightHint="-1">
MinHeight="500">
<Panel>
<!-- Main content pushed below the native title bar -->
<Grid ColumnDefinitions="Auto,*"
<Grid x:Name="MainContentGrid"
ColumnDefinitions="Auto,*"
RowDefinitions="*,4,Auto"
Background="{DynamicResource AppWindowBackground}"
Margin="{Binding $parent[Window].WindowDecorationMargin}">
Expand Down Expand Up @@ -204,17 +204,20 @@
</Grid>

<!-- ── Title bar: drag area + search box ── -->
<Grid Height="{Binding $parent[Window].WindowDecorationMargin.Top}"
<Grid x:Name="TitleBarGrid"
Height="{Binding $parent[Window].WindowDecorationMargin.Top}"
VerticalAlignment="Top"
ColumnDefinitions="*,Auto,*">

<!-- Drag area fills the whole title bar -->
<!-- Drag area — sits behind everything so interactive controls still work -->
<Border Grid.Column="0" Grid.ColumnSpan="3"
Background="{DynamicResource AppTitleBarBackground}"
IsHitTestVisible="True"
PointerPressed="TitleBar_PointerPressed"/>

<!-- Left: hamburger toggle button + app name -->
<StackPanel Grid.Column="0"
<!-- Left: hamburger + app name -->
<StackPanel x:Name="HamburgerPanel"
Grid.Column="0"
HorizontalAlignment="Left"
VerticalAlignment="Center"
Orientation="Horizontal"
Expand All @@ -236,7 +239,7 @@
VerticalAlignment="Center"/>
</StackPanel>

<!-- Centre: global search box (Auto column → truly centred in the window) -->
<!-- Centre: search box — vertically centred, no platform-specific margin -->
<StackPanel Grid.Column="1"
VerticalAlignment="Center"
Orientation="Horizontal"
Expand Down Expand Up @@ -264,12 +267,63 @@
</Button>
</StackPanel>

<!-- Right: GitHub account avatar (centred in the right * column) -->
<controls:UserAvatarControl Grid.Column="2"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Height="50"
Margin="0,10,0,0"/>
<!-- Right column: avatar centred + Linux window buttons on the far right -->
<Panel Grid.Column="2">
<controls:UserAvatarControl x:Name="AvatarControl"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Height="50"
Margin="0,10,0,0"/>

<!-- Linux only: min / max / close (IsVisible set in code-behind) -->
<StackPanel x:Name="LinuxWindowButtons"
Orientation="Horizontal"
HorizontalAlignment="Right"
VerticalAlignment="Center"
Margin="0,0,4,0"
Spacing="0"
IsVisible="False">
<!-- Minimize: horizontal line -->
<Button Width="46" Height="32" Padding="0"
Background="Transparent" BorderThickness="0" CornerRadius="0"
ToolTip.Tip="{t:Translate Minimize}"
Click="MinimizeButton_Click">
<Path Stroke="{DynamicResource SystemBaseHighColor}"
StrokeThickness="1.5"
StrokeLineCap="Round"
Data="M2,0 H10"
Width="12" Height="2"
HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Button>
<!-- Maximize / Restore: square outline, geometry swapped in code-behind -->
<Button x:Name="MaximizeButton"
Width="46" Height="32" Padding="0"
Background="Transparent" BorderThickness="0" CornerRadius="0"
ToolTip.Tip="{t:Translate Maximize}"
Click="MaximizeButton_Click">
<Path x:Name="MaximizeIcon"
Stroke="{DynamicResource SystemBaseHighColor}"
StrokeThickness="1.5"
StrokeLineCap="Round"

Data="M0,0 H10 V10 H0 Z"
Width="12" Height="12"
HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Button>
<!-- Close: X -->
<Button Width="46" Height="32" Padding="0"
Background="Transparent" BorderThickness="0" CornerRadius="0"
ToolTip.Tip="{t:Translate Close}"
Click="CloseButton_Click">
<Path Stroke="{DynamicResource SystemBaseHighColor}"
StrokeThickness="1.5"
StrokeLineCap="Round"
Data="M0,0 L10,10 M10,0 L0,10"
Width="12" Height="12"
HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Button>
</StackPanel>
</Panel>
</Grid>
</Panel>
</Window>
53 changes: 53 additions & 0 deletions src/UniGetUI.Avalonia/Views/MainWindow.axaml.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
using Avalonia;
using Avalonia.Controls;
using Avalonia.Controls.ApplicationLifetimes;
using Avalonia.Input;
using Avalonia.Interactivity;
using Avalonia.Media;
using UniGetUI.Avalonia.ViewModels;
using UniGetUI.Avalonia.Views.Pages;
using UniGetUI.Core.Logging;
using UniGetUI.Core.SettingsEngine;
using UniGetUI.Core.Tools;

namespace UniGetUI.Avalonia.Views;

Expand Down Expand Up @@ -44,6 +48,7 @@ public MainWindow()
Instance = this;
DataContext = new MainWindowViewModel();
InitializeComponent();
SetupTitleBar();

KeyDown += Window_KeyDown;
}
Expand Down Expand Up @@ -81,6 +86,54 @@ private void Window_KeyDown(object? sender, KeyEventArgs e)
}
}

private void SetupTitleBar()
{
if (OperatingSystem.IsMacOS())
{
// macOS: extend into the native title bar area.
// WindowDecorationMargin.Top drives TitleBarGrid.Height via binding.
// Traffic lights sit on the left → keep the 65 px HamburgerPanel margin.
// Avatar can be a bit taller to fill the deeper title bar.
ExtendClientAreaToDecorationsHint = true;
ExtendClientAreaTitleBarHeightHint = -1;
AvatarControl.Height = 36;
}
else if (OperatingSystem.IsLinux())
{
// Linux: remove the native title bar entirely; our toolbar is the
// only chrome. Custom min/max/close buttons appear on the right.
WindowDecorations = WindowDecorations.None;
TitleBarGrid.ClearValue(HeightProperty);
TitleBarGrid.Height = 44;
HamburgerPanel.Margin = new Thickness(10, 0, 8, 0);
AvatarControl.Height = 32;
LinuxWindowButtons.IsVisible = true;
MainContentGrid.Margin = new Thickness(0, 44, 0, 0);
// Keep maximize icon in sync with window state
this.GetObservable(WindowStateProperty).Subscribe(state =>
{
MaximizeIcon.Data = Geometry.Parse(
state == WindowState.Maximized
? "M2,0 H10 V8 H2 Z M0,2 H8 V10 H0 Z" // restore: two overlapping squares
: "M0,0 H10 V10 H0 Z"); // maximise: single square
ToolTip.SetTip(
MaximizeButton,
CoreTools.Translate(state == WindowState.Maximized ? "Restore" : "Maximize"));
});
}
}

private void MinimizeButton_Click(object? sender, RoutedEventArgs e)
=> WindowState = WindowState.Minimized;

private void MaximizeButton_Click(object? sender, RoutedEventArgs e)
=> WindowState = WindowState == WindowState.Maximized
? WindowState.Normal
: WindowState.Maximized;

private void CloseButton_Click(object? sender, RoutedEventArgs e)
=> Close();

private void TitleBar_PointerPressed(object? sender, PointerPressedEventArgs e)
{
if (e.GetCurrentPoint(this).Properties.IsLeftButtonPressed)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@

<!-- ── Managers ───────────────────────────────────────────── -->
<settings:SettingsPageButton CornerRadius="8"
Icon="Search"
Icon="ClipboardList"
Text="{t:Translate Package manager preferences}"
UnderText="{t:Translate Text='Enable and disable package managers, change default install options, etc.'}"
Command="{Binding NavigateToManagersCommand}"/>
Expand Down
8 changes: 4 additions & 4 deletions src/UniGetUI.Avalonia/Views/SidebarView.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
ToolTip.Tip="{t:Translate Discover Packages}">
<Panel>
<StackPanel Orientation="Horizontal" Spacing="12" Margin="8,6">
<controls:SvgIcon Path="avares://UniGetUI.Avalonia/Assets/Symbols/ms_store.svg" Width="24" Height="24" VerticalAlignment="Center" />
<controls:SvgIcon Path="avares://UniGetUI.Avalonia/Assets/Symbols/DiscoverPackage.svg" Width="24" Height="24" VerticalAlignment="Center" />
<TextBlock Text="{t:Translate Discover Packages}"
FontSize="16"
FontWeight="SemiBold"
Expand Down Expand Up @@ -94,7 +94,7 @@
ToolTip.Tip="{t:Translate Installed Packages}">
<Panel>
<StackPanel Orientation="Horizontal" Spacing="12" Margin="8,6">
<controls:SvgIcon Path="avares://UniGetUI.Avalonia/Assets/Symbols/local_pc.svg" Width="24" Height="24" VerticalAlignment="Center"/>
<controls:SvgIcon Path="avares://UniGetUI.Avalonia/Assets/Symbols/InstalledPackages.svg" Width="24" Height="24" VerticalAlignment="Center"/>
<TextBlock Text="{t:Translate Installed Packages}"
FontSize="16"
FontWeight="SemiBold"
Expand All @@ -114,7 +114,7 @@
ToolTip.Tip="{t:Translate Package Bundles}">
<Panel>
<StackPanel Orientation="Horizontal" Spacing="12" Margin="8,6">
<controls:SvgIcon Path="avares://UniGetUI.Avalonia/Assets/Symbols/save_as.svg" Width="24" Height="24" VerticalAlignment="Center"/>
<controls:SvgIcon Path="avares://UniGetUI.Avalonia/Assets/Symbols/PackagesBundle.svg" Width="24" Height="24" VerticalAlignment="Center"/>
<TextBlock Text="{t:Translate Package Bundles}"
FontSize="16"
FontWeight="SemiBold"
Expand Down Expand Up @@ -192,7 +192,7 @@
CornerRadius="6"
ToolTip.Tip="{t:Translate More}">
<StackPanel Orientation="Horizontal" Spacing="12">
<controls:SvgIcon Path="avares://UniGetUI.Avalonia/Assets/Symbols/options.svg" Width="24" Height="24" VerticalAlignment="Center"/>
<TextBlock Text="···" FontSize="20" Width="24" HorizontalAlignment="Center" VerticalAlignment="Center" TextAlignment="Center"/>
<TextBlock Text="{t:Translate More}" FontSize="16" VerticalAlignment="Center"
IsVisible="{Binding IsPaneOpen}"/>
</StackPanel>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
CornerRadius="4"
IsChecked="{Binding IsFilterPaneOpen, Mode=TwoWay}">
<StackPanel Orientation="Horizontal" Spacing="8">
<controls:SvgIcon Path="avares://UniGetUI.Avalonia/Assets/Symbols/options.svg" Width="16" Height="16" VerticalAlignment="Center"/>
<controls:SvgIcon Path="avares://UniGetUI.Avalonia/Assets/Symbols/Filter.svg" Width="16" Height="16" VerticalAlignment="Center"/>
<TextBlock Text="{t:Translate Filters}" FontSize="12" FontWeight="Medium" VerticalAlignment="Center"/>
</StackPanel>
</ToggleButton>
Expand Down Expand Up @@ -258,7 +258,7 @@
Background="{DynamicResource SettingsCardBackground}">
<Expander.Header>
<StackPanel Orientation="Horizontal" Spacing="8">
<controls:SvgIcon Path="avares://UniGetUI.Avalonia/Assets/Symbols/local_pc.svg" Width="16" Height="16" VerticalAlignment="Center"/>
<controls:SvgIcon Path="avares://UniGetUI.Avalonia/Assets/Symbols/Sources.svg" Width="16" Height="16" VerticalAlignment="Center"/>
<TextBlock Text="{t:Translate Sources}" FontWeight="SemiBold" VerticalAlignment="Center"/>
</StackPanel>
</Expander.Header>
Expand Down Expand Up @@ -325,7 +325,7 @@
Background="{DynamicResource SettingsCardBackground}">
<Expander.Header>
<StackPanel Orientation="Horizontal" Spacing="8">
<controls:SvgIcon Path="avares://UniGetUI.Avalonia/Assets/Symbols/options.svg" Width="16" Height="16" VerticalAlignment="Center"/>
<controls:SvgIcon Path="avares://UniGetUI.Avalonia/Assets/Symbols/Filter.svg" Width="16" Height="16" VerticalAlignment="Center"/>
<TextBlock Text="{t:Translate Filters}" FontWeight="SemiBold" VerticalAlignment="Center"/>
</StackPanel>
</Expander.Header>
Expand Down Expand Up @@ -632,7 +632,8 @@
<TextBox x:Name="MegaQueryBlock"
Grid.Row="1"
Grid.Column="1"
Padding="16,12,10,08"
Padding="16,0,10,0"
VerticalContentAlignment="Center"
CornerRadius="8,0,0,8"
FontSize="40"
Watermark="{t:Translate Search for packages}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public DiscoverSoftwarePage() : base(new PackagesPageData
{
PageName = "SoftwarePages.DiscoverSoftwarePage",
PageTitle = CoreTools.Translate("Discover Packages"),
IconName = "ms_store",
IconName = "DiscoverPackage",
PageRole = OperationType.Install,
Loader = DiscoverablePackagesLoader.Instance ?? new DiscoverablePackagesLoader([]),
MegaQueryBlockEnabled = true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public InstalledPackagesPage() : base(new PackagesPageData
{
PageName = "SoftwarePages.InstalledPackagesPage",
PageTitle = CoreTools.Translate("Installed Packages"),
IconName = "local_pc",
IconName = "InstalledPackages",
PageRole = OperationType.Uninstall,
Loader = InstalledPackagesLoader.Instance ?? new InstalledPackagesLoader([]),
MegaQueryBlockEnabled = false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public PackageBundlesPage() : base(new PackagesPageData
{
PageName = "SoftwarePages.PackageBundlesPage",
PageTitle = CoreTools.Translate("Package Bundles"),
IconName = "save_as",
IconName = "PackagesBundle",
PageRole = OperationType.Install,
Loader = PackageBundlesLoader.Instance!,
MegaQueryBlockEnabled = false,
Expand Down
Loading
Loading