Fix mod list style, remove management buttons

This commit is contained in:
Yoshi Askharoun
2024-05-13 12:19:21 -05:00
parent 6d6cb25448
commit 58bbc61619
2 changed files with 26 additions and 67 deletions
+25 -37
View File
@@ -3,43 +3,45 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mah="http://metro.mahapps.com/winfx/xaml/controls"
xmlns:core="clr-namespace:ZuneModCore;assembly=ZuneModCore" xmlns:core="clr-namespace:ZuneModCore;assembly=ZuneModCore"
xmlns:b="clr-namespace:ZuneModdingHelper.Behaviors" xmlns:b="clr-namespace:ZuneModdingHelper.Behaviors"
xmlns:i="http://schemas.microsoft.com/xaml/behaviors" xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
xmlns:local="clr-namespace:ZuneModdingHelper.Pages" xmlns:local="clr-namespace:ZuneModdingHelper.Pages"
mc:Ignorable="d" mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800"> d:DesignHeight="450" d:DesignWidth="800">
<UserControl.Resources>
<Style x:Key="ZuneListViewItemContainerStyle" TargetType="{x:Type ListViewItem}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ListViewItem}">
<Border x:Name="ItemBorder">
<ContentPresenter/>
</Border>
<ListView x:Name="ModList" HorizontalContentAlignment="Stretch" BorderThickness="0" <ControlTemplate.Triggers>
ScrollViewer.HorizontalScrollBarVisibility="Disabled"> <Trigger Property="IsSelected" Value="True">
<ListView.Resources> <Setter TargetName="ItemBorder" Property="Background" Value="#D8D8D8" />
<Style x:Key="MetroButton" TargetType="Button" BasedOn="{StaticResource &#220;}"> </Trigger>
<Setter Property="VerticalAlignment" Value="Center"/> <Trigger Property="IsMouseOver" Value="True">
<Setter Property="Margin" Value="8,0,0,0"/> <Setter TargetName="ItemBorder" Property="Background" Value="#E8E8E8" />
<Setter Property="Grid.RowSpan" Value="3"/> </Trigger>
</Style> </ControlTemplate.Triggers>
<Style x:Key="MetroAccentButton" TargetType="Button" BasedOn="{StaticResource &#220;}"> </ControlTemplate>
<Setter Property="VerticalAlignment" Value="Center"/> </Setter.Value>
<Setter Property="Margin" Value="8,0,0,0"/> </Setter>
<Setter Property="Grid.RowSpan" Value="3"/> </Style>
</Style> </UserControl.Resources>
</ListView.Resources>
<ListView ItemContainerStyle="{DynamicResource ZuneListViewItemContainerStyle}" Style="{DynamicResource ZuneListViewStyle}" x:Name="ModList" HorizontalContentAlignment="Stretch" BorderThickness="0"
ScrollViewer.HorizontalScrollBarVisibility="Disabled" d:ItemsSource="{d:SampleData ItemCount=5}">
<ListView.ItemTemplate> <ListView.ItemTemplate>
<DataTemplate DataType="{x:Type core:Mod}"> <DataTemplate DataType="{x:Type core:Mod}">
<Border BorderThickness="0" Padding="8"> <Border x:Name="RootBorder" BorderThickness="0">
<Grid> <Grid Margin="8">
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition Height="Auto"/> <RowDefinition Height="Auto"/>
<RowDefinition Height="*"/> <RowDefinition Height="*"/>
</Grid.RowDefinitions> </Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<TextBlock TextTrimming="CharacterEllipsis"> <TextBlock TextTrimming="CharacterEllipsis">
<Run Text="{Binding Title, Mode=OneWay}" FontWeight="SemiBold" FontSize="16"/> <Run Text="{Binding Title, Mode=OneWay}" FontWeight="SemiBold" FontSize="16"/>
@@ -47,20 +49,6 @@
</TextBlock> </TextBlock>
<TextBlock Text="{Binding Description}" Grid.Row="1" <TextBlock Text="{Binding Description}" Grid.Row="1"
FontSize="14" TextWrapping="Wrap"/> FontSize="14" TextWrapping="Wrap"/>
<Button x:Name="ModResetButton" Grid.Column="1" Click="ModResetButton_Click" ToolTip="Reset"
Style="{StaticResource OverlayButtonStyle}">
<Viewbox Width="12" Height="12">
<Path Fill="White" Data="F1 M 18.085938 3.085938 L 11.181641 10 L 18.085938 16.914062 L 16.914062 18.085938 L 10 11.181641 L 3.085938 18.085938 L 1.914062 16.914062 L 8.818359 10 L 1.914062 3.085938 L 3.085938 1.914062 L 10 8.818359 L 16.914062 1.914062 Z"/>
</Viewbox>
</Button>
<Button x:Name="ModInstallButton" Grid.Column="2" Click="ModInstallButton_Click" ToolTip="Install"
Style="{StaticResource OverlayButtonStyle}">
<Viewbox Width="12" Height="12">
<Path Fill="White" Data="F1 M 18.574219 1.914062 L 19.755859 3.085938 L 6.669922 16.181641 L 0.244141 9.755859 L 1.425781 8.574219 L 6.669922 13.818359 Z"/>
</Viewbox>
</Button>
</Grid> </Grid>
</Border> </Border>
</DataTemplate> </DataTemplate>
+1 -30
View File
@@ -1,19 +1,4 @@
using Microsoft.AppCenter.Analytics; using System.Windows.Controls;
using OwlCore.AbstractUI.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using ZuneModCore; using ZuneModCore;
namespace ZuneModdingHelper.Pages namespace ZuneModdingHelper.Pages
@@ -28,19 +13,5 @@ namespace ZuneModdingHelper.Pages
InitializeComponent(); InitializeComponent();
ModList.ItemsSource = Mod.AvailableMods; ModList.ItemsSource = Mod.AvailableMods;
} }
private async void ModInstallButton_Click(object sender, RoutedEventArgs e)
{
if (sender is FrameworkElement elem && elem.DataContext is Mod mod)
{
}
}
private async void ModResetButton_Click(object sender, RoutedEventArgs e)
{
if (sender is FrameworkElement elem && elem.DataContext is Mod mod)
{
}
}
} }
} }