Skip to content

Commit 0bf4cac

Browse files
committedNov 26, 2024·
Merge remote-tracking branch 'origin/main' into docs-070
2 parents c1f6b4a + fee4ee5 commit 0bf4cac

15 files changed

+385
-71
lines changed
 

‎src/NexusMods.App.UI/NexusMods.App.UI.csproj

+9
Original file line numberDiff line numberDiff line change
@@ -710,6 +710,15 @@
710710
<Compile Update="Pages\Sorting\SortingSelection\SortingSelectionViewModel.cs">
711711
<DependentUpon>ISortingSelectionViewModel.cs</DependentUpon>
712712
</Compile>
713+
<Compile Update="Pages\Sorting\LoadOrder\LoadOrderViewDesignViewModel.cs">
714+
<DependentUpon>ILoadOrderViewModel.cs</DependentUpon>
715+
</Compile>
716+
<Compile Update="Pages\Sorting\SortingSelection\SortingSelectionDesignViewModel.cs">
717+
<DependentUpon>ISortingSelectionViewModel.cs</DependentUpon>
718+
</Compile>
719+
<Compile Update="Pages\Sorting\LoadOrder\LoadOrderItemDesignModel.cs">
720+
<DependentUpon>ILoadOrderItemModel.cs</DependentUpon>
721+
</Compile>
713722
</ItemGroup>
714723

715724
<ItemGroup>

‎src/NexusMods.App.UI/Pages/Sorting/LoadOrder/ILoadOrderItemModel.cs

-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ namespace NexusMods.App.UI.Pages.Sorting;
77

