重构命名控件

This commit is contained in:
polarboy 2024-07-30 00:14:36 +08:00
parent 47555e07be
commit b3cf5fcc3a
172 changed files with 324 additions and 371 deletions

View File

@ -1,5 +1,6 @@
using AtomUI.Icon;
using AtomUI.Icon.AntDesign;
using AtomUI.Theme;
using Avalonia;
using Avalonia.Dialogs;
using Avalonia.Media;

View File

@ -1,5 +1,5 @@
using System.Collections.ObjectModel;
using AtomUI.Palette;
using AtomUI.Theme.Palette;
using Avalonia.Media;
using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Messaging;

View File

@ -1,6 +1,5 @@
using Avalonia;
using Avalonia.Media;
using Math = System.Math;
namespace AtomUI.Media;

View File

@ -1,5 +1,4 @@
using AtomUI.Utils;
using Avalonia;
using Avalonia;
using Avalonia.Animation;
namespace AtomUI.Media;

View File

@ -1,8 +1,6 @@
using Avalonia;
using Avalonia.Animation.Easings;
using Avalonia.Controls;
using Avalonia.Media;
using Avalonia.Media.Transformation;
namespace AtomUI.MotionScene;

View File

@ -1,6 +1,5 @@
using System.Diagnostics.CodeAnalysis;
using System.Reflection;
using Avalonia.Controls;
namespace AtomUI.Reflection;

View File

@ -1,5 +1,5 @@
using AtomUI.Data;
using AtomUI.Styling;
using AtomUI.Theme.Data;
using AtomUI.Theme.Styling;
using AtomUI.Utils;
using Avalonia;
using Avalonia.Controls;

View File

