Skip to content

Commit

Permalink
添加设置新图标;支持背景修改;数据库重构初步完成
Browse files Browse the repository at this point in the history
  • Loading branch information
DearVa committed Aug 30, 2022
1 parent 65ccc6e commit 3b3fa0b
Show file tree
Hide file tree
Showing 61 changed files with 1,490 additions and 1,369 deletions.
191 changes: 189 additions & 2 deletions ExplorerEx/Assets/Geometries.xaml

Large diffs are not rendered by default.

31 changes: 20 additions & 11 deletions ExplorerEx/Assets/Settings.xml
Original file line number Diff line number Diff line change
@@ -1,33 +1,42 @@
<settings>
<category header="Appearance">
<expander header="Theme" icon="BrushDrawingImage">
<item header="WindowBackdrop" description="#WindowBackdropDescription" type="select">
<item header="Language" description="#LanguageDescription" icon="LanguageDrawingImage" type="select">
<option header="Chinese" value="2052"/>
<option header="English" value="1033"/>
</item>
<expander header="Background" icon="BrushDrawingImage">
<item header="WindowBackdrop" icon="BackgroundDrawingImage" type="select">
<option header="SolidColor"/>
<option header="Acrylic"/>
<option header="MicaWindows11Only"/>
</item>
<item header="ColorMode" description="#ColorModeDescription" type="select">
<option header="FollowSystem"/>
<option header="ColorMode-Light"/>
<option header="ColorMode-Dark"/>
<item header="BackgroundImage" icon="ImageDrawingImage" description="#BackgroundImageDescription" type="string">
<browse type="file" filter="Image|*.png;*.jpg;*.bmp"/>
</item>
<item header="BackgroundImageOpacity" icon="BlurDrawingImage" type="number" min="0" max="1" default="0.8"/>
</expander>
<item header="ColorMode" icon="ColorDrawingImage" type="select">
<option header="FollowSystem"/>
<option header="ColorMode-Light"/>
<option header="ColorMode-Dark"/>
</item>
</category>

<category header="Common">
<item header="DefaultTextEditor" description="#DefaultTextEditorDescription" type="string" default="notepad.exe">
<browseDialog type="file" filter=".exe"/>
<item header="DefaultTextEditor" icon="TextEditorDrawingImage" description="#DefaultTextEditorDescription" type="string" default="notepad.exe">
<browse type="file" filter="Application|*.exe"/>
</item>
<item header="DoubleClickGoUpperLevel" description="#DoubleClickGoUpperLevelDescription" type="boolean" default="true"/>
<item header="DoubleClickGoUpperLevel" icon="ClickDrawingImage" description="#DoubleClickGoUpperLevelDescription" type="boolean" default="true"/>
</category>

<category header="Customize">
<item header="DontAskWhenClosingMultiTabs" type="boolean" default="false"/>
<item header="DontAskWhenRecycle" type="boolean" default="false"/>
<item header="DontAskWhenDelete" type="boolean" default="false"/>
</category>

