Skip to content

Commit b34f4b5

Browse files
committed
Merge remote-tracking branch 'upstream/master' into strip-menu-mnemonics
# Conflicts: # ContextMenuManager/Methods/AppConfig.cs # ContextMenuManager/Methods/AppString.cs # ContextMenuManager/Properties/Resources/Texts/AppLanguageDic.ini # ContextMenuManager/Views/AppSettingView.xaml # ContextMenuManager/Views/AppSettingView.xaml.cs # languages/en-US.ini # languages/zh-CN.ini
2 parents abf0984 + 3fe7e10 commit b34f4b5

11 files changed

Lines changed: 303 additions & 4 deletions

File tree

ContextMenuManager/BluePointLilac.Methods/ImageExtension.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@ public static Image ToTransparent(this Image image, float opacity = 0.5F)
2020
return bitmap;
2121
}
2222

23+
public static Image ToInferredIcon(this Image image, float opacity = 0.5F)
24+
{
25+
return AppConfig.DimInferredIcons ? image.ToTransparent(opacity) : image;
26+
}
27+
2328
public static Image ResizeImage(this Image image, int width, int height)
2429
{
2530
//return image.GetThumbnailImage(width, height, null, System.IntPtr.Zero);//质量稍微低一点

ContextMenuManager/Controls/ShellItem.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public string RegPath
5252
if (List != null)
5353
{
5454
Image = ItemIcon.ToBitmap();
55-
if (!HasIcon) Image = Image.ToTransparent();
55+
if (!HasIcon) Image = Image.ToInferredIcon();
5656
BtnSubItems.Visibility = IsMultiItem ? Visibility.Visible : Visibility.Collapsed;
5757
}
5858
}
@@ -291,7 +291,7 @@ public string ItemCommand
291291
{
292292
if (!TryProtectOpenItem()) return;
293293
Registry.SetValue(CommandPath, "", value);
294-
if (!HasIcon) Image = ItemIcon.ToBitmap().ToTransparent();
294+
if (!HasIcon) Image = ItemIcon.ToBitmap().ToInferredIcon();
295295
}
296296
}
297297

@@ -478,7 +478,7 @@ private void DeleteIcon()
478478
{
479479
IconLocation = null;
480480
HasLUAShield = false;
481-
Image = Image.ToTransparent();
481+
Image = Image.ToInferredIcon();
482482
}
483483

484484
private void UseShieldIcon()
@@ -494,7 +494,7 @@ private void UseShieldIcon()
494494
}
495495
else
496496
{
497-
Image = Image.ToTransparent();
497+
Image = Image.ToInferredIcon();
498498
}
499499
}
500500
}

ContextMenuManager/Methods/AppConfig.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,12 @@ public static bool StripMenuMnemonics
291291
set => SetGeneralValue("StripMenuMnemonics", value ? 1 : 0);
292292
}
293293

294+
public static bool DimInferredIcons
295+
{
296+
get => GetGeneralValue("DimInferredIcons") != "0";
297+
set => SetGeneralValue("DimInferredIcons", value ? 1 : 0);
298+
}
299+
294300
public static bool RequestUseGithub
295301
{
296302
get

ContextMenuManager/Methods/AppString.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -379,6 +379,7 @@ public static class Other
379379
public static string HideDisabledItems { get; set; }
380380
public static string HideSysStoreItems { get; set; }
381381
public static string StripMenuMnemonics { get; set; }
382+
public static string DimInferredIcons { get; set; }
382383
public static string SetPerceivedType { get; set; }
383384
public static string SetDefaultDropEffect { get; set; }
384385
public static string TopMost { get; set; }

ContextMenuManager/Properties/Resources/Texts/AppLanguageDic.ini

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,7 @@ CommandCannotBeEmpty = 菜单命令不能为空!
215215
StringParsingFailed = 本地化字符串解析失败!
216216
TextLengthCannotExceed80 = 菜单文本过长,长度不允许超过80!
217217
ConfirmDeleteBackupPermanently = 确认是否永久删除此项?\r\n此操作无法还原,请谨慎操作!
218+
ConfirmDeletePermanently = 确认是否永久删除此项?\r\n此操作无法还原,请谨慎操作!
218219
DeleteButCanRestore = 确认删除此菜单的注册表项目?\r\n由于启用了自动备份(默认启用),\r\n删除后可在备份文件夹中还原。
219220
ConfirmDeleteReference = 确认是否移除对该项目的引用?
220221
ConfirmDelete = 确认是否删除该项?
@@ -324,6 +325,7 @@ SetCustomEngine = 设置搜索引擎 (以 %s 代替搜索关键词)
324325
HideDisabledItems = 隐藏已禁用的菜单项目
325326
HideSysStoreItems = 隐藏公共引用中的系统菜单
326327
StripMenuMnemonics = 隐藏菜单项名称中的快捷键符号(&)
328+
DimInferredIcons = 对推测的图标使用半透明效果
327329
SetPerceivedType = 设置扩展名为 %s 的文件感知类型为
328330
SetDefaultDropEffect = 设置文件对象默认拖拽命令为
329331
TopMost = 使窗口始终在屏幕最上方

0 commit comments

Comments
 (0)