Skip to content

Commit

Permalink
样式
Browse files Browse the repository at this point in the history
  • Loading branch information
MakesYT committed Oct 1, 2023
1 parent 939f364 commit 3200d69
Show file tree
Hide file tree
Showing 33 changed files with 355 additions and 371 deletions.
8 changes: 0 additions & 8 deletions Core/Class1.cs

This file was deleted.

22 changes: 11 additions & 11 deletions Core/SDKs/CustomScenario/CustomScenario.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,40 +21,40 @@ public partial class CustomScenario : ObservableRecipient
private static readonly ILog Log = LogManager.GetLogger(nameof(CustomScenario));

[JsonIgnore] [ObservableProperty] [NotifyPropertyChangedRecipients]
public bool _isRunning = false;
private bool _isRunning = false;

[JsonIgnore] [ObservableProperty] [NotifyPropertyChangedRecipients]
public bool executionAuto = false;
private bool executionAuto = false;

[JsonIgnore] [ObservableProperty] [NotifyPropertyChangedRecipients]
public List<object> autoScenarios = new();
private List<object> autoScenarios = new();

/// <summary>
/// 手动执行
/// </summary>
[JsonIgnore] [ObservableProperty] [NotifyPropertyChangedRecipients]
public bool executionManual = true;
private bool executionManual = true;

[JsonIgnore] [ObservableProperty] [NotifyPropertyChangedRecipients]
public ObservableCollection<string> keys = new();
private ObservableCollection<string> keys = new();

/// <summary>
/// 间隔指定时间执行
/// </summary>
[JsonIgnore] [ObservableProperty] [NotifyPropertyChangedRecipients]
public bool executionIntervalSpecifies = false;
private bool executionIntervalSpecifies = false;

[JsonIgnore] [ObservableProperty] [NotifyPropertyChangedRecipients]
public List<TimeSpan> intervalSpecifiesTimeSpan;
private List<TimeSpan> intervalSpecifiesTimeSpan;

/// <summary>
/// 指定时间执行
/// </summary>
[JsonIgnore] [ObservableProperty] [NotifyPropertyChangedRecipients]
public bool executionScheduleTime = false;
private bool executionScheduleTime = false;

[JsonIgnore] [ObservableProperty] [NotifyPropertyChangedRecipients]
public TimeSpan scheduleTime;
private TimeSpan scheduleTime;

public string? UUID
{
Expand All @@ -75,10 +75,10 @@ public BindingList<ConnectionItem> connections
} = new();

[JsonIgnore] [ObservableProperty] [NotifyPropertyChangedRecipients]
public string _name = "任务";
private string _name = "任务";

[JsonIgnore] [ObservableProperty] [NotifyPropertyChangedRecipients]
public string _description = "";
private string _description = "";

private Dictionary<PointItem, Task?> _tasks = new();

Expand Down
11 changes: 1 addition & 10 deletions Core/SDKs/SearchViewItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -102,16 +102,7 @@ public void Dispose()
Icon = null;
}

if (FileInfo != null)
{
FileInfo = null;
}

if (Keys != null)
{
Keys.Clear();
Keys = null;
}
GC.SuppressFinalize(this);
}
}

Expand Down
13 changes: 4 additions & 9 deletions Core/ViewModel/Pages/SettingPageViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,9 @@ public partial class SettingPageViewModel : ObservableRecipient
private static readonly ILog log = LogManager.GetLogger("SettingPageViewModel");
private bool _isInitializing = false;

[ObservableProperty] private ObservableCollection<int> _maxHistoryOptions = new ObservableCollection<int>
{ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };
[ObservableProperty] private ObservableCollection<int> _maxHistoryOptions = new() { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };

[ObservableProperty]
private ObservableCollection<string> _themeChoiceOptions = new ObservableCollection<string> { "跟随系统", "深色", "浅色" };
[ObservableProperty] private ObservableCollection<string> _themeChoiceOptions = new() { "跟随系统", "深色", "浅色" };

[ObservableProperty] private bool _autoStart = true;
[ObservableProperty] private bool _autoStartEverything = true;
Expand Down Expand Up @@ -95,8 +93,7 @@ partial void OnThemeChoiceChanged(string value)
}

[RelayCommand]
private async Task DelKey(string key)
{
private async Task DelKey(string key) =>
await Application.Current.Dispatcher.BeginInvoke(() =>
{
IgnoreItems.Remove(key);
Expand All @@ -107,9 +104,7 @@ await Application.Current.Dispatcher.BeginInvoke(() =>
false);
ConfigManger.Save();
});
//ConfigManger.Config.ignoreItems.Remove(key);
}

//ConfigManger.Config.ignoreItems.Remove(key);