<category header="Advanced">
<item header="ShowHiddenFilesAndFolders" description="#ShowHiddenFilesAndFoldersDescription" type="boolean" default="false"/>
<item header="ShowProtectedSystemFilesAndFolders" description="#ShowProtectedSystemFilesAndFoldersDescription" type="boolean" default="false"/>
<item header="ShowHiddenFilesAndFolders" icon="EyeDrawingImage" type="boolean" default="false"/>
<item header="ShowProtectedSystemFilesAndFolders" icon="EyeDrawingImage" type="boolean" default="false"/>
</category>
</settings>
Binary file removed ExplorerEx/Assets/Svg.zip
Binary file not shown.
3 changes: 3 additions & 0 deletions ExplorerEx/Assets/Svg/Background.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions ExplorerEx/Assets/Svg/Blur.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions ExplorerEx/Assets/Svg/Click.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions ExplorerEx/Assets/Svg/Color.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions ExplorerEx/Assets/Svg/Eye.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions ExplorerEx/Assets/Svg/Image.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions ExplorerEx/Assets/Svg/Language.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion ExplorerEx/Assets/Svg/Share.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions ExplorerEx/Assets/Svg/TextEditor.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 10 additions & 5 deletions ExplorerEx/Command/FileItemCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ public class FileItemCommand : ICommand {
}
var items = Items;
switch (items.Count) {
case <= 0:
case 0:
return;
case 1:
FileTabControl.MouseOverTabControl?.SelectedTab.StartRename(items[0]);
Expand All @@ -141,16 +141,20 @@ public class FileItemCommand : ICommand {
}
break;
}
case "Delete": // 删除一个或多个文件,按住shift就是强制删除
case "Delete": { // 删除一个或多个文件,按住shift就是强制删除
if (Folder.IsReadonly) {
break;
}
if ((Keyboard.Modifiers & ModifierKeys.Shift) != ModifierKeys.Shift) { // 没有按Shift
var items = Items;
if (items.Count == 0) {
break;
}
if ((Keyboard.Modifiers & ModifierKeys.Shift) != ModifierKeys.Shift) { // 没有按Shift
if (!ContentDialog.ShowWithDefault(Settings.CommonSettings.DontAskWhenRecycle, "#AreYouSureToRecycleTheseFiles".L())) {
return;
}
try {
await FileUtils.FileOperation(FileOpType.Delete, Items.Where(item => item is FileSystemItem).Select(item => item.FullPath).ToArray());
await FileUtils.FileOperation(FileOpType.Delete, items.Where(item => item is FileSystemItem).Select(item => item.FullPath).ToArray());
} catch (Exception e) {
Logger.Exception(e);
}
Expand All @@ -159,7 +163,7 @@ public class FileItemCommand : ICommand {
return;
}
var failedFiles = new List<string>();
foreach (var item in Items) {
foreach (var item in items) {
if (item is FileSystemItem fsi) {
try {
if (fsi.IsFolder) {
Expand All @@ -178,6 +182,7 @@ public class FileItemCommand : ICommand {
}
}
break;
}
case "AddToBookmarks":
TabControlProvider.Invoke()?.MainWindow.AddToBookmarks(Items.Select(i => i.FullPath).ToArray());
break;
Expand Down
8 changes: 4 additions & 4 deletions ExplorerEx/Converter/DictionaryConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
namespace ExplorerEx.Converter;

public class DependencyKeyValuePair : DependencyObject {
public object Key { get; set; }
public object Key { get; set; } = null!;

public static readonly DependencyProperty ValueProperty = DependencyProperty.Register(
"Value", typeof(object), typeof(DependencyKeyValuePair), new PropertyMetadata(default(object)));
nameof(Value), typeof(object), typeof(DependencyKeyValuePair), new PropertyMetadata(default(object)));

public object Value {
get => GetValue(ValueProperty);
Expand Down Expand Up @@ -42,7 +42,7 @@ public class DictionaryConverter : IValueConverter {
};
}

public object Convert(object value, Type targetType, object parameter, CultureInfo culture) {
public object? Convert(object? value, Type targetType, object parameter, CultureInfo culture) {
if (value == null) {
return null;
}
Expand All @@ -53,6 +53,6 @@ public class DictionaryConverter : IValueConverter {
}

public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) {
throw new NotImplementedException();
throw new InvalidOperationException();
}
}
16 changes: 9 additions & 7 deletions ExplorerEx/Converter/FileAssocTemplateSelector.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,16 @@
using System.Windows.Controls;
using ExplorerEx.Model;

namespace ExplorerEx.Converter;
namespace ExplorerEx.Converter;

internal class FileAssocTemplateSelector : StyleSelector {
public Style DefaultStyle { get; set; }
internal class FileAssocTemplateSelector : StyleSelector
{
public Style DefaultStyle { get; set; } = null!;

public Style CustomStyle { get; set; }
public Style CustomStyle { get; set; } = null!;

public override Style SelectStyle(object item, DependencyObject container) {
return item is FileAssocItem ? CustomStyle : DefaultStyle;
}
public override Style SelectStyle(object item, DependencyObject container)
{
return item is FileAssocItem ? CustomStyle : DefaultStyle;
}
}
7 changes: 5 additions & 2 deletions ExplorerEx/Converter/FileViewItemDetailsConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,11 @@ internal class SelectedItemsCount2TextConverter : IValueConverter {

internal class ItemsCount2TextConverter : IValueConverter {
public object? Convert(object value, Type targetType, object parameter, CultureInfo culture) {
if (value is int i and > 0) {
return string.Format("...Items".L(), i);
if (value is int i) {
if (i > 1) {
return string.Format("...Items".L(), i);
}
return string.Format("...Item".L(), i);
}
return null;
}
Expand Down

0 comments on commit 3b3fa0b

Please sign in to comment.