88
public interface ILoadOrderItemModel : ITreeDataGridItemModel<ILoadOrderItemModel, Guid>
99
{
10-
public ISortableItem InnerItem { get; }
1110
public ReactiveCommand<Unit, Unit> MoveUp { get; }
1211
public ReactiveCommand<Unit, Unit> MoveDown { get; }
1312
public int SortIndex { get; }

‎src/NexusMods.App.UI/Pages/Sorting/LoadOrder/ILoadOrderViewModel.cs

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using System.ComponentModel;
22
using System.Reactive;
33
using NexusMods.Abstractions.UI;
4+
using NexusMods.App.UI.Controls;
45
using ReactiveUI;
56

67
namespace NexusMods.App.UI.Pages.Sorting;
@@ -10,7 +11,7 @@ public interface ILoadOrderViewModel : IViewModelInterface
1011
/// <summary>
1112
/// TreeDataGridAdapter for the Load Order, for setting up the TreeDataGrid
1213
/// </summary>
13-
LoadOrderTreeDataGridAdapter Adapter { get; }
14+
TreeDataGridAdapter<ILoadOrderItemModel, Guid> Adapter { get; }
1415

1516
/// <summary>
1617
/// Name of this sort order type
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
using System.Reactive;
2+
using NexusMods.Abstractions.Games;
3+
using NexusMods.App.UI.Controls;
4+
using ReactiveUI;
5+
6+
namespace NexusMods.App.UI.Pages.Sorting;
7+
8+
public class LoadOrderItemDesignModel : TreeDataGridItemModel<ILoadOrderItemModel, Guid>, ILoadOrderItemModel
9+
{
10+
public ReactiveCommand<Unit, Unit> MoveUp { get; } = ReactiveCommand.Create(() => { });
11+
public ReactiveCommand<Unit, Unit> MoveDown { get; } = ReactiveCommand.Create(() => { });
12+
public int SortIndex { get; set; }
13+
public string DisplayName { get; set; } = "Display Name";
14+
public string ModName { get; set; } = "Mod Name";
15+
public bool IsActive { get; set; }
16+
public Guid Guid { get; set; }
17+
}

‎src/NexusMods.App.UI/Pages/Sorting/LoadOrder/LoadOrderView.axaml

+99-41
Original file line numberDiff line numberDiff line change
@@ -6,49 +6,107 @@
66
xmlns:controls="clr-namespace:NexusMods.App.UI.Controls"
77
xmlns:icons="clr-namespace:NexusMods.Icons;assembly=NexusMods.Icons"
88
xmlns:sorting="clr-namespace:NexusMods.App.UI.Pages.Sorting"
9+
xmlns:alerts="clr-namespace:NexusMods.App.UI.Controls.Alerts"
910
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
1011
x:Class="NexusMods.App.UI.Pages.Sorting.LoadOrderView">
11-
<StackPanel Orientation="Vertical">
12-
<TreeDataGrid x:Name="SortOrderTreeDataGrid"
13-
AutoDragDropRows="False"
14-
Margin="0,20"
15-
CanUserResizeColumns="True"
16-
CanUserSortColumns="False"
17-
ShowColumnHeaders="True"
18-
RowDrop="OnRowDrop">
19-
20-
<TreeDataGrid.Resources>
21-
22-
<DataTemplate x:Key="LoadOrderItemIndexColumnTemplate"
23-
DataType="sorting:ILoadOrderItemModel">
24-
<StackPanel Orientation="Horizontal">
25-
<TextBlock x:Name="ItemIndex"
26-
Text="{CompiledBinding SortIndex}" />
27-
<controls:StandardButton x:Name="UpButton"
28-
Command="{CompiledBinding MoveDown}"
29-
LeftIcon="{x:Static icons:IconValues.ArrowUp}"
30-
ShowIcon="Left"
31-
Text="" />
32-
<controls:StandardButton x:Name="DownButton"
33-
Command="{CompiledBinding MoveUp}"
34-
LeftIcon="{x:Static icons:IconValues.ArrowDown}"
35-
ShowIcon="Left"
36-
Text="" />
37-
</StackPanel>
38-
</DataTemplate>
39-
40-
<DataTemplate x:Key="LoadOrderItemNameColumnTemplate"
41-
DataType="sorting:ILoadOrderItemModel">
42-
<StackPanel Orientation="Horizontal">
43-
<TextBlock x:Name="ItemName"
44-
Text="{CompiledBinding DisplayName}" />
45-
</StackPanel>
46-
</DataTemplate>
47-
48-
</TreeDataGrid.Resources>
49-
50-
</TreeDataGrid>
12+
<Design.DataContext>
13+
<sorting:LoadOrderDesignViewModel />
14+
</Design.DataContext>
15+
16+
<Grid RowDefinitions="Auto, *">
17+
<!-- <Border Background="Red"> -->
18+
<!-- <TextBlock Text="{Binding SortOrderName}"/> -->
19+
<!-- </Border> -->
20+
21+
<StackPanel Spacing="24"
22+
Grid.Row="0">
23+
<alerts:Alert
24+
Severity="Info"
25+
Title="Load Order for REDmod files in Cyberpunk 2077 - First Loaded Wins"
26+
Body="Some Cyberpunk 2077 mods use REDmod files to alter core gameplay elements. If two REDmod files modify the same part of the game, the one loaded first will take priority and overwrite changes from those loaded later.\n\nFor example, the 1st position overwrites the 2nd, the 2nd overwrites the 3rd, and so on."
27+
IsVisible="True"
28+
ShowDismiss="False" />
29+
30+
<TextBlock Grid.Row="1" Text="Last Loaded REDmod File Wins"
31+
Theme="{StaticResource HeadingXSSemiTheme}" />
32+
</StackPanel>
5133

52-
</StackPanel>
34+
35+
<Grid Grid.Row="1" ColumnDefinitions="50, *" Margin="0,24,0,0">
36+
37+
<Grid RowDefinitions="24, 8, *, 8, 24" Margin="0,60,0,0">
38+
<icons:UnifiedIcon Grid.Row="0" Value="{x:Static icons:IconValues.Trophy}" />
39+
<Border Grid.Row="2" Width="5">
40+
<Border.Background>
41+
<LinearGradientBrush StartPoint="0%,0%" EndPoint="0%,100%">
42+
<GradientStop Color="#FFFFFFFF" Offset="0" />
43+
<GradientStop Color="#32FFFFFF" Offset="1" />
44+
</LinearGradientBrush>
45+
</Border.Background>
46+
</Border>
47+
<icons:UnifiedIcon Grid.Row="4" Value="{x:Static icons:IconValues.ArrowDown}" Foreground="#32FFFFFF" />
48+
</Grid>
49+
50+
<TreeDataGrid Grid.Column="1" x:Name="SortOrderTreeDataGrid"
51+
AutoDragDropRows="False"
52+
CanUserResizeColumns="True"
53+
CanUserSortColumns="False"
54+
ShowColumnHeaders="True"
55+
RowDrop="OnRowDrop">
56+
57+
<TreeDataGrid.Resources>
58+
59+
<DataTemplate x:Key="LoadOrderItemIndexColumnTemplate"
60+
DataType="sorting:ILoadOrderItemModel">
61+
62+
<StackPanel Orientation="Horizontal" Spacing="12">
63+
<controls:StandardButton x:Name="UpButton"
64+
Command="{CompiledBinding MoveDown}"
65+
LeftIcon="{x:Static icons:IconValues.ArrowUp}"
66+
ShowIcon="IconOnly"
67+
Size="Medium"
68+
Type="Tertiary"
69+
Fill="None" />
70+
<Border
71+
Background="{StaticResource SurfaceLowBrush}"
72+
BorderThickness="1"
73+
BorderBrush="{StaticResource StrokeTranslucentSubduedBrush}"
74+
CornerRadius="4"
75+
Width="52"
76+
Height="42">
77+
<TextBlock x:Name="ItemIndex"
78+
Text="{CompiledBinding SortIndex}"
79+
Foreground="{StaticResource NeutralTranslucentStrongBrush}"
80+
Theme="{StaticResource BodyMDBoldTheme}"
81+
HorizontalAlignment="Center" />
82+
</Border>
83+
<controls:StandardButton x:Name="DownButton"
84+
Command="{CompiledBinding MoveUp}"
85+
LeftIcon="{x:Static icons:IconValues.ArrowDown}"
86+
ShowIcon="IconOnly"
87+
Size="Medium"
88+
Type="Tertiary"
89+
Fill="None" />
90+
<Border
91+
Background="{StaticResource SurfaceTranslucentMidBrush}"
92+
Width="1"
93+
Height="42"/>
94+
</StackPanel>
95+
</DataTemplate>
96+
97+
<DataTemplate x:Key="LoadOrderItemNameColumnTemplate"
98+
DataType="sorting:ILoadOrderItemModel">
99+
<StackPanel Orientation="Horizontal">
100+
<TextBlock x:Name="ItemName"
101+
Text="{CompiledBinding DisplayName}" />
102+
</StackPanel>
103+
</DataTemplate>
104+
105+
</TreeDataGrid.Resources>
106+
107+
</TreeDataGrid>
108+
</Grid>
109+
110+
</Grid>
53111

54112
</reactiveUi:ReactiveUserControl>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
using System.Collections.ObjectModel;
2+
using System.ComponentModel;
3+
using System.Diagnostics;
4+
using System.Reactive;
5+
using System.Reactive.Disposables;
6+
using Avalonia.Controls.Models.TreeDataGrid;
7+
using DynamicData;
8+
using DynamicData.Binding;
9+
using NexusMods.Abstractions.UI;
10+
using NexusMods.App.UI.Controls;
11+
using ReactiveUI;
12+
13+
namespace NexusMods.App.UI.Pages.Sorting;
14+
15+
public class LoadOrderDesignViewModel : AViewModel<ILoadOrderViewModel>, ILoadOrderViewModel
16+
{
17+
public TreeDataGridAdapter<ILoadOrderItemModel, Guid> Adapter { get; set; }
18+
public string SortOrderName { get; set; } = "Sort Order Name";
19+
public string InfoAlertTitle { get; set;} = "Info Alert Title";
20+
public string InfoAlertHeading { get; set;} = "Info Alert Heading";
21+
public string InfoAlertMessage { get; set;} = "Info Alert Message";
22+
public bool InfoAlertIsVisible { get; set; } = true;
23+
public ReactiveCommand<Unit, Unit> InfoAlertCommand { get; } = ReactiveCommand.Create(() => { Console.WriteLine("InfoAlertCommand"); });
24+
public string TrophyToolTip { get; set;} = "Trophy Tool Tip";
25+
public ListSortDirection SortDirectionCurrent { get; set; }
26+
public bool IsWinnerTop { get; set;}
27+
public string EmptyStateMessageTitle { get; } = "Empty State Message Title";
28+
public string EmptyStateMessageContents { get; } = "Empty State Message Contents";
29+
30+
public LoadOrderDesignViewModel()
31+
{
32+
Adapter = new LoadOrderTreeDataGridDesignAdapter();
33+
34+
this.WhenActivated(d =>
35+
{
36+
Adapter.Activate();
37+
Disposable.Create(() => Adapter.Deactivate())
38+
.DisposeWith(d);
39+
}
40+
);
41+
}
42+
}
43+
44+
45+
// adapter used for design view, based on the actual adapter LoadOrderViewModel.LoadOrderTreeDataGridAdapter
46+
public class LoadOrderTreeDataGridDesignAdapter : TreeDataGridAdapter<ILoadOrderItemModel, Guid>
47+
{
48+
protected override IObservable<IChangeSet<ILoadOrderItemModel, Guid>> GetRootsObservable(bool viewHierarchical)
49+
{
50+
var items = new ObservableCollection<ILoadOrderItemModel>([
51+
new LoadOrderItemDesignModel() { DisplayName = "Item 1", Guid = Guid.NewGuid(), SortIndex = 0 },
52+
new LoadOrderItemDesignModel() { DisplayName = "Item 2", Guid = Guid.NewGuid(), SortIndex = 1 },
53+
]
54+
);
55+
56+
return items.ToObservableChangeSet(item => ((LoadOrderItemDesignModel)item).Guid);
57+
}
58+
59+
protected override IColumn<ILoadOrderItemModel>[] CreateColumns(bool viewHierarchical)
60+
{
61+
return
62+
[
63+
// TODO: Use <see cref="ColumnCreator"/> to create the columns using interfaces
64+
new HierarchicalExpanderColumn<ILoadOrderItemModel>(
65+
inner: LoadOrderTreeDataGridAdapter.CreateIndexColumn("Index"),
66+
childSelector: static model => model.Children,
67+
hasChildrenSelector: static model => model.HasChildren.Value,
68+
isExpandedSelector: static model => model.IsExpanded
69+
)
70+
{
71+
Tag = "expander",
72+
},
73+
LoadOrderTreeDataGridAdapter.CreateNameColumn("Name"),
74+
];
75+
}
76+
}

‎src/NexusMods.App.UI/Pages/Sorting/LoadOrder/LoadOrderViewModel.cs

+6-6
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public class LoadOrderViewModel : AViewModel<ILoadOrderViewModel>, ILoadOrderVie
2727
public string EmptyStateMessageTitle { get; }
2828
public string EmptyStateMessageContents { get; }
2929

30-
public LoadOrderTreeDataGridAdapter Adapter { get; }
30+
public TreeDataGridAdapter<ILoadOrderItemModel, Guid> Adapter { get; }
3131

3232
public LoadOrderViewModel(LoadoutId loadoutId, ISortableItemProviderFactory itemProviderFactory)
3333
{
@@ -89,37 +89,37 @@ protected override IColumn<ILoadOrderItemModel>[] CreateColumns(bool viewHierarc
8989
isExpandedSelector: static model => model.IsExpanded
9090
)
9191
{
92-
Tag = "expander",
92+
Tag = "expander",
9393
},
9494
CreateNameColumn(_sortableItemsProvider.ParentFactory.NameColumnHeader),
9595
];
9696
}
9797

