Skip to content

Commit

Permalink
Add ShowInTaskbar option.
Browse files Browse the repository at this point in the history
  • Loading branch information
Si13n7 committed Dec 11, 2023
1 parent 5fc5bec commit 2cdbcca
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
10 changes: 10 additions & 0 deletions src/AppsLauncher/Data/AppsLauncherSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ public sealed class AppsLauncherSettings : IDisposable, ISerializable, IEquatabl
/// </summary>
public bool ShowCaption { get; set; }

public bool ShowInTaskbar { get; set; }

/// <summary>
/// Determines whether the apps images are large.
/// </summary>
Expand Down Expand Up @@ -174,6 +176,9 @@ private AppsLauncherSettings(SerializationInfo info, StreamingContext context)
case nameof(ShowCaption):
ShowCaption = info.GetBoolean(nameof(ShowCaption));
break;
case nameof(ShowInTaskbar):
ShowInTaskbar = info.GetBoolean(nameof(ShowInTaskbar));
break;
case nameof(ShowLargeImages):
ShowLargeImages = info.GetBoolean(nameof(ShowLargeImages));
break;
Expand Down Expand Up @@ -264,6 +269,7 @@ public void GetObjectData(SerializationInfo info, StreamingContext context)

/*
info.AddValue(nameof(ShowCaption), ShowCaption);
info.AddValue(nameof(ShowInTaskbar), ShowInTaskbar);
info.AddValue(nameof(ShowLargeImages), ShowLargeImages);
info.AddValue(nameof(ShowHorScrollBar), ShowHorScrollBar);
info.AddValue(nameof(OpacityLevel), OpacityLevel);
Expand Down Expand Up @@ -299,6 +305,7 @@ public void GetObjectData(SerializationInfo info, StreamingContext context)
public bool Equals(AppsLauncherSettings other) =>
other != null &&
ShowCaption == other.ShowCaption &&
ShowInTaskbar == other.ShowInTaskbar &&
ShowLargeImages == other.ShowLargeImages &&
ShowHorScrollBar == other.ShowHorScrollBar &&
Math.Abs(OpacityLevel - other.OpacityLevel) < 0d &&
Expand Down Expand Up @@ -351,6 +358,7 @@ public override string ToString() =>
public void SetDefaults()
{
ShowCaption = false;
ShowInTaskbar = false;
ShowLargeImages = false;
ShowHorScrollBar = false;
OpacityLevel = .85d;
Expand Down Expand Up @@ -434,6 +442,7 @@ public void LoadFromFile(bool force = false)
if (item == default)
return;
ShowCaption = item.ShowCaption;
ShowInTaskbar = item.ShowInTaskbar;
ShowLargeImages = item.ShowLargeImages;
ShowHorScrollBar = item.ShowHorScrollBar;
OpacityLevel = item.OpacityLevel;
Expand Down Expand Up @@ -498,6 +507,7 @@ private bool IsDefault(PropertyInfo pi) =>
pi?.Name switch
{
nameof(ShowCaption) => !ShowCaption,
nameof(ShowInTaskbar) => !ShowInTaskbar,
nameof(ShowLargeImages) => !ShowLargeImages,
nameof(ShowHorScrollBar) => !ShowHorScrollBar,
nameof(OpacityLevel) => Math.Abs(OpacityLevel - .85d) == 0,
Expand Down
1 change: 0 additions & 1 deletion src/AppsLauncher/Windows/MenuViewForm.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions src/AppsLauncher/Windows/MenuViewForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ public MenuViewForm()
SuspendLayout();

Icon = Resources.PaLogoSymbol;
if (SettingsNew.ShowInTaskbar)
ShowInTaskbar = true;

BackColor = SettingsNew.WindowColors.TryGetValue(ColorOption.Back, DefaultBackColor);
if (SettingsNew.WindowBackground != default)
Expand Down

0 comments on commit 2cdbcca

Please sign in to comment.