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
2 changes: 1 addition & 1 deletion src/UniGetUI.Avalonia/UniGetUI.Avalonia.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@
<PackageReference Include="Avalonia.Controls.WebView" Version="12.0.0" />
<PackageReference Include="Tmds.DBus.Protocol" Version="0.92.0" />
<PackageReference Include="Devolutions.UniGetUI.Elevator" Version="2.6.1.3" GeneratePathProperty="true" ExcludeAssets="build;buildTransitive;native" Condition="$([MSBuild]::IsOSPlatform('Windows'))" />
<PackageReference Include="Devolutions.Pinget.Cli.Rust" Version="0.9.0" GeneratePathProperty="true" ExcludeAssets="build;buildTransitive;native" />
<PackageReference Include="Devolutions.Pinget.Cli.Rust" Version="0.10.0" GeneratePathProperty="true" ExcludeAssets="build;buildTransitive;native" />
</ItemGroup>

<ItemGroup>
Expand Down
5 changes: 4 additions & 1 deletion src/UniGetUI.Avalonia/Views/Controls/InfoBar.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,10 @@

<Border x:Name="BodyBorder"
IsVisible="{Binding IsOpen}"
BorderThickness="0,1,0,1"
BorderThickness="1"
CornerRadius="6"
ClipToBounds="True"
Margin="12,4"
automation:AutomationProperties.AccessibilityView="Control"
automation:AutomationProperties.Name="{Binding Title}"
automation:AutomationProperties.HelpText="{Binding Message}"
Expand Down
36 changes: 33 additions & 3 deletions src/UniGetUI.Avalonia/Views/Controls/Settings/SettingsCard.cs
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,31 @@ public bool IsClickEnabled
set => _border.CornerRadius = value;
}

// Base (unfocused) thickness as assigned by the consumer. Grouped cards use a
// partial thickness like "1,0,1,1" to share a divider with the card above; we
// must remember it so we can restore it when focus leaves.
private Thickness _baseBorderThickness = new(1);

public new Thickness BorderThickness
{
get => _border.BorderThickness;
set => _border.BorderThickness = value;
set
{
_baseBorderThickness = value;
// While focused the border is forced complete (see GotFocus); don't clobber it.
if (!_border.Classes.Contains("settings-card-focused"))
_border.BorderThickness = value;
}
}

// A focused card needs a border on all four sides, even when its base thickness omits
// the top (grouped cards). The accent focus style can't supply this: BorderThickness is
// a local value on _border, which wins over the style setter — so we set it here instead.
private static Thickness FocusedBorderThickness(Thickness baseThickness)
{
double t = Math.Max(Math.Max(baseThickness.Left, baseThickness.Right),
Math.Max(baseThickness.Top, baseThickness.Bottom));
return new Thickness(Math.Max(t, 1));
}

// ── Constructor ────────────────────────────────────────────────────────
Expand Down Expand Up @@ -216,8 +237,17 @@ public SettingsCard()

PointerPressed += OnPointerPressed;
KeyDown += OnKeyDown;
GotFocus += (_, _) => { if (_isClickEnabled) _border.Classes.Add("settings-card-focused"); };
LostFocus += (_, _) => _border.Classes.Remove("settings-card-focused");
GotFocus += (_, _) =>
{
if (!_isClickEnabled) return;
_border.Classes.Add("settings-card-focused");
_border.BorderThickness = FocusedBorderThickness(_baseBorderThickness);
};
LostFocus += (_, _) =>
{
_border.Classes.Remove("settings-card-focused");
_border.BorderThickness = _baseBorderThickness;
};
SyncAutomationProperties();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,6 @@ private void ApplyLayoutForCurrentSize()
MainGrid.ColumnDefinitions[1].Width = new GridLength(1, GridUnitType.Star);

ScreenshotsBorder.Height = _vm.HasScreenshots ? 320 : 150;
InstallOptionsExpander.IsExpanded = true;
}
else
{
Expand All @@ -169,7 +168,6 @@ private void ApplyLayoutForCurrentSize()
MainGrid.ColumnDefinitions[1].Width = new GridLength(0);

ScreenshotsBorder.Height = _vm.HasScreenshots ? 225 : 130;
InstallOptionsExpander.IsExpanded = false;
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/UniGetUI.Avalonia/Views/MainWindow.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
via styles (opacity) so the .focus-within setter wins over the base. -->
<Style Selector="Border#SearchFocusUnderline">
<Setter Property="Opacity" Value="0"/>
<Setter Property="Background" Value="{DynamicResource SystemAccentColor}"/>
<Setter Property="Background" Value="{DynamicResource TextFillColorSecondaryBrush}"/>
<Setter Property="Transitions">
<Transitions>
<DoubleTransition Property="Opacity" Duration="0:0:0.12"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
full-border accent or the field swapping to its focused (black) background. -->
<Style Selector="Border#MegaQueryUnderline">
<Setter Property="Opacity" Value="0"/>
<Setter Property="Background" Value="{DynamicResource SystemAccentColor}"/>
<Setter Property="Background" Value="{DynamicResource TextFillColorSecondaryBrush}"/>
<Setter Property="Transitions">
<Transitions>
<DoubleTransition Property="Opacity" Duration="0:0:0.12"/>
Expand Down
Loading