98-
private static IColumn<ILoadOrderItemModel> CreateIndexColumn(string headerName)
98+
internal static IColumn<ILoadOrderItemModel> CreateIndexColumn(string headerName)
9999
{
100100
return new CustomTemplateColumn<ILoadOrderItemModel>(
101101
header: headerName,
102102
cellTemplateResourceKey: "LoadOrderItemIndexColumnTemplate",
103103
options: new TemplateColumnOptions<ILoadOrderItemModel>
104104
{
105105
CanUserSortColumn = false,
106-
CanUserResizeColumn = true,
106+
CanUserResizeColumn = false,
107107
}
108108
)
109109
{
110110
Id = "Index",
111111
};
112112
}
113113

114-
private static IColumn<ILoadOrderItemModel> CreateNameColumn(string headerName)
114+
internal static IColumn<ILoadOrderItemModel> CreateNameColumn(string headerName)
115115
{
116116
return new CustomTemplateColumn<ILoadOrderItemModel>(
117117
header: headerName,
118118
cellTemplateResourceKey: "LoadOrderItemNameColumnTemplate",
119119
options: new TemplateColumnOptions<ILoadOrderItemModel>
120120
{
121121
CanUserSortColumn = false,
122-
CanUserResizeColumn = true,
122+
CanUserResizeColumn = false,
123123
}
124124
)
125125
{
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
using System.Collections.ObjectModel;
2+
using NexusMods.Abstractions.UI;
3+
4+
namespace NexusMods.App.UI.Pages.Sorting;
5+
6+
public class SortingSelectionDesignViewModel : AViewModel<ISortingSelectionViewModel>, ISortingSelectionViewModel
7+
{
8+
public ReadOnlyObservableCollection<ILoadOrderViewModel> LoadOrderViewModels { get; }
9+
10+
public SortingSelectionDesignViewModel()
11+
{
12+
var loadOrderViewModels = new ObservableCollection<ILoadOrderViewModel>
13+
{
14+
new LoadOrderDesignViewModel { SortOrderName = "Load order (RedMOD)",
15+
InfoAlertHeading = "Load Order for REDmod files in Cyberpunk 2077 - First Loaded Wins",
16+
InfoAlertMessage = "Some Cyberpunk 2077 mods use REDmod files to alter core gameplay elements. If two REDmod files modify the same part of the game, the one loaded first will take priority and overwrite changes from those loaded later.\n\nFor example, the 1st position overwrites the 2nd, the 2nd overwrites the 3rd, and so on."
17+
},
18+
new LoadOrderDesignViewModel { SortOrderName = "Load Order (Archive XL)" },
19+
new LoadOrderDesignViewModel { SortOrderName = "File Overwrites" }
20+
};
21+
22+
LoadOrderViewModels = new ReadOnlyObservableCollection<ILoadOrderViewModel>(loadOrderViewModels);
23+
}
24+
}

‎src/NexusMods.App.UI/Pages/Sorting/SortingSelection/SortingSelectionView.axaml

+22-12
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,29 @@
66
xmlns:sorting="clr-namespace:NexusMods.App.UI.Pages.Sorting"
77
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
88
x:Class="NexusMods.App.UI.Pages.Sorting.SortingSelectionView">
9-
<TabControl x:Name="SortOrdersTabControl">
10-
<TabControl.ItemTemplate>
11-
<DataTemplate DataType="sorting:ILoadOrderViewModel">
12-
<TextBlock Text="{CompiledBinding SortOrderName}" />
13-
</DataTemplate>
14-
</TabControl.ItemTemplate>
9+
10+
<Design.DataContext>
11+
<sorting:SortingSelectionDesignViewModel />
12+
</Design.DataContext>
13+
14+
<TabControl x:Name="SortOrdersTabControl" Classes="Subtabs">
15+
16+
<TabControl.ItemTemplate>
17+
<DataTemplate DataType="sorting:ILoadOrderViewModel">
18+
<StackPanel Orientation="Horizontal">
19+
<TextBlock Text="{CompiledBinding SortOrderName}" />
20+
</StackPanel>
21+
</DataTemplate>
22+
</TabControl.ItemTemplate>
1523

16-
<TabControl.ContentTemplate>
17-
<DataTemplate DataType="sorting:ILoadOrderViewModel">
18-
<sorting:LoadOrderView ViewModel="{CompiledBinding}" />
19-
</DataTemplate>
20-
</TabControl.ContentTemplate>
24+
<TabControl.ContentTemplate>
25+
<DataTemplate DataType="sorting:ILoadOrderViewModel">
26+
<sorting:LoadOrderView ViewModel="{CompiledBinding}" />
27+
</DataTemplate>
28+
</TabControl.ContentTemplate>
2129

22-
</TabControl>
30+
</TabControl>
31+
32+
2333
</reactiveUi:ReactiveUserControl>
2434

‎src/NexusMods.Icons/IconValues.cs

+3
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,9 @@ public static class IconValues
324324
// https://pictogrammers.com/library/mdi/icon/lightbulb/
325325
public static readonly IconValue Lightbulb = new ProjektankerIcon("mdi-lightbulb");
326326

327+
// https://pictogrammers.com/library/mdi/icon/trophy/
328+
public static readonly IconValue Trophy = new ProjektankerIcon("mdi-trophy");
329+
327330
#endregion
328331

329332
#region Social

‎src/Themes/NexusMods.Themes.NexusFluentDark/Styles/Controls/Icons/IconsStyles.axaml

+3
Original file line numberDiff line numberDiff line change
@@ -517,5 +517,8 @@
517517
</Style>
518518
<Style Selector="icons|UnifiedIcon.CheckCircleOutline">
519519
<Setter Property="Value" Value="{x:Static icons:IconValues.CheckCircleOutline}"/>
520+
</Style>
521+
<Style Selector="icons|UnifiedIcon.Trophy">
522+
<Setter Property="Value" Value="{x:Static icons:IconValues.Trophy}"/>
520523
</Style>
521524
</Styles>

‎src/Themes/NexusMods.Themes.NexusFluentDark/Styles/Controls/TabControl/TabControlStyles.axaml

+44-5
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,17 @@
1818
</TabItem>
1919
<TabItem>
2020
<TabItem.Header>
21-
<StackPanel x:Name="OptionalModsPanel" Orientation="Horizontal">
21+
<StackPanel Orientation="Horizontal">
2222
<TextBlock Text="Optional" />
2323
<Border>
24-
<TextBlock x:Name="OptionalDownloadsCount" Text="123" />
24+
<TextBlock Text="123" />
2525
</Border>
2626
</StackPanel>
2727
</TabItem.Header>
2828
<TextBlock Text="Content for Tab 4" />
2929
</TabItem>
3030
</TabControl>
31+
3132
<TextBlock Text="TabControl (Subtabs)" />
3233
<TabControl Classes="Subtabs">
3334
<TabItem Header="Tab 1">
@@ -39,6 +40,21 @@
3940
<TabItem Header="Tab 3">
4041
<TextBlock Text="Content for Tab 3" />
4142
</TabItem>
43+
<TabItem>
44+
<TabItem.Header>
45+
<StackPanel Orientation="Horizontal">
46+
<TextBlock Text="Optional" />
47+
</StackPanel>
48+
</TabItem.Header>
49+
<TextBlock Text="Content for Tab 4" />
50+
</TabItem>
51+
</TabControl>
52+
53+
<TextBlock Text="TabControl (Subtabs, Single item)" />
54+
<TabControl Classes="Subtabs">
55+
<TabItem Header="Tab 1">
56+
<TextBlock Text="Content for Tab 1" />
57+
</TabItem>
4258
</TabControl>
4359
</StackPanel>
4460
</Border>
@@ -133,16 +149,27 @@
133149
<!-- subtabs -->
134150

135151
<Style Selector="^.Subtabs">
152+
153+
<Style Selector="^ ItemsPresenter#PART_ItemsPresenter">
154+
<Setter Property="Margin" Value="8,8,8,0" />
155+
</Style>
136156

137-
<!-- <Setter Property="Padding" Value="0,24,0,12" /> -->
138157

139158
<Style Selector="^ TabItem">
140-
<Setter Property="Padding" Value="12,0,12,0" />
159+
<Setter Property="Padding" Value="12,0" />
141160
<Setter Property="BorderThickness" Value="1" />
142161
<Setter Property="BorderBrush" Value="{StaticResource StrokeTranslucentModerateBrush}" />
143162
<Setter Property="CornerRadius" Value="0" />
144163
<Setter Property="MinHeight" Value="28" />
145164
<Setter Property="Foreground" Value="{StaticResource NeutralSubduedBrush}" />
165+
166+
<!-- this is our primary way with custom header -->
167+
<Style Selector="^ > StackPanel">
168+
<Setter Property="Spacing" Value="{StaticResource Spacing-1}" />
169+
<Style Selector="^ > TextBlock">
170+
<Setter Property="Theme" Value="{StaticResource BodyMDNormalTheme}" />
171+
</Style>
172+
</Style>
146173

147174
<!-- hide the underline element -->
148175
<Style Selector="^[TabStripPlacement=Top] /template/ Border#PART_SelectedPipe">
@@ -163,7 +190,12 @@
163190
<Style Selector="^:nth-last-child(1)">
164191
<Setter Property="CornerRadius" Value="0,4,4,0" />
165192
</Style>
166-
193+
194+
<!-- both first and last child (single item, rounded all corners) -->
195+
<Style Selector="^:nth-child(1):nth-last-child(1)">
196+
<Setter Property="CornerRadius" Value="4" />
197+
</Style>
198+
167199
<!-- selected state -->
168200
<!-- We don't use selector to PART_LayoutRoot, so developer can override selected item background with TabStripItem.Background -->
169201
<Style Selector="^:selected">
@@ -173,6 +205,13 @@
173205
<Style Selector="^ /template/ Border#PART_LayoutRoot">
174206
<Setter Property="TextElement.Foreground" Value="{StaticResource NeutralInvertedBrush}" />
175207
</Style>
208+
209+
<Style Selector="^ > StackPanel">
210+
<Setter Property="Spacing" Value="{StaticResource Spacing-1}" />
211+
<Style Selector="^ > TextBlock">
212+
<Setter Property="Foreground" Value="{StaticResource NeutralInvertedBrush}" />
213+
</Style>
214+
</Style>
176215
</Style>
177216

178217
<!-- pointerover tabs -->
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
<Styles xmlns="https://github.com/avaloniaui"
2+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
3+
<Design.PreviewWith>
4+
<Border Padding="16">
5+
<TreeDataGrid x:Name="SortOrderTreeDataGrid" Width="400" Height="200" />
6+
</Border>
7+
</Design.PreviewWith>
8+
9+
<Style Selector="TreeDataGrid#SortOrderTreeDataGrid">
10+
11+
<Setter Property="Background" Value="{x:Null}" />
12+
13+
<Style Selector="^ TreeDataGridRow">
14+
<Setter Property="Background" Value="{StaticResource SurfaceMidBrush}" />
15+
<Setter Property="Height" Value="62" />
16+
<Setter Property="Margin" Value="0,0,0,8" />
17+
<Setter Property="BorderBrush" Value="{StaticResource SurfaceTransparentBrush}" />
18+
<Setter Property="BorderThickness" Value="2" />
19+
<Setter Property="CornerRadius" Value="8" />
20+
21+
<Style Selector="^ > Border">
22+
<Setter Property="BoxShadow" Value="{StaticResource DropShadowXS}" />
23+
</Style>
24+
25+
<Style Selector="^:pointerover">
26+
<Setter Property="Background" Value="{StaticResource SurfaceHighBrush}" />
27+
</Style>
28+
29+
<Style Selector="^:selected">
30+
<Setter Property="Background" Value="{StaticResource SurfaceMidBrush}" />
31+
<Setter Property="BorderBrush" Value="{StaticResource StrokeTranslucentModerateBrush}" />
32+
</Style>
33+
34+
<!-- all rows are root row at the moment and this is overriding the Background above -->
35+
<Style Selector="^.RootRow">
36+
<Setter Property="Background" Value="{StaticResource SurfaceMidBrush}" />
37+
</Style>
38+
</Style>
39+
40+
<Style Selector="^ /template/ ScrollViewer#PART_ScrollViewer">
41+
<!-- <Setter Property="Background" Value="ForestGreen" /> -->
42+
<Setter Property="Padding" Value="0,8,0,0" />
43+
</Style>
44+
45+
<Style Selector="^ TreeDataGridColumnHeader">
46+
47+
<Setter Property="HorizontalAlignment" Value="Stretch" />
48+
49+
<!-- <Style Selector="^ /template/ Thumb#PART_Resizer"> -->
50+
<!-- <Setter Property="IsVisible" Value="False" /> -->
51+
<!-- </Style> -->
52+
53+
<!-- <Style Selector="^ /template/ DockPanel#DataGridDockPanel"> -->
54+
<!-- <Setter Property="HorizontalAlignment" Value="Right" /> -->
55+
<!-- </Style> -->
56+
57+
</Style>
58+
59+
60+
<Style Selector="^ TreeDataGridExpanderCell">
61+
<!-- <Setter Property="Padding" Value="0" /> -->
62+
<!-- <Setter Property="Margin" Value="0" /> -->
63+
<!-- <Setter Property="Background" Value="DarkSlateGray" /> -->
64+
</Style>
65+
66+
<Style Selector="^ TreeDataGridTemplateCell.Name">
67+
<!-- <Setter Property="Padding" Value="0" /> -->
68+
<!-- <Setter Property="Margin" Value="0" /> -->
69+
<!-- <Setter Property="Background" Value="DarkSlateBlue" /> -->
70+
<!-- <Setter Property="HorizontalAlignment" Value="Left" /> -->
71+
</Style>
72+
73+
</Style>
74+
</Styles>

‎src/Themes/NexusMods.Themes.NexusFluentDark/Styles/Controls/TreeDataGrid/TreeDataGridStyles.axaml

+5-5
Original file line numberDiff line numberDiff line change
@@ -194,9 +194,9 @@
194194

195195
<!-- last column header -->
196196
<Style Selector="^:nth-last-child(1)">
197-
<Style Selector="^ /template/ DockPanel#DataGridDockPanel">
198-
<Setter Property="HorizontalAlignment" Value="Right" />
199-
</Style>
197+
<!-- <Style Selector="^ /template/ DockPanel#DataGridDockPanel"> -->
198+
<!-- <Setter Property="HorizontalAlignment" Value="Right" /> -->
199+
<!-- </Style> -->
200200
</Style>
201201
</Style>
202202

@@ -283,7 +283,7 @@
283283
<!-- "RootRow" is a class that was manually added to the TreeDataGridRow that have indent level 0. -->
284284
<!-- See `NexusMods.App.UI.Controls.CustomElementFactory.cs` for more information. -->
285285
<Style Selector="^.RootRow">
286-
<Setter Property="ZIndex" Value="100" />
286+
<!-- <Setter Property="ZIndex" Value="100" /> -->
287287
<Setter Property="Background" Value="{StaticResource SurfaceLowBrush}" />
288288

289289
<!-- <Style Selector="^ Border#RowBorder"> -->
@@ -376,7 +376,7 @@
376376

377377
<Style Selector="TreeDataGrid#ModFilesTreeDataGrid">
378378
<Style Selector="^ icons|UnifiedIcon">
379-
<Setter Property="Foreground" Value="{StaticResource NeutralModerateBrush}"></Setter>
379+
<Setter Property="Foreground" Value="{StaticResource NeutralModerateBrush}"/>
380380
</Style>
381381
</Style>
382382

‎src/Themes/NexusMods.Themes.NexusFluentDark/Styles/StylesIndex.axaml

+1
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
<StyleInclude Source="/Styles/Controls/Menu/MenuItemStyles.axaml"/>
3131
<StyleInclude Source="/Styles/Controls/FlexPanel/FlexPanelStyles.axaml"/>
3232
<StyleInclude Source="/Styles/Controls/TabControl/TabControlStyles.axaml"/>
33+
<StyleInclude Source="/Styles/Controls/TreeDataGrid/SortOrderStyles.axaml"/>
3334

3435
<StyleInclude Source="/Styles/UserControls/CollectionDownloadPage/CollectionDownloadPageStyles.axaml"/>
3536
<StyleInclude Source="/Styles/UserControls/CollectionCards/CollectionCardStyles.axaml"/>

0 commit comments

Comments
 (0)
Please sign in to comment.