Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions ContextMenuManager/BluePointLilac.Methods/ImageExtension.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ public static Image ToTransparent(this Image image, float opacity = 0.5F)
return bitmap;
}

public static Image ToInferredIcon(this Image image, float opacity = 0.5F)
{
return AppConfig.DimInferredIcons ? image.ToTransparent(opacity) : image;
}

public static Image ResizeImage(this Image image, int width, int height)
{
//return image.GetThumbnailImage(width, height, null, System.IntPtr.Zero);//质量稍微低一点
Expand Down
8 changes: 4 additions & 4 deletions ContextMenuManager/Controls/ShellItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public string RegPath
if (List != null)
{
Image = ItemIcon.ToBitmap();
if (!HasIcon) Image = Image.ToTransparent();
if (!HasIcon) Image = Image.ToInferredIcon();
BtnSubItems.Visibility = IsMultiItem ? Visibility.Visible : Visibility.Collapsed;
}
}
Expand Down Expand Up @@ -291,7 +291,7 @@ public string ItemCommand
{
if (!TryProtectOpenItem()) return;
Registry.SetValue(CommandPath, "", value);
if (!HasIcon) Image = ItemIcon.ToBitmap().ToTransparent();
if (!HasIcon) Image = ItemIcon.ToBitmap().ToInferredIcon();
}
}

Expand Down Expand Up @@ -478,7 +478,7 @@ private void DeleteIcon()
{
IconLocation = null;
HasLUAShield = false;
Image = Image.ToTransparent();
Image = Image.ToInferredIcon();
}

private void UseShieldIcon()
Expand All @@ -494,7 +494,7 @@ private void UseShieldIcon()
}
else
{
Image = Image.ToTransparent();
Image = Image.ToInferredIcon();
}
}
}
Expand Down
6 changes: 6 additions & 0 deletions ContextMenuManager/Methods/AppConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,12 @@ public static bool HideSysStoreItems
set => SetGeneralValue("HideSysStoreItems", value ? 1 : 0);
}

public static bool DimInferredIcons
{
get => GetGeneralValue("DimInferredIcons") != "0";
set => SetGeneralValue("DimInferredIcons", value ? 1 : 0);
}

public static bool RequestUseGithub
{
get
Expand Down
1 change: 1 addition & 0 deletions ContextMenuManager/Methods/AppString.cs
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,7 @@ public static class Other
public static string OpenMoreExplorer { get; set; }
public static string HideDisabledItems { get; set; }
public static string HideSysStoreItems { get; set; }
public static string DimInferredIcons { get; set; }
public static string SetPerceivedType { get; set; }
public static string SetDefaultDropEffect { get; set; }
public static string TopMost { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,7 @@ CustomEngine = 自定义
SetCustomEngine = 设置搜索引擎 (以 %s 代替搜索关键词)
HideDisabledItems = 隐藏已禁用的菜单项目
HideSysStoreItems = 隐藏公共引用中的系统菜单
DimInferredIcons = 对推测的图标使用半透明效果
SetPerceivedType = 设置扩展名为 %s 的文件感知类型为
SetDefaultDropEffect = 设置文件对象默认拖拽命令为
TopMost = 使窗口始终在屏幕最上方
Expand Down
21 changes: 21 additions & 0 deletions ContextMenuManager/Views/AppSettingView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,27 @@
OnContent=""
Toggled="HideSysStoreItemsCheckBox_OnChanged" />
</Grid>

<Separator Margin="0,16,0,16" />

<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<StackPanel Margin="0,0,20,0" VerticalAlignment="Center">
<TextBlock x:Name="DimInferredIconsLabel" Style="{StaticResource SettingNameStyle}" />
</StackPanel>
<ui:ToggleSwitch
x:Name="DimInferredIconsCheckBox"
Grid.Column="1"
MinWidth="0"
HorizontalAlignment="Right"
VerticalAlignment="Center"
OffContent=""
OnContent=""
Toggled="DimInferredIconsCheckBox_OnChanged" />
</Grid>
</StackPanel>
</Border>
</Grid>
Expand Down
11 changes: 11 additions & 0 deletions ContextMenuManager/Views/AppSettingView.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ public void RefreshFromConfig()
OpenMoreExplorerCheckBox.IsOn = AppConfig.OpenMoreExplorer;
HideDisabledItemsCheckBox.IsOn = AppConfig.HideDisabledItems;
HideSysStoreItemsCheckBox.IsOn = AppConfig.HideSysStoreItems;
DimInferredIconsCheckBox.IsOn = AppConfig.DimInferredIcons;

var showHideSysStore = WinOsVersion.Current >= WinOsVersion.Win7;
HideSysStoreRow.Visibility = showHideSysStore ? Visibility.Visible : Visibility.Collapsed;
Expand Down Expand Up @@ -110,6 +111,8 @@ private void LoadLabels()

HideSysStoreItemsLabel.Text = AppString.Other.HideSysStoreItems;

DimInferredIconsLabel.Text = AppString.Other.DimInferredIcons;

LoadDynamicOptions();
}

Expand Down Expand Up @@ -282,6 +285,14 @@ private void HideSysStoreItemsCheckBox_OnChanged(object sender, RoutedEventArgs
}
}

private void DimInferredIconsCheckBox_OnChanged(object sender, RoutedEventArgs e)
{
if (!isLoading)
{
AppConfig.DimInferredIcons = DimInferredIconsCheckBox.IsOn;
}
}

private static int GetUpdateSelectIndex()
{
return AppConfig.UpdateFrequency switch
Expand Down
1 change: 1 addition & 0 deletions languages/en-US.ini
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,7 @@ CustomEngine = Custom...
SetCustomEngine = Define search engine (use %s instead of search keywords)
HideDisabledItems = Hide disabled items
HideSysStoreItems = Hide system store items
DimInferredIcons = Dim icons inferred from the item's command
SetPerceivedType = Set %s perceived type...
SetDefaultDropEffect = Set default drop effect
TopMost = Always on top
Expand Down
1 change: 1 addition & 0 deletions languages/zh-CN.ini
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,7 @@ CustomEngine = 自定义
SetCustomEngine = 设置搜索引擎 (以 %s 代替搜索关键词)
HideDisabledItems = 隐藏已禁用的菜单项目
HideSysStoreItems = 隐藏公共引用中的系统菜单
DimInferredIcons = 对推测的图标使用半透明效果
SetPerceivedType = 设置扩展名为 %s 的文件感知类型为
SetDefaultDropEffect = 设置文件对象默认拖拽命令为
TopMost = 使窗口始终在屏幕最上方
Expand Down
Loading