partial void OnInputSmoothingMillisecondsChanged(int value)
{
Expand Down
3 changes: 1 addition & 2 deletions uToolkitopia/App.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml"
xmlns:crt="clr-namespace:Kitopia.Converter"
xmlns:c="clr-namespace:Kitopia.Assets"
>
xmlns:c="clr-namespace:Kitopia.Assets">
<Application.Resources>

<ResourceDictionary>
Expand Down
12 changes: 6 additions & 6 deletions uToolkitopia/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -326,20 +326,20 @@ private static IServiceProvider ConfigureServices()
services.AddSingleton<MainWindow>(sq => new MainWindow { DataContext = sq.GetService<MainWindowViewModel>() });
services.AddTransient<SettingPageViewModel>(e => new SettingPageViewModel { IsActive = true });
services.AddTransient<SettingPage>(e =>
new SettingPage() { DataContext = e.GetService<SettingPageViewModel>() });
new SettingPage { DataContext = e.GetService<SettingPageViewModel>() });
services.AddTransient<HomePageViewModel>(e => new HomePageViewModel { IsActive = true });
services.AddTransient<HomePage>(e => new HomePage() { DataContext = e.GetService<HomePageViewModel>() });
services.AddTransient<HomePage>(e => new HomePage { DataContext = e.GetService<HomePageViewModel>() });
services.AddTransient<PluginManagerPageViewModel>(e => new PluginManagerPageViewModel { IsActive = true });
services.AddTransient<PluginManagerPage>(e => new PluginManagerPage()
services.AddTransient<PluginManagerPage>(e => new PluginManagerPage
{ DataContext = e.GetService<PluginManagerPageViewModel>() });
services.AddSingleton<PluginSettingViewModel>(e => new PluginSettingViewModel { IsActive = true });
services.AddSingleton<PluginSetting>(e => new PluginSetting()
services.AddSingleton<PluginSetting>(e => new PluginSetting
{ DataContext = e.GetService<PluginSettingViewModel>() });
services.AddTransient<TaskEditorViewModel>(e => new TaskEditorViewModel { IsActive = true });
services.AddTransient<TaskEditor>(e => new TaskEditor() { DataContext = e.GetService<TaskEditorViewModel>() });
services.AddTransient<TaskEditor>(e => new TaskEditor { DataContext = e.GetService<TaskEditorViewModel>() });
services.AddTransient<CustomScenariosManagerPageViewModel>(e => new CustomScenariosManagerPageViewModel
{ IsActive = true });
services.AddTransient<CustomScenariosManagerPage>(e => new CustomScenariosManagerPage()
services.AddTransient<CustomScenariosManagerPage>(e => new CustomScenariosManagerPage
{ DataContext = e.GetService<CustomScenariosManagerPageViewModel>() });

return services.BuildServiceProvider();
Expand Down
12 changes: 6 additions & 6 deletions uToolkitopia/Assets/ColorD.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,19 @@ namespace Kitopia.Assets;

public class ColorD : ResourceDictionary
{
public static ColorD Instance
{
get;
set;
}

public ColorD()
{
Instance = this;
/*Add("SystemAccentColorSecondary", ColorConverter.ConvertFromString ("#EC407A"));*/
Add("SystemAccentColorSecondary", ((SolidColorBrush)SystemParameters.WindowGlassBrush).Color);
}

public static ColorD Instance
{
get;
set;
}

public void ReloadColor()
{
Remove("SystemAccentColorSecondary");
Expand Down
16 changes: 8 additions & 8 deletions uToolkitopia/Controls/HotKeyShow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,14 @@ public enum KeyTypeE
Shift = 0100
}

public static readonly DependencyProperty KeyTypeProperty = DependencyProperty.Register(nameof(KeyType),
typeof(KeyTypeE), typeof(System.Windows.Controls.Button),
new PropertyMetadata(KeyTypeE.Alt));

public static readonly DependencyProperty KeyNameProperty = DependencyProperty.Register(nameof(KeyName),
typeof(string), typeof(System.Windows.Controls.Button),
new PropertyMetadata("空格"));

[Bindable(true)]
[Category("KeyType")]
public KeyTypeE KeyType
Expand All @@ -33,19 +41,11 @@ public KeyTypeE KeyType
set => SetValue(KeyTypeProperty, value);
}

public static readonly DependencyProperty KeyTypeProperty = DependencyProperty.Register(nameof(KeyType),
typeof(KeyTypeE), typeof(System.Windows.Controls.Button),
new PropertyMetadata(KeyTypeE.Alt));

[Bindable(true)]
[Category("KeyName")]
public string KeyName
{
get => (string)GetValue(KeyNameProperty);
set => SetValue(KeyNameProperty, value);
}

public static readonly DependencyProperty KeyNameProperty = DependencyProperty.Register(nameof(KeyName),
typeof(string), typeof(System.Windows.Controls.Button),
new PropertyMetadata("空格"));
}
18 changes: 9 additions & 9 deletions uToolkitopia/Controls/HotKeyShowItme.cs
Original file line number Diff line number Diff line change
Expand Up @@ -82,15 +82,6 @@ public IconElement? Icon
set => SetValue(IconProperty, value);
}

/// <inheritdoc />
[Bindable(true)]
[Category("Appearance")]
public ControlAppearance Appearance
{
get => (ControlAppearance)GetValue(AppearanceProperty);
set => SetValue(AppearanceProperty, value);
}

/// <summary>
/// Background <see cref="Brush" /> when the user interacts with an element with a pointing device.
/// </summary>
Expand Down Expand Up @@ -145,4 +136,13 @@ public Brush PressedBorderBrush
get => (Brush)GetValue(PressedBorderBrushProperty);
set => SetValue(PressedBorderBrushProperty, value);
}

/// <inheritdoc />
[Bindable(true)]
[Category("Appearance")]
public ControlAppearance Appearance
{
get => (ControlAppearance)GetValue(AppearanceProperty);
set => SetValue(AppearanceProperty, value);
}
}
Loading

0 comments on commit 3200d69

Please sign in to comment.