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
33 changes: 33 additions & 0 deletions src/UniGetUI.Avalonia/Assets/Styles/Styles.Common.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -495,6 +495,39 @@
<Setter Property="Foreground" Value="{DynamicResource AccentTextFillColorTertiaryBrush}"/>
</Style>

<!-- Filter-pane drag handle. The full splitter track is interactive; its subtle rounded hover
surface sits beneath the persistent grip, matching WinUI's pane-resize affordance. -->
<Style Selector="GridSplitter.winui-vertical-splitter">
<Setter Property="Background" Value="Transparent"/>
<Setter Property="Transitions">
<Transitions>
<BrushTransition Property="Background" Duration="0:0:0.083"/>
</Transitions>
</Setter>
<Setter Property="Template">
<ControlTemplate>
<!-- Match the visible splitter track to the package-list container on the
right, whose outer card is inset 6 DIPs vertically. -->
<Border Background="{TemplateBinding Background}"
Margin="0,6"
CornerRadius="6">
<Border Width="4" Height="22"
CornerRadius="2"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Background="{DynamicResource TextFillColorTertiaryBrush}"
IsHitTestVisible="False"/>
</Border>
</ControlTemplate>
</Setter>
</Style>
<Style Selector="GridSplitter.winui-vertical-splitter:pointerover">
<Setter Property="Background" Value="{DynamicResource SubtleFillColorSecondaryBrush}"/>
</Style>
<Style Selector="GridSplitter.winui-vertical-splitter:pressed">
<Setter Property="Background" Value="{DynamicResource SubtleFillColorTertiaryBrush}"/>
</Style>

<!-- Standard non-accent action button. Keep this semantic style separate from the
framework's default Button so icon, toolbar, dialog, and accent buttons retain
their purpose-specific appearances. Reusable controls such as ButtonCard opt in
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,25 @@ public partial class SoftwareCatalogViewModel : ViewModelBase
[ObservableProperty]
private bool _isFilterPaneOpen;

// Live width of the filter pane, kept in sync by the page so the toolbar's Filters button
// reserves the pane's width and the remaining buttons align with the package list.
private double _trackedFilterPaneWidth = 220.0;
public double TrackedFilterPaneWidth
{
get => _trackedFilterPaneWidth;
set
{
if (Math.Abs(_trackedFilterPaneWidth - value) < 0.5) return;
_trackedFilterPaneWidth = value;
if (IsFilterPaneOpen) OnPropertyChanged(nameof(FilterPaneColumnWidth));
}
}

public double FilterPaneColumnWidth => IsFilterPaneOpen ? _trackedFilterPaneWidth : 0.0;

partial void OnIsFilterPaneOpenChanged(bool value) =>
OnPropertyChanged(nameof(FilterPaneColumnWidth));

[ObservableProperty]
private SearchMode _searchMode = SearchMode.Both;

Expand Down Expand Up @@ -84,14 +103,32 @@ public bool HasHiddenPackages
&& MatchesQuery(p.Entry, query));
}
}
public string PackageCountText => CoreTools.Translate("{0} packages found", Packages.Count);
public string EmptyMessage => CoreTools.Translate(_allPackages.Count > 0
? "No packages are available with the current filters."
: "This catalog contains no packages.");

public bool IsEmpty => !IsLoading && !HasError && Packages.Count == 0;

partial void OnIsLoadingChanged(bool value) => OnPropertyChanged(nameof(IsEmpty));
public string BackgroundText => HasError
? ErrorMessage
: !IsEmpty ? ""
: HasHiddenPackages
? CoreTools.Translate("Packages with unavailable sources are hidden. Change Filters to show them.")
: EmptyMessage;

public bool HasBackgroundText => BackgroundText.Length > 0;

partial void OnIsLoadingChanged(bool value)
{
OnPropertyChanged(nameof(IsEmpty));
NotifyBackgroundTextChanged();
}

private void NotifyBackgroundTextChanged()
{
OnPropertyChanged(nameof(BackgroundText));
OnPropertyChanged(nameof(HasBackgroundText));
}

partial void OnSelectedCatalogChanged(CatalogDefinition? value)
{
Expand All @@ -110,6 +147,7 @@ partial void OnSelectedCatalogChanged(CatalogDefinition? value)
}
UpdateStates();
OnPropertyChanged(nameof(IsEmpty));
NotifyBackgroundTextChanged();
}

[ObservableProperty]
Expand All @@ -124,6 +162,7 @@ partial void OnErrorMessageChanged(string value)
{
OnPropertyChanged(nameof(HasError));
OnPropertyChanged(nameof(IsEmpty));
NotifyBackgroundTextChanged();
if (value.Length > 0)
Avalonia.Infrastructure.AccessibilityAnnouncementService.Announce(
value, global::Avalonia.Automation.AutomationLiveSetting.Assertive);
Expand Down Expand Up @@ -333,7 +372,7 @@ internal void ApplyAvailabilityFilter()
OnPropertyChanged(nameof(HasHiddenPackages));
OnPropertyChanged(nameof(EmptyMessage));
OnPropertyChanged(nameof(IsEmpty));
OnPropertyChanged(nameof(PackageCountText));
NotifyBackgroundTextChanged();
}

private bool MatchesQuery(CatalogEntry entry, string query) => query.Length == 0 || SearchMode switch
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,38 +149,6 @@
<Setter Property="Background" Value="{DynamicResource SearchBoxFocusedBackground}"/>
<Setter Property="BorderBrush" Value="{DynamicResource SearchBoxFocusedBorderBrush}"/>
</Style>
<!-- The full splitter track is interactive. Its subtle rounded hover surface sits beneath
the persistent grip, matching WinUI's pane-resize affordance. -->
<Style Selector="GridSplitter.winui-vertical-splitter">
<Setter Property="Background" Value="Transparent"/>
<Setter Property="Transitions">
<Transitions>
<BrushTransition Property="Background" Duration="0:0:0.083"/>
</Transitions>
</Setter>
<Setter Property="Template">
<ControlTemplate>
<!-- Match the visible splitter track to the package-list container on the
right, whose outer card is inset 6 DIPs vertically. -->
<Border Background="{TemplateBinding Background}"
Margin="0,6"
CornerRadius="6">
<Border Width="4" Height="22"
CornerRadius="2"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Background="{DynamicResource TextFillColorTertiaryBrush}"
IsHitTestVisible="False"/>
</Border>
</ControlTemplate>
</Setter>
</Style>
<Style Selector="GridSplitter.winui-vertical-splitter:pointerover">
<Setter Property="Background" Value="{DynamicResource SubtleFillColorSecondaryBrush}"/>
</Style>
<Style Selector="GridSplitter.winui-vertical-splitter:pressed">
<Setter Property="Background" Value="{DynamicResource SubtleFillColorTertiaryBrush}"/>
</Style>
</UserControl.Styles>

<UserControl.Resources>
Expand Down
Loading
Loading