feat: entirely remove accessoryicon component
This commit is contained in:
@@ -6,10 +6,9 @@
|
||||
<Application.Resources>
|
||||
<ResourceDictionary>
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<ResourceDictionary Source="/Frontend/Styles/AccessoryIconControl.xaml"/>
|
||||
<ResourceDictionary Source="/Frontend/Styles/GenericButton.xaml"/>
|
||||
<ResourceDictionary Source="/Frontend/Styles/TextboxErrorTemplate.xaml"/>
|
||||
<ResourceDictionary Source="/Frontend/Widgets/IconButton.xaml"/>
|
||||
<ResourceDictionary Source="/Frontend/Widgets/IconGroupBox.xaml"/>
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
</ResourceDictionary>
|
||||
</Application.Resources>
|
||||
|
||||
@@ -1,51 +0,0 @@
|
||||
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.Media;
|
||||
|
||||
namespace BallanceTasEditor.Frontend.Styles {
|
||||
|
||||
public class AccessoryIcon {
|
||||
public static ImageSource GetIcon(DependencyObject obj) {
|
||||
return (ImageSource)obj.GetValue(IconProperty);
|
||||
}
|
||||
|
||||
public static void SetIcon(DependencyObject obj, ImageSource value) {
|
||||
obj.SetValue(IconProperty, value);
|
||||
}
|
||||
|
||||
// Using a DependencyProperty as the backing store for Icon. This enables animation, styling, binding, etc...
|
||||
public static readonly DependencyProperty IconProperty =
|
||||
DependencyProperty.RegisterAttached("Icon", typeof(ImageSource), typeof(AccessoryIcon), new PropertyMetadata(null));
|
||||
|
||||
public static double GetIconWidth(DependencyObject obj) {
|
||||
return (double)obj.GetValue(IconWidthProperty);
|
||||
}
|
||||
|
||||
public static void SetIconWidth(DependencyObject obj, double value) {
|
||||
obj.SetValue(IconWidthProperty, value);
|
||||
}
|
||||
|
||||
// Using a DependencyProperty as the backing store for IconWidth. This enables animation, styling, binding, etc...
|
||||
public static readonly DependencyProperty IconWidthProperty =
|
||||
DependencyProperty.RegisterAttached("IconWidth", typeof(double), typeof(AccessoryIcon), new PropertyMetadata(0.0));
|
||||
|
||||
public static double GetIconHeight(DependencyObject obj) {
|
||||
return (double)obj.GetValue(IconHeightProperty);
|
||||
}
|
||||
|
||||
public static void SetIconHeight(DependencyObject obj, double value) {
|
||||
obj.SetValue(IconHeightProperty, value);
|
||||
}
|
||||
|
||||
// Using a DependencyProperty as the backing store for IconHeight. This enables animation, styling, binding, etc...
|
||||
public static readonly DependencyProperty IconHeightProperty =
|
||||
DependencyProperty.RegisterAttached("IconHeight", typeof(double), typeof(AccessoryIcon), new PropertyMetadata(0.0));
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="clr-namespace:BallanceTasEditor.Frontend.Styles">
|
||||
<DataTemplate x:Key="AccessoryIconDataTemplate">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<Image Source="{Binding Path=(local:AccessoryIcon.Icon), RelativeSource={RelativeSource AncestorType=Control, AncestorLevel=1}}"
|
||||
Width="16" Height="16" RenderOptions.BitmapScalingMode="HighQuality"/>
|
||||
<ContentControl Content="{Binding}" Margin="5,0,0,0" VerticalAlignment="Center"/>
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
|
||||
<Style x:Key="AccessoryIconButton" TargetType="Button" BasedOn="{StaticResource {x:Type Button}}">
|
||||
<Setter Property="ContentTemplate" Value="{StaticResource AccessoryIconDataTemplate}"/>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="AccessoryIconGroupBox" TargetType="GroupBox" BasedOn="{StaticResource {x:Type GroupBox}}">
|
||||
<Setter Property="HeaderTemplate" Value="{StaticResource AccessoryIconDataTemplate}"/>
|
||||
</Style>
|
||||
</ResourceDictionary>
|
||||
@@ -1,35 +0,0 @@
|
||||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<Style x:Key="OkButtonStyle" TargetType="Button" BasedOn="{StaticResource {x:Type Button}}">
|
||||
<Setter Property="Padding" Value="5"/>
|
||||
<Setter Property="Margin" Value="5"/>
|
||||
<Setter Property="MinWidth" Value="80"/>
|
||||
<Setter Property="ContentTemplate">
|
||||
<Setter.Value>
|
||||
<DataTemplate>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<Image Source="/Frontend/Assets/Ok.ico" RenderOptions.BitmapScalingMode="HighQuality"
|
||||
Width="16" Height="16" VerticalAlignment="Center"/>
|
||||
<ContentControl Content="{Binding}" Margin="5,0,0,0" VerticalAlignment="Center"/>
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
<Style x:Key="CancelButtonStyle" TargetType="Button" BasedOn="{StaticResource {x:Type Button}}">
|
||||
<Setter Property="Padding" Value="5"/>
|
||||
<Setter Property="Margin" Value="5"/>
|
||||
<Setter Property="MinWidth" Value="80"/>
|
||||
<Setter Property="ContentTemplate">
|
||||
<Setter.Value>
|
||||
<DataTemplate>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<Image Source="/Frontend/Assets/Cancel.ico" RenderOptions.BitmapScalingMode="HighQuality"
|
||||
Width="16" Height="16" VerticalAlignment="Center"/>
|
||||
<ContentControl Content="{Binding}" Margin="5,0,0,0" VerticalAlignment="Center"/>
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
</ResourceDictionary>
|
||||
@@ -20,6 +20,8 @@ namespace BallanceTasEditor.Frontend.ViewModels {
|
||||
|
||||
private Shared.IDialogService m_DialogService;
|
||||
|
||||
#region File Menu
|
||||
|
||||
#region File Operation
|
||||
|
||||
[ObservableProperty]
|
||||
@@ -153,6 +155,22 @@ namespace BallanceTasEditor.Frontend.ViewModels {
|
||||
|
||||
#endregion
|
||||
|
||||
#endregion
|
||||
|
||||
#region Edit Menu
|
||||
|
||||
|
||||
#region Preference
|
||||
|
||||
[RelayCommand]
|
||||
private void Preference() {
|
||||
m_DialogService.ShowPreferenceDialog();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#endregion
|
||||
|
||||
#region Help Menu
|
||||
|
||||
[RelayCommand]
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:local="clr-namespace:BallanceTasEditor.Frontend.Views"
|
||||
xmlns:vm="clr-namespace:BallanceTasEditor.Frontend.ViewModels"
|
||||
xmlns:widget="clr-namespace:BallanceTasEditor.Frontend.Widgets"
|
||||
d:DataContext="{d:DesignInstance vm:AboutDialog}"
|
||||
mc:Ignorable="d" WindowStartupLocation="CenterOwner" ResizeMode="NoResize" ShowInTaskbar="False"
|
||||
Title="About Ballance TAS Editor" Width="340" Height="480" Icon="/Frontend/Assets/About.ico">
|
||||
@@ -35,6 +36,8 @@ Version: 1.2 stable
|
||||
Build Date: October 21, 2025 "/>
|
||||
|
||||
<!-- 确认按钮 -->
|
||||
<Button Grid.Row="4" Content="OK" Margin="10" HorizontalAlignment="Center" Style="{StaticResource OkButtonStyle}" IsDefault="True" Command="{Binding OkCommand}"/>
|
||||
<widget:IconButton Grid.Row="4" Margin="10" HorizontalAlignment="Center"
|
||||
Style="{StaticResource OkIconButtonStyle}" IsDefault="True"
|
||||
Command="{Binding OkCommand}"/>
|
||||
</Grid>
|
||||
</Window>
|
||||
|
||||
@@ -62,10 +62,10 @@
|
||||
</Grid>
|
||||
|
||||
<StackPanel Orientation="Horizontal" Grid.Row="2" HorizontalAlignment="Right" Margin="10">
|
||||
<Button Content="OK" Margin="5" Style="{StaticResource OkButtonStyle}" IsDefault="True"
|
||||
Command="{Binding OkCommand}"/>
|
||||
<Button Content="Cancel" Margin="5" Style="{StaticResource CancelButtonStyle}"
|
||||
Command="{Binding CancelCommand}"/>
|
||||
<widget:IconButton Margin="5" Style="{StaticResource OkIconButtonStyle}" IsDefault="True"
|
||||
Command="{Binding OkCommand}"/>
|
||||
<widget:IconButton Margin="5" Style="{StaticResource CancelIconButtonStyle}"
|
||||
Command="{Binding CancelCommand}"/>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Window>
|
||||
|
||||
@@ -55,10 +55,10 @@
|
||||
</Grid>
|
||||
|
||||
<StackPanel Orientation="Horizontal" Grid.Row="2" HorizontalAlignment="Right" Margin="10">
|
||||
<Button Content="OK" Margin="5" Style="{StaticResource OkButtonStyle}" IsDefault="True"
|
||||
Command="{Binding OkCommand}"/>
|
||||
<Button Content="Cancel" Margin="5" Style="{StaticResource CancelButtonStyle}"
|
||||
Command="{Binding CancelCommand}"/>
|
||||
<widget:IconButton Margin="5" Style="{StaticResource OkIconButtonStyle}" IsDefault="True"
|
||||
Command="{Binding OkCommand}"/>
|
||||
<widget:IconButton Margin="5" Style="{StaticResource CancelIconButtonStyle}"
|
||||
Command="{Binding CancelCommand}"/>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Window>
|
||||
|
||||
@@ -30,10 +30,10 @@
|
||||
</Grid>
|
||||
|
||||
<StackPanel Orientation="Horizontal" Grid.Row="2" HorizontalAlignment="Right" Margin="10">
|
||||
<Button Content="OK" Margin="5" Style="{StaticResource OkButtonStyle}" IsDefault="True"
|
||||
Command="{Binding OkCommand}"/>
|
||||
<Button Content="Cancel" Margin="5" Style="{StaticResource CancelButtonStyle}"
|
||||
Command="{Binding CancelCommand}"/>
|
||||
<widget:IconButton Margin="5" Style="{StaticResource OkIconButtonStyle}" IsDefault="True"
|
||||
Command="{Binding OkCommand}"/>
|
||||
<widget:IconButton Margin="5" Style="{StaticResource CancelIconButtonStyle}"
|
||||
Command="{Binding CancelCommand}"/>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Window>
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:local="clr-namespace:BallanceTasEditor.Frontend.Views"
|
||||
xmlns:styles="clr-namespace:BallanceTasEditor.Frontend.Styles"
|
||||
xmlns:vm="clr-namespace:BallanceTasEditor.Frontend.ViewModels"
|
||||
xmlns:widget="clr-namespace:BallanceTasEditor.Frontend.Widgets"
|
||||
mc:Ignorable="d"
|
||||
d:DataContext="{d:DesignInstance vm:MainWindow}"
|
||||
WindowStartupLocation="CenterScreen"
|
||||
@@ -74,7 +74,7 @@
|
||||
<MenuItem Header="Clear Keys" Icon="{StaticResource IconClearKeys}"/>
|
||||
<MenuItem Header="Uniform FPS" Icon="{StaticResource IconUniformFps}"/>
|
||||
<Separator/>
|
||||
<MenuItem Header="Preference" Icon="{StaticResource IconPreference}" InputGestureText="Ctrl+P"/>
|
||||
<MenuItem Header="Preference" Icon="{StaticResource IconPreference}" InputGestureText="Ctrl+P" Command="{Binding PreferenceCommand}"/>
|
||||
</MenuItem>
|
||||
<MenuItem Header="_Help" Padding="5">
|
||||
<MenuItem Header="Report Bug" Icon="{StaticResource IconReportBug}" Command="{Binding ReportBugCommand}"/>
|
||||
@@ -89,16 +89,20 @@
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<StackPanel Orientation="Horizontal" Grid.Column="0">
|
||||
<Button Content="Select Mode" Margin="5" Padding="5"
|
||||
Style="{StaticResource AccessoryIconButton}" styles:AccessoryIcon.Icon="/Frontend/Assets/SelectMode.ico"/>
|
||||
<Button Content="Fill Mode" Margin="5" Padding="5"
|
||||
Style="{StaticResource AccessoryIconButton}" styles:AccessoryIcon.Icon="/Frontend/Assets/FillMode.ico"/>
|
||||
<Button Content="Draw Mode" Margin="5" Padding="5"
|
||||
Style="{StaticResource AccessoryIconButton}" styles:AccessoryIcon.Icon="/Frontend/Assets/DrawMode.ico"/>
|
||||
<widget:IconButton ButtonText="Select Mode"
|
||||
ButtonIcon="/Frontend/Assets/SelectMode.ico"
|
||||
Margin="5" Padding="5"/>
|
||||
<widget:IconButton ButtonText="Fill Mode"
|
||||
ButtonIcon="/Frontend/Assets/FillMode.ico"
|
||||
Margin="5" Padding="5"/>
|
||||
<widget:IconButton ButtonText="Draw Mode"
|
||||
ButtonIcon="/Frontend/Assets/DrawMode.ico"
|
||||
Margin="5" Padding="5"/>
|
||||
</StackPanel>
|
||||
|
||||
<Button Content="Save File then Run Game" Grid.Column="1" Margin="5" Padding="5"
|
||||
Style="{StaticResource AccessoryIconButton}" styles:AccessoryIcon.Icon="/Frontend/Assets/SaveFileThenRunGame.ico"/>
|
||||
<widget:IconButton ButtonText="Save File then Run Game"
|
||||
ButtonIcon="/Frontend/Assets/SaveFileThenRunGame.ico"
|
||||
Grid.Column="1" Margin="5" Padding="5"/>
|
||||
|
||||
</Grid>
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:local="clr-namespace:BallanceTasEditor.Frontend.Views"
|
||||
xmlns:vm="clr-namespace:BallanceTasEditor.Frontend.ViewModels"
|
||||
xmlns:styles="clr-namespace:BallanceTasEditor.Frontend.Styles"
|
||||
xmlns:widget="clr-namespace:BallanceTasEditor.Frontend.Widgets"
|
||||
d:DataContext="{d:DesignInstance vm:PreferenceDialog}"
|
||||
mc:Ignorable="d" WindowStartupLocation="CenterOwner" ResizeMode="NoResize" ShowInTaskbar="False"
|
||||
Title="Editor Preference" Height="450" Width="400" Icon="/Frontend/Assets/Preference.ico">
|
||||
@@ -17,9 +17,9 @@
|
||||
|
||||
<ScrollViewer Grid.Row="0" VerticalScrollBarVisibility="Visible">
|
||||
<StackPanel Orientation="Vertical">
|
||||
<!-- TODO: This icon is wrong. -->
|
||||
<GroupBox Header="Editor Layout" Margin="10" Padding="10"
|
||||
Style="{StaticResource AccessoryIconGroupBox}" styles:AccessoryIcon.Icon="/Frontend/Assets/EditorLayout.ico">
|
||||
<widget:IconGroupBox GroupBoxText="Editor Layout"
|
||||
GroupBoxIcon="/Frontend/Assets/EditorLayout.ico"
|
||||
Margin="10" Padding="10">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*"/>
|
||||
@@ -28,9 +28,10 @@
|
||||
<RadioButton Content="Horizontal Layout" GroupName="EditorLayout" Grid.Column="0"/>
|
||||
<RadioButton Content="Vertical Layout" GroupName="EditorLayout" Grid.Column="1"/>
|
||||
</Grid>
|
||||
</GroupBox>
|
||||
<GroupBox Header="Paste Behavior" Margin="10" Padding="10"
|
||||
Style="{StaticResource AccessoryIconGroupBox}" styles:AccessoryIcon.Icon="/Frontend/Assets/PasteFrame.ico">
|
||||
</widget:IconGroupBox>
|
||||
<widget:IconGroupBox GroupBoxText="Paste Behavior"
|
||||
GroupBoxIcon="/Frontend/Assets/PasteFrame.ico"
|
||||
Margin="10" Padding="10">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*"/>
|
||||
@@ -39,13 +40,15 @@
|
||||
<RadioButton Content="Insert Paste" GroupName="PasteBehavior" Grid.Column="0"/>
|
||||
<RadioButton Content="Overwritten Paste" GroupName="PasteBehavior" Grid.Column="1"/>
|
||||
</Grid>
|
||||
</GroupBox>
|
||||
<GroupBox Header="Frame Count" Margin="10" Padding="10"
|
||||
Style="{StaticResource AccessoryIconGroupBox}" styles:AccessoryIcon.Icon="/Frontend/Assets/Count.ico">
|
||||
</widget:IconGroupBox>
|
||||
<widget:IconGroupBox GroupBoxText="Frame Count"
|
||||
GroupBoxIcon="/Frontend/Assets/Count.ico"
|
||||
Margin="10" Padding="10">
|
||||
<TextBox Padding="3"/>
|
||||
</GroupBox>
|
||||
<GroupBox Header="Game Path" Margin="10" Padding="10"
|
||||
Style="{StaticResource AccessoryIconGroupBox}" styles:AccessoryIcon.Icon="/Frontend/Assets/SaveFileThenRunGame.ico">
|
||||
</widget:IconGroupBox>
|
||||
<widget:IconGroupBox GroupBoxText="Game Path"
|
||||
GroupBoxIcon="/Frontend/Assets/SaveFileThenRunGame.ico"
|
||||
Margin="10" Padding="10">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*"/>
|
||||
@@ -54,15 +57,15 @@
|
||||
<TextBox IsReadOnly="True" Padding="3" Grid.Column="0"/>
|
||||
<Button Content="Browse" Margin="5,0,0,0" MinWidth="80" Grid.Column="1"/>
|
||||
</Grid>
|
||||
</GroupBox>
|
||||
</widget:IconGroupBox>
|
||||
</StackPanel>
|
||||
</ScrollViewer>
|
||||
|
||||
<StackPanel Orientation="Horizontal" Grid.Row="1" HorizontalAlignment="Right" Margin="10">
|
||||
<Button Content="OK" Margin="5" Style="{StaticResource OkButtonStyle}" IsDefault="True"
|
||||
Command="{Binding OkCommand}"/>
|
||||
<Button Content="Cancel" Margin="5" Style="{StaticResource CancelButtonStyle}"
|
||||
Command="{Binding CancelCommand}"/>
|
||||
<widget:IconButton Margin="5" Style="{StaticResource OkIconButtonStyle}" IsDefault="True"
|
||||
Command="{Binding OkCommand}"/>
|
||||
<widget:IconButton Margin="5" Style="{StaticResource CancelIconButtonStyle}"
|
||||
Command="{Binding CancelCommand}"/>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Window>
|
||||
|
||||
Reference in New Issue
Block a user