@ -1,5 +1,6 @@
using AtomUI.Data;
using AtomUI.Styling;
using AtomUI.Theme;
using AtomUI.Theme.Styling;
using AtomUI.Utils;
using Avalonia;
using Avalonia.Controls;
@ -16,7 +17,7 @@ using VerticalAlignment = Avalonia.Layout.VerticalAlignment;
namespace AtomUI.Controls;
[ControlThemeProvider]
internal class AlertTheme : ControlTheme
internal class AlertTheme : BaseControlTheme
{
public const string CloseBtnPart = "PART_CloseBtn";
public const string InfoIconPart = "PART_InfoIcon";

View File

@ -1,4 +1,4 @@
using AtomUI.TokenSystem;
using AtomUI.Theme.TokenSystem;
using Avalonia;
namespace AtomUI.Controls;

View File

@ -1,5 +1,5 @@
using AtomUI.Media;
using AtomUI.Styling;
using AtomUI.Theme.Styling;
using AtomUI.Utils;
using Avalonia;
using Avalonia.Controls;

View File

@ -1,17 +1,15 @@
using AtomUI.Controls.Utils;
using AtomUI.Styling;
using AtomUI.Theme;
using AtomUI.Theme.Styling;
using Avalonia;
using Avalonia.Controls;
using Avalonia.Controls.Templates;
using Avalonia.Media;
using Avalonia.Styling;
using ExCSS;
using Colors = Avalonia.Media.Colors;
namespace AtomUI.Controls;
[ControlThemeProvider]
public class ArrowDecoratedBoxTheme : ControlTheme
public class ArrowDecoratedBoxTheme : BaseControlTheme
{
public const string DecoratorPart = "Part_Decorator";

View File

@ -1,4 +1,4 @@
using AtomUI.TokenSystem;
using AtomUI.Theme.TokenSystem;
using Avalonia;
namespace AtomUI.Controls;

View File

@ -1,4 +1,4 @@
using AtomUI.TokenSystem;
using AtomUI.Theme.TokenSystem;
using Avalonia;
using Avalonia.Media;

View File

@ -2,8 +2,8 @@
using AtomUI.Controls.MotionScene;
using AtomUI.Data;
using AtomUI.MotionScene;
using AtomUI.Palette;
using AtomUI.Styling;
using AtomUI.Theme.Palette;
using AtomUI.Theme.Styling;
using AtomUI.Utils;
using Avalonia;
using Avalonia.Controls;

View File

@ -1,6 +1,6 @@
using System.Globalization;
using AtomUI.Media;
using AtomUI.Styling;
using AtomUI.Theme.Styling;
using Avalonia;
using Avalonia.Controls;
using Avalonia.Controls.Documents;

View File

@ -2,8 +2,8 @@
using AtomUI.Controls.MotionScene;
using AtomUI.Data;
using AtomUI.MotionScene;
using AtomUI.Palette;
using AtomUI.Styling;
using AtomUI.Theme.Palette;
using AtomUI.Theme.Styling;
using AtomUI.Utils;
using Avalonia;
using Avalonia.Controls;

View File

@ -1,4 +1,4 @@
using AtomUI.Styling;
using AtomUI.Theme.Styling;
using Avalonia;
using Avalonia.Controls;
using Avalonia.Layout;

View File

@ -1,6 +1,6 @@
using AtomUI.Data;
using AtomUI.Palette;
using AtomUI.Styling;
using AtomUI.Theme.Palette;
using AtomUI.Theme.Styling;
using Avalonia;
using Avalonia.Controls;
using Avalonia.Controls.Primitives;

View File

@ -1,6 +1,6 @@
using AtomUI.Controls.Utils;
using AtomUI.Media;
using AtomUI.Styling;
using AtomUI.Theme.Styling;
using Avalonia;
using Avalonia.Controls;
using Avalonia.Layout;

View File

@ -1,8 +1,8 @@
using AtomUI.Styling;
using AtomUI.Theme;
using AtomUI.Theme.Styling;
using Avalonia;
using Avalonia.Controls;
using Avalonia.Controls.Templates;
using Avalonia.Data;
using Avalonia.Input;
using Avalonia.Layout;
using Avalonia.Markup.Xaml.MarkupExtensions;
@ -10,7 +10,7 @@ using Avalonia.Styling;
namespace AtomUI.Controls;
internal abstract class BaseButtonTheme : ControlTheme
internal abstract class BaseButtonTheme : BaseControlTheme
{
public const string LabelPart = "PART_Label";
public const string StackPanelPart = "PART_StackPanel";

View File

@ -1,7 +1,8 @@
using AtomUI.Controls.Utils;
using AtomUI.Icon;
using AtomUI.Media;
using AtomUI.Styling;
using AtomUI.Theme.Styling;
using AtomUI.Theme.Utils;
using AtomUI.Utils;
using Avalonia;
using Avalonia.Animation;

View File

@ -1,5 +1,5 @@
using AtomUI.Styling;
using AtomUI.TokenSystem;
using AtomUI.Theme.Styling;
using AtomUI.Theme.TokenSystem;
using AtomUI.Utils;
using Avalonia;
using Avalonia.Media;

View File

@ -1,4 +1,4 @@
using AtomUI.Styling;
using AtomUI.Theme.Styling;
using Avalonia.Markup.Xaml.MarkupExtensions;
using Avalonia.Styling;

View File

@ -1,5 +1,5 @@
using AtomUI.Icon;
using AtomUI.Styling;
using AtomUI.Theme.Styling;
using Avalonia;
using Avalonia.Input;
using Avalonia.LogicalTree;

View File

@ -1,4 +1,4 @@
using AtomUI.Styling;
using AtomUI.Theme.Styling;
using Avalonia.Markup.Xaml.MarkupExtensions;
using Avalonia.Styling;

View File

@ -1,4 +1,4 @@
using AtomUI.Styling;
using AtomUI.Theme.Styling;
using Avalonia.Markup.Xaml.MarkupExtensions;
using Avalonia.Media;
using Avalonia.Styling;

View File

@ -1,4 +1,4 @@
using AtomUI.Styling;
using AtomUI.Theme.Styling;
using Avalonia.Markup.Xaml.MarkupExtensions;
using Avalonia.Styling;

View File

@ -1,7 +1,7 @@
using AtomUI.Controls.Utils;
using AtomUI.Media;
using AtomUI.Styling;
using AtomUI.Utils;
using AtomUI.Theme.Styling;
using AtomUI.Theme.Utils;
using Avalonia;
using Avalonia.Animation;
using Avalonia.Animation.Easings;

View File

@ -1,11 +1,11 @@
using AtomUI.Styling;
using Avalonia.Markup.Xaml.MarkupExtensions;
using AtomUI.Theme;
using AtomUI.Theme.Styling;
using Avalonia.Styling;
namespace AtomUI.Controls;
[ControlThemeProvider]
internal class CheckBoxTheme : ControlTheme
internal class CheckBoxTheme : BaseControlTheme
{
public CheckBoxTheme()
: base(typeof(CheckBox))

View File

@ -1,4 +1,4 @@
using AtomUI.TokenSystem;
using AtomUI.Theme.TokenSystem;
namespace AtomUI.Controls;

View File

@ -1,5 +1,5 @@
using AtomUI.Media;
using AtomUI.Styling;
using AtomUI.Theme.Styling;
using AtomUI.Utils;
using Avalonia;
using Avalonia.Controls;

View File

@ -1,5 +1,6 @@
using AtomUI.Data;
using AtomUI.Styling;
using AtomUI.Theme;
using AtomUI.Theme.Styling;
using AtomUI.Utils;
using Avalonia;
using Avalonia.Controls;
@ -12,7 +13,7 @@ using Avalonia.Styling;
namespace AtomUI.Controls;
[ControlThemeProvider]
internal class EmptyIndicatorTheme : ControlTheme
internal class EmptyIndicatorTheme : BaseControlTheme
{
public const string SvgImagePart = "PART_SvgImage";

View File

@ -1,4 +1,4 @@
using AtomUI.TokenSystem;
using AtomUI.Theme.TokenSystem;
namespace AtomUI.Controls;

View File

@ -1,7 +1,7 @@
using System.ComponentModel;
using System.Reactive.Disposables;
using AtomUI.Data;
using AtomUI.Styling;
using AtomUI.Theme.Styling;
using AtomUI.Utils;
using Avalonia;
using Avalonia.Controls;
@ -9,6 +9,7 @@ using Avalonia.Controls.Primitives.PopupPositioning;
using Avalonia.Layout;
using Avalonia.Media;
using Avalonia.Metadata;
using Avalonia.Styling;
using Avalonia.Threading;
namespace AtomUI.Controls;

View File

@ -1,6 +1,6 @@
using System.Reactive.Disposables;
using AtomUI.Data;
using AtomUI.Styling;
using AtomUI.Theme.Styling;
using AtomUI.Utils;
using Avalonia;
using Avalonia.Controls;

View File

@ -1,4 +1,4 @@
using AtomUI.TokenSystem;
using AtomUI.Theme.TokenSystem;
namespace AtomUI.Controls;

View File

@ -5,11 +5,10 @@ using Avalonia;
using Avalonia.Controls;
using Avalonia.Controls.Templates;
using Avalonia.Metadata;
using Avalonia.Styling;
namespace AtomUI.Controls;
using AvaloniaControlTheme = Avalonia.Styling.ControlTheme;
public class MenuFlyout : PopupFlyoutBase
{
private static readonly MethodInfo SetItemsSourceMethodInfo;
@ -41,7 +40,7 @@ public class MenuFlyout : PopupFlyoutBase
/// <summary>
/// Defines the <see cref="ItemContainerTheme"/> property.
/// </summary>
public static readonly StyledProperty<AvaloniaControlTheme?> ItemContainerThemeProperty =
public static readonly StyledProperty<ControlTheme?> ItemContainerThemeProperty =
ItemsControl.ItemContainerThemeProperty.AddOwner<MenuFlyout>();
/// <summary>
@ -75,7 +74,7 @@ public class MenuFlyout : PopupFlyoutBase
/// <summary>
/// Gets or sets the <see cref="ControlTheme"/> that is applied to the container element generated for each item.
/// </summary>
public AvaloniaControlTheme? ItemContainerTheme
public ControlTheme? ItemContainerTheme
{
get => GetValue(ItemContainerThemeProperty);
set => SetValue(ItemContainerThemeProperty, value);
@ -84,7 +83,7 @@ public class MenuFlyout : PopupFlyoutBase
/// <summary>
/// Gets or sets the <see cref="ControlTheme"/> that is applied to the container element generated for the flyout presenter.
/// </summary>
public AvaloniaControlTheme? FlyoutPresenterTheme
public ControlTheme? FlyoutPresenterTheme
{
get => GetValue(FlyoutPresenterThemeProperty);
set => SetValue(FlyoutPresenterThemeProperty, value);

View File

@ -1,4 +1,5 @@
using AtomUI.Styling;
using AtomUI.Theme;
using AtomUI.Theme.Styling;
using AtomUI.Utils;
using Avalonia.Controls;
using Avalonia.Controls.Presenters;
@ -9,7 +10,7 @@ using Avalonia.Media;
namespace AtomUI.Controls;
[ControlThemeProvider]
public class MenuFlyoutPresenterTheme : ControlTheme
public class MenuFlyoutPresenterTheme : BaseControlTheme
{
public const string ItemsPresenterPart = "PART_ItemsPresenter";
public const string RootContainerPart = "PART_RootContainer";

View File

@ -1,6 +1,6 @@
using AtomUI.TokenSystem;
using AtomUI.Theme.TokenSystem;
namespace AtomUI.Styling
namespace AtomUI.Theme.Styling
{
public static class AlertResourceKey
{

View File

@ -1,5 +1,5 @@
using AtomUI.Controls.Utils;
using AtomUI.Styling;
using AtomUI.Theme.Styling;
using AtomUI.Utils;
using Avalonia;
using Avalonia.Animation;

View File

@ -1,4 +1,4 @@
using AtomUI.Styling;
using AtomUI.Theme.Styling;
using Avalonia;
using Avalonia.Controls;
using Avalonia.Controls.Primitives;

View File

@ -1,11 +1,12 @@
using AtomUI.Styling;
using AtomUI.Theme;
using AtomUI.Theme.Styling;
using Avalonia.Controls;
using Avalonia.Controls.Templates;
namespace AtomUI.Controls;
[ControlThemeProvider]
public class LoadingIndicatorAdornerTheme : ControlTheme
public class LoadingIndicatorAdornerTheme : BaseControlTheme
{
public const string LoadingIndicatorPart = "Part_LoadingIndicator";
public const string MainContainerPart = "Part_MainContainer";

View File

@ -1,5 +1,6 @@
using AtomUI.Icon;
using AtomUI.Styling;
using AtomUI.Theme;
using AtomUI.Theme.Styling;
using Avalonia.Animation.Easings;
using Avalonia.Controls;
using Avalonia.Controls.Templates;
@ -9,7 +10,7 @@ using Avalonia.Styling;
namespace AtomUI.Controls;
[ControlThemeProvider]
public class LoadingIndicatorTheme : ControlTheme
public class LoadingIndicatorTheme : BaseControlTheme
{
public const string MainContainerPart = "Part_MainContainer";
public const string LoadingTextPart = "Part_LoadingText";

View File

@ -1,4 +1,4 @@
using AtomUI.TokenSystem;
using AtomUI.Theme.TokenSystem;
namespace AtomUI.Controls;

View File

@ -1,5 +1,5 @@
using AtomUI.Data;
using AtomUI.Styling;
using AtomUI.Theme.Styling;
using Avalonia;
using Avalonia.Animation.Easings;
using Avalonia.Controls;

View File

@ -1,4 +1,4 @@
using AtomUI.Styling;
using AtomUI.Theme.Styling;
using AtomUI.Utils;
using Avalonia;
using Avalonia.Animation;

View File

@ -1,4 +1,4 @@
using AtomUI.TokenSystem;
using AtomUI.Theme.TokenSystem;
namespace AtomUI.Controls;

View File

@ -1,7 +1,7 @@
using System.ComponentModel;
using System.Reflection;
using AtomUI.Reflection;
using AtomUI.Styling;
using AtomUI.Theme.Styling;
using Avalonia.Controls;
using Avalonia.Controls.Primitives;
using Avalonia.Input;

View File

@ -1,4 +1,5 @@
using AtomUI.Styling;
using AtomUI.Theme;
using AtomUI.Theme.Styling;
using AtomUI.Utils;
using Avalonia.Controls;
using Avalonia.Controls.Presenters;
@ -9,7 +10,7 @@ using Avalonia.Media;
namespace AtomUI.Controls;
[ControlThemeProvider]
public class ContextMenuTheme : ControlTheme
public class ContextMenuTheme : BaseControlTheme
{
public const string ItemsPresenterPart = "PART_ItemsPresenter";
public const string RootContainerPart = "PART_RootContainer";

View File

@ -1,6 +1,7 @@
using AtomUI.Data;
using AtomUI.Media;
using AtomUI.Styling;
using AtomUI.Theme.Styling;
using AtomUI.Theme.Utils;
using AtomUI.Utils;
using Avalonia;
using Avalonia.Animation;

View File

@ -1,12 +1,13 @@
using AtomUI.Media;
using AtomUI.Styling;
using AtomUI.Theme;
using AtomUI.Theme.Styling;
using AtomUI.Theme.Utils;
using AtomUI.Utils;
using Avalonia.Animation;
using Avalonia.Controls;
using Avalonia.Controls.Presenters;
using Avalonia.Controls.Templates;
using Avalonia.Data;
using Avalonia.Input;
using Avalonia.Layout;
using Avalonia.Media;
using Avalonia.Styling;
@ -14,7 +15,7 @@ using Avalonia.Styling;
namespace AtomUI.Controls;
[ControlThemeProvider]
internal class MenuItemTheme : ControlTheme
internal class MenuItemTheme : BaseControlTheme
{
public const string ItemDecoratorPart = "Part_ItemDecorator";
public const string MainContainerPart = "Part_MainContainer";

View File

@ -1,5 +1,5 @@
using System.Globalization;
using AtomUI.Styling;
using AtomUI.Theme.Styling;
using Avalonia;
using Avalonia.Controls;
using Avalonia.Controls.Converters;

View File

@ -1,6 +1,8 @@
using AtomUI.Data;
using AtomUI.Media;
using AtomUI.Styling;
using AtomUI.Theme;
using AtomUI.Theme.Styling;
using AtomUI.Theme.Utils;
using AtomUI.Utils;
using Avalonia.Animation;
using Avalonia.Controls;
@ -13,7 +15,7 @@ using Avalonia.Styling;
namespace AtomUI.Controls;
[ControlThemeProvider]
internal class MenuScrollViewerTheme : ControlTheme
internal class MenuScrollViewerTheme : BaseControlTheme
{
public const string ScrollUpButtonPart = "Part_ScrollUpButton";
public const string ScrollDownButtonPart = "Part_ScrollDownButton";

View File

@ -1,11 +1,8 @@
using AtomUI.Data;
using AtomUI.Styling;
using AtomUI.Theme.Data;
using AtomUI.Theme.Styling;
using AtomUI.Utils;
using Avalonia;
using Avalonia.Controls.Primitives;
using Avalonia.Controls.Templates;
using Avalonia.Data;
using Avalonia.LogicalTree;
using Avalonia.Media;
namespace AtomUI.Controls;

View File

@ -1,12 +1,11 @@
using AtomUI.Styling;
using Avalonia.Controls;
using Avalonia.Controls.Templates;
using AtomUI.Theme;
using AtomUI.Theme.Styling;
using Avalonia.Styling;
namespace AtomUI.Controls;
[ControlThemeProvider]
public class MenuSeparatorTheme : ControlTheme
public class MenuSeparatorTheme : BaseControlTheme
{
public MenuSeparatorTheme()
: base(typeof(MenuSeparator))

View File

@ -1,4 +1,5 @@
using AtomUI.Styling;
using AtomUI.Theme;
using AtomUI.Theme.Styling;
using Avalonia;
using Avalonia.Controls;
using Avalonia.Controls.Presenters;
@ -10,7 +11,7 @@ using Avalonia.Styling;
namespace AtomUI.Controls;
[ControlThemeProvider]
public class MenuTheme : ControlTheme
public class MenuTheme : BaseControlTheme
{
public const string ItemsPresenterPart = "PART_ItemsPresenter";
public MenuTheme()

View File

@ -1,5 +1,5 @@
using AtomUI.Styling;
using AtomUI.TokenSystem;
using AtomUI.Theme.Styling;
using AtomUI.Theme.TokenSystem;
using Avalonia;
using Avalonia.Media;

View File

@ -1,4 +1,5 @@
using AtomUI.Styling;
using AtomUI.Theme;
using AtomUI.Theme.Styling;
using AtomUI.Utils;
using Avalonia.Controls;
using Avalonia.Controls.Presenters;
@ -11,7 +12,7 @@ using Avalonia.Styling;
namespace AtomUI.Controls;
[ControlThemeProvider]
public class TopLevelMenuItemTheme : ControlTheme
public class TopLevelMenuItemTheme : BaseControlTheme
{
public const string ID = "TopLevelMenuItem";

View File

@ -1,7 +1,7 @@
using AtomUI.Controls.Utils;
using AtomUI.Media;
using AtomUI.Styling;
using AtomUI.Utils;
using AtomUI.Theme.Styling;
using AtomUI.Theme.Utils;
using Avalonia;
using Avalonia.Animation;
using Avalonia.Controls;

View File

@ -1,6 +1,6 @@
using System.Collections.Specialized;
using AtomUI.Controls.Utils;
using AtomUI.Styling;
using AtomUI.Theme.Styling;
using Avalonia;
using Avalonia.Collections;
using Avalonia.Controls;

View File

@ -1,4 +1,5 @@
using AtomUI.Styling;
using AtomUI.Theme;
using AtomUI.Theme.Styling;
using Avalonia.Controls;
using Avalonia.Controls.Templates;
using Avalonia.Layout;
@ -7,7 +8,7 @@ using Avalonia.Styling;
namespace AtomUI.Controls;
[ControlThemeProvider]
public class OptionButtonGroupTheme : ControlTheme
public class OptionButtonGroupTheme : BaseControlTheme
{
public const string MainContainerPart = "PART_MainContainer";

View File

@ -1,4 +1,5 @@
using AtomUI.Styling;
using AtomUI.Theme;
using AtomUI.Theme.Styling;
using Avalonia;
using Avalonia.Controls;
using Avalonia.Controls.Templates;
@ -8,7 +9,7 @@ using Avalonia.Styling;
namespace AtomUI.Controls;
[ControlThemeProvider]
public class OptionButtonTheme : ControlTheme
public class OptionButtonTheme : BaseControlTheme
{
public OptionButtonTheme()
: base(typeof(OptionButton))

View File

@ -1,5 +1,5 @@
using AtomUI.Styling;
using AtomUI.TokenSystem;
using AtomUI.Theme.Styling;
using AtomUI.Theme.TokenSystem;
using AtomUI.Utils;
using Avalonia;
using Avalonia.Media;

View File

@ -2,7 +2,7 @@
using AtomUI.Controls.MotionScene;
using AtomUI.Data;
using AtomUI.MotionScene;
using AtomUI.Styling;
using AtomUI.Theme.Styling;
using AtomUI.Utils;
using Avalonia;
using Avalonia.Controls;

View File

@ -1,5 +1,5 @@
using AtomUI.Media;
using AtomUI.Styling;
using AtomUI.Theme.Styling;
using AtomUI.Utils;
using Avalonia;
using Avalonia.Controls;

View File

@ -1,4 +1,4 @@
using AtomUI.Styling;
using AtomUI.Theme.Styling;
using AtomUI.Utils;
using Avalonia.Controls;
using Avalonia.Controls.Templates;

View File

@ -1,5 +1,5 @@
using AtomUI.Media;
using AtomUI.Styling;
using AtomUI.Theme.Styling;
using AtomUI.Utils;
using Avalonia;
using Avalonia.Controls;

View File

@ -1,4 +1,4 @@
using AtomUI.Styling;
using AtomUI.Theme.Styling;
using AtomUI.Utils;
using Avalonia.Controls;
using Avalonia.Controls.Templates;

View File

@ -1,5 +1,6 @@
using AtomUI.Media;
using AtomUI.Styling;
using AtomUI.Theme.Styling;
using AtomUI.Theme.Utils;
using AtomUI.Utils;
using Avalonia;
using Avalonia.Animation;
@ -8,7 +9,6 @@ using Avalonia.Controls;
using Avalonia.Controls.Metadata;
using Avalonia.Controls.Primitives;
using Avalonia.Data;
using Avalonia.LogicalTree;
using Avalonia.Media;
namespace AtomUI.Controls;

View File

@ -1,5 +1,6 @@
using AtomUI.Icon;
using AtomUI.Styling;
using AtomUI.Theme;
using AtomUI.Theme.Styling;
using Avalonia;
using Avalonia.Controls;
using Avalonia.Controls.Templates;
@ -9,7 +10,7 @@ using Avalonia.Styling;
namespace AtomUI.Controls;
public class AbstractProgressBarTheme : ControlTheme
public class AbstractProgressBarTheme : BaseControlTheme
{
public const string PercentageLabelPart = "PART_PercentageLabel";
public const string SuccessCompletedIconPart = "PART_SuccessCompletedIcon";

View File

@ -1,4 +1,4 @@
using AtomUI.Styling;
using AtomUI.Theme.Styling;
namespace AtomUI.Controls;

View File

@ -1,4 +1,4 @@
using AtomUI.Styling;
using AtomUI.Theme.Styling;
namespace AtomUI.Controls;

View File

@ -1,6 +1,6 @@
using AtomUI.Data;
using AtomUI.Media;
using AtomUI.Styling;
using AtomUI.Theme.Data;
using AtomUI.Theme.Styling;
using AtomUI.Utils;
using Avalonia;
using Avalonia.Controls;

View File

@ -1,4 +1,4 @@
using AtomUI.Styling;
using AtomUI.Theme.Styling;
using Avalonia.Controls;
using Avalonia.Layout;
using Avalonia.Media;

View File

@ -1,4 +1,4 @@
using AtomUI.TokenSystem;
using AtomUI.Theme.TokenSystem;
using Avalonia;
using Avalonia.Media;

View File

@ -1,5 +1,5 @@
using AtomUI.Data;
using AtomUI.Styling;
using AtomUI.Theme.Data;
using AtomUI.Theme.Styling;
using AtomUI.Utils;
using Avalonia;
using Avalonia.Controls;

View File

@ -1,4 +1,4 @@
using AtomUI.Styling;
using AtomUI.Theme.Styling;
using Avalonia.Layout;
using Avalonia.Styling;

View File

@ -1,7 +1,7 @@
using AtomUI.Controls.Utils;
using AtomUI.Media;
using AtomUI.Styling;
using AtomUI.Utils;
using AtomUI.Theme.Styling;
using AtomUI.Theme.Utils;
using Avalonia;
using Avalonia.Animation;
using Avalonia.Controls;

View File

@ -1,11 +1,11 @@
using AtomUI.Styling;
using Avalonia.Markup.Xaml.MarkupExtensions;
using AtomUI.Theme;
using AtomUI.Theme.Styling;
using Avalonia.Styling;
namespace AtomUI.Controls;
[ControlThemeProvider]
internal class RadioButtonTheme : ControlTheme
internal class RadioButtonTheme : BaseControlTheme
{
public RadioButtonTheme()
: base(typeof(RadioButton))

View File

@ -1,4 +1,4 @@
using AtomUI.TokenSystem;
using AtomUI.Theme.TokenSystem;
using Avalonia.Media;
namespace AtomUI.Controls;

View File

@ -1,7 +1,7 @@
using System.Collections.Specialized;
using AtomUI.Data;
using AtomUI.Styling;
using AtomUI.Utils;
using AtomUI.Theme.Styling;
using AtomUI.Theme.Utils;
using Avalonia;
using Avalonia.Animation;
using Avalonia.Collections;

View File

@ -1,7 +1,8 @@
using AtomUI.Controls.Utils;
using AtomUI.Icon;
using AtomUI.Media;
using AtomUI.Styling;
using AtomUI.Theme.Styling;
using AtomUI.Theme.Utils;
using AtomUI.Utils;
using Avalonia;
using Avalonia.Animation;

View File

@ -1,7 +1,7 @@
using AtomUI.Data;
using AtomUI.Media;
using AtomUI.Styling;
using AtomUI.Utils;
using AtomUI.Theme.Styling;
using AtomUI.Theme.Utils;
using Avalonia;
using Avalonia.Animation;
using Avalonia.Controls;
@ -15,22 +15,23 @@ namespace AtomUI.Controls;
/// 在内部维护一些额外信息的控件,用户无感知
/// 绘制圆角什么的
/// </summary>
internal partial class SegmentedItemBox : TemplatedControl,
ICustomHitTest,
IControlCustomStyle
internal class SegmentedItemBox : TemplatedControl,
ICustomHitTest,
IControlCustomStyle
{
#region
public static readonly StyledProperty<SizeType> SizeTypeProperty =
Segmented.SizeTypeProperty.AddOwner<SegmentedItemBox>();
public static readonly DirectProperty<SegmentedItemBox, bool> IsPressedProperty =
AvaloniaProperty.RegisterDirect<SegmentedItemBox, bool>(nameof(IsPressed), o => o.IsPressed);
public static readonly DirectProperty<SegmentedItemBox, bool> IsCurrentItemProperty =
AvaloniaProperty.RegisterDirect<SegmentedItemBox, bool>(nameof(IsCurrentItem),
AvaloniaProperty.RegisterDirect<SegmentedItemBox, bool>(nameof(IsCurrentItem),
o => o.IsCurrentItem,
(o, v) => o.IsCurrentItem = v);
/// <summary>
/// Gets or sets a value indicating whether the button is currently pressed.
/// </summary>
@ -39,7 +40,7 @@ internal partial class SegmentedItemBox : TemplatedControl,
get => _isPressed;
private set => SetAndRaise(IsPressedProperty, ref _isPressed, value);
}
public SizeType SizeType
{
get => GetValue(SizeTypeProperty);
@ -53,40 +54,47 @@ internal partial class SegmentedItemBox : TemplatedControl,
internal static readonly StyledProperty<double> ControlHeightProperty =
AvaloniaProperty.Register<SegmentedItemBox, double>(
nameof(ControlHeight));
internal static readonly StyledProperty<Thickness> SegmentedItemPaddingProperty
= AvaloniaProperty.Register<SegmentedItemBox, Thickness>(nameof(SegmentedItemPadding));
internal static readonly StyledProperty<Thickness> TrackPaddingProperty
= AvaloniaProperty.Register<SegmentedItemBox, Thickness>(nameof(TrackPadding));
internal double ControlHeight
{
get => GetValue(ControlHeightProperty);
set => SetValue(ControlHeightProperty, value);
}
internal Thickness SegmentedItemPadding
{
get => GetValue(SegmentedItemPaddingProperty);
set => SetValue(SegmentedItemPaddingProperty, value);
}
internal Thickness TrackPadding
{
get => GetValue(TrackPaddingProperty);
set => SetValue(TrackPaddingProperty, value);
}
#endregion
internal Control Item { get; }
private bool _isCurrentItem;
internal bool IsCurrentItem { get => _isCurrentItem; set => SetCurrentItem(value); }
internal bool IsCurrentItem
{
get => _isCurrentItem;
set => SetCurrentItem(value);
}
private IControlCustomStyle _customStyle;
private bool _isPressed = false;
private ControlStyleState _styleState;
public int LastItem { get; set; } = -1;
static SegmentedItemBox()
@ -95,7 +103,7 @@ internal partial class SegmentedItemBox : TemplatedControl,
AffectsMeasure<SegmentedItemBox>(SizeTypeProperty);
AffectsRender<SegmentedItemBox>(BackgroundProperty);
}
public SegmentedItemBox(Control item)
{
_customStyle = this;
@ -105,7 +113,7 @@ internal partial class SegmentedItemBox : TemplatedControl,
BindUtils.RelayBind(this, SizeTypeProperty, segmentedItem);
}
}
protected override Size MeasureOverride(Size availableSize)
{
// 由内置的 Box 布局
@ -149,7 +157,7 @@ internal partial class SegmentedItemBox : TemplatedControl,
IsPressed = false;
}
}
protected override void OnApplyTemplate(TemplateAppliedEventArgs e)
{
base.OnApplyTemplate(e);
@ -180,16 +188,16 @@ internal partial class SegmentedItemBox : TemplatedControl,
itemHeight = ControlHeight - padding;
return itemHeight;
}
public bool HitTest(Point point)
{
return true;
}
#region IControlCustomStyle
void IControlCustomStyle.SetupTransitions()
{
{
Transitions = new Transitions()
{
AnimationUtils.CreateTransition<SolidColorBrushTransition>(BackgroundProperty),
@ -212,7 +220,7 @@ internal partial class SegmentedItemBox : TemplatedControl,
_customStyle.UpdatePseudoClasses();
}
void IControlCustomStyle.HandlePropertyChangedForStyle(AvaloniaPropertyChangedEventArgs e)
{
@ -222,11 +230,12 @@ internal partial class SegmentedItemBox : TemplatedControl,
_customStyle.CollectStyleState();
}
}
void IControlCustomStyle.UpdatePseudoClasses()
{
PseudoClasses.Set(StdPseudoClass.Pressed, IsPressed);
PseudoClasses.Set(StdPseudoClass.Selected, IsCurrentItem);
}
#endregion
}

View File

@ -1,4 +1,5 @@
using AtomUI.Styling;
using AtomUI.Theme;
using AtomUI.Theme.Styling;
using Avalonia.Controls;
using Avalonia.Controls.Templates;
using Avalonia.Styling;
@ -6,7 +7,7 @@ using Avalonia.Styling;
namespace AtomUI.Controls;
[ControlThemeProvider]
public class SegmentedItemBoxTheme : ControlTheme
public class SegmentedItemBoxTheme : BaseControlTheme
{
public SegmentedItemBoxTheme()
: base(typeof(SegmentedItemBox))

View File

@ -1,4 +1,5 @@
using AtomUI.Styling;
using AtomUI.Theme;
using AtomUI.Theme.Styling;
using Avalonia;
using Avalonia.Controls;
using Avalonia.Controls.Templates;
@ -8,7 +9,7 @@ using Avalonia.Styling;
namespace AtomUI.Controls;
[ControlThemeProvider]
internal class SegmentedItemTheme : ControlTheme
internal class SegmentedItemTheme : BaseControlTheme
{
public const string MainLayoutPart = "PART_MainLayout";

View File

@ -1,4 +1,5 @@
using AtomUI.Styling;
using AtomUI.Theme;
using AtomUI.Theme.Styling;
using Avalonia.Controls;
using Avalonia.Controls.Templates;
using Avalonia.Layout;
@ -8,7 +9,7 @@ using Avalonia.Styling;
namespace AtomUI.Controls;
[ControlThemeProvider]
public class SegmentedTheme : ControlTheme
public class SegmentedTheme : BaseControlTheme
{
public const string MainContainerPart = "PART_MainContainer";
public SegmentedTheme()

View File

@ -1,4 +1,4 @@
using AtomUI.TokenSystem;
using AtomUI.Theme.TokenSystem;
using Avalonia;
using Avalonia.Media;

View File

@ -1,6 +1,6 @@
using AtomUI.Data;
using AtomUI.Media;
using AtomUI.Styling;
using AtomUI.Media;
using AtomUI.Theme.Data;
using AtomUI.Theme.Styling;
using AtomUI.Utils;
using Avalonia;
using Avalonia.Controls;

View File

@ -1,4 +1,6 @@
using AtomUI.Styling;

using AtomUI.Theme.Styling;
using AtomUI.Theme;
using Avalonia;
using Avalonia.Controls;
using Avalonia.Controls.Templates;
@ -8,7 +10,7 @@ using Avalonia.Styling;
namespace AtomUI.Controls;
[ControlThemeProvider]
internal class SeparatorTheme : ControlTheme
internal class SeparatorTheme : BaseControlTheme
{
public const string TitlePart = "PART_Title";

View File

@ -1,4 +1,4 @@
using AtomUI.TokenSystem;
using AtomUI.Theme.TokenSystem;
using Avalonia;
namespace AtomUI.Controls;

View File

@ -1,4 +1,5 @@
using AtomUI.Styling;
using AtomUI.Theme;
using AtomUI.Theme.Styling;
using Avalonia.Controls;
using Avalonia.Controls.Templates;
using Avalonia.Data;
@ -9,7 +10,7 @@ using Avalonia.Styling;
namespace AtomUI.Controls;
[ControlThemeProvider]
internal class SliderTheme : ControlTheme
internal class SliderTheme : BaseControlTheme
{
public const string TrackPart = "PART_Track";
public const string StartThumbPart = "PART_StartThumb";

View File

@ -1,6 +1,6 @@
using AtomUI.Media;
using AtomUI.Styling;
using AtomUI.Utils;
using AtomUI.Theme.Styling;
using AtomUI.Theme.Utils;
using Avalonia;
using Avalonia.Animation;
using Avalonia.Automation.Peers;

View File

@ -1,11 +1,12 @@
using AtomUI.Styling;
using AtomUI.Theme;
using AtomUI.Theme.Styling;
using Avalonia;
using Avalonia.Styling;
namespace AtomUI.Controls;
[ControlThemeProvider]
internal class SliderThumbTheme : ControlTheme
internal class SliderThumbTheme : BaseControlTheme
{
public SliderThumbTheme() : base(typeof(SliderThumb))
{

View File

@ -1,5 +1,5 @@
using AtomUI.Media;
using AtomUI.TokenSystem;
using AtomUI.Theme.TokenSystem;
using Avalonia;
using Avalonia.Media;

View File

@ -1,6 +1,7 @@
using System.Globalization;
using AtomUI.Media;
using AtomUI.Styling;
using AtomUI.Theme.Styling;
using AtomUI.Theme.Utils;
using AtomUI.Utils;
using Avalonia;
using Avalonia.Animation;

View File

@ -1,6 +1,7 @@
using AtomUI.Data;
using AtomUI.Media;
using AtomUI.Styling;
using AtomUI.Theme.Styling;
using AtomUI.Theme.Utils;
using AtomUI.Utils;
using Avalonia;
using Avalonia.Animation;

View File

@ -2,8 +2,8 @@ using AtomUI.Controls.Switch;
using AtomUI.Controls.Utils;
using AtomUI.Icon;
using AtomUI.Media;
using AtomUI.Styling;
using AtomUI.Utils;
using AtomUI.Theme.Styling;
using AtomUI.Theme.Utils;
using Avalonia;
using Avalonia.Animation;
using Avalonia.Controls;

View File

@ -1,4 +1,5 @@
using AtomUI.Styling;
using AtomUI.Theme;
using AtomUI.Theme.Styling;
using Avalonia.Controls;
using Avalonia.Controls.Templates;
using Avalonia.Styling;
@ -6,7 +7,7 @@ using Avalonia.Styling;
namespace AtomUI.Controls.Switch;
[ControlThemeProvider]
public class ToggleSwitchTheme : ControlTheme
public class ToggleSwitchTheme : BaseControlTheme
{
public const string SwitchKnobPart = "PART_SwitchKnob";
public const string MainContainerPart = "PART_MainContainer";

View File

@ -1,5 +1,5 @@
using AtomUI.Media;
using AtomUI.TokenSystem;
using AtomUI.Theme.TokenSystem;
using Avalonia;
using Avalonia.Media;

View File

@ -1,9 +1,10 @@
using Avalonia.Controls;
using AtomUI.Theme;
using Avalonia.Controls;
using Avalonia.Controls.Templates;
namespace AtomUI.Controls;
internal class BaseTabStripTheme : ControlTheme
internal class BaseTabStripTheme : BaseControlTheme
{
public const string MainContainerPart = "Part_MainContainer";
public const string ItemsPresenterPart = "PART_ItemsPresenter";

Some files were not shown because too many files have changed in this diff Show More