Skip to content

Commit

Permalink
Changes for windows 11, added OpenShell to feed
Browse files Browse the repository at this point in the history
  • Loading branch information
hellzerg committed Jul 15, 2021
1 parent 85347d5 commit 8747ce8
Show file tree
Hide file tree
Showing 9 changed files with 274 additions and 66 deletions.
3 changes: 2 additions & 1 deletion Optimizer/Enums.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ internal enum WindowsVersion
Unsupported,
Windows7,
Windows8,
Windows10
Windows10,
Windows11
}

public enum StartupItemLocation
Expand Down
196 changes: 139 additions & 57 deletions Optimizer/MainForm.Designer.cs

Large diffs are not rendered by default.

80 changes: 74 additions & 6 deletions Optimizer/MainForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,62 @@ private void EnableToggleEvents()
stickySw.Click += new EventHandler(ToggleSwitch38_Click);
longPathsSw.Click += new EventHandler(ToggleSwitch39_Click);
castSw.Click += new EventHandler(ToggleSwitch40_Click);
leftTaskbarSw.Click += LeftTaskbarSw_Click;
snapAssistSw.Click += SnapAssistSw_Click;
widgetsSw.Click += WidgetsSw_Click;
smallerTaskbarSw.Click += SmallerTaskbarSw_Click;
}

private void SmallerTaskbarSw_Click(object sender, EventArgs e)
{
if (!smallerTaskbarSw.Checked)
{
Optimize.SmallerTaskbar();
}
else
{
Optimize.DefaultTaskbarSize();
}
//Options.CurrentOptions.DisableActionCenter = !actionSw.Checked;
}

private void WidgetsSw_Click(object sender, EventArgs e)
{
if (!widgetsSw.Checked)
{
Optimize.DisableWidgets();
}
else
{
Optimize.EnableWidgets();
}
//Options.CurrentOptions.DisableActionCenter = !actionSw.Checked;
}

private void SnapAssistSw_Click(object sender, EventArgs e)
{
if (!snapAssistSw.Checked)
{
Optimize.DisableSnapAssist();
}
else
{
Optimize.EnableSnapAssist();
}
//Options.CurrentOptions.DisableActionCenter = !actionSw.Checked;
}

private void LeftTaskbarSw_Click(object sender, EventArgs e)
{
if (!leftTaskbarSw.Checked)
{
Optimize.AlignTaskbarToLeft();
}
else
{
Optimize.AlignTaskbarToCenter();
}
//Options.CurrentOptions.DisableActionCenter = !actionSw.Checked;
}

private void SetHelpBoxTranslation()
Expand Down Expand Up @@ -440,35 +496,47 @@ public MainForm()
if (Utilities.CurrentWindowsVersion == WindowsVersion.Unsupported)
{
tabCollection.TabPages.Remove(universalTab);
tabCollection.TabPages.Remove(windowsVIIITab);
tabCollection.TabPages.Remove(windowsXTab);
tabCollection.TabPages.Remove(windows8Tab);
tabCollection.TabPages.Remove(windows10Tab);
tabCollection.TabPages.Remove(windows11Tab);
tabCollection.TabPages.Remove(modernAppsTab);
}

if (Utilities.CurrentWindowsVersion == WindowsVersion.Windows7)
{
LoadUniversalToggleStates();
tabCollection.TabPages.Remove(windowsVIIITab);
tabCollection.TabPages.Remove(windowsXTab);
tabCollection.TabPages.Remove(windows8Tab);
tabCollection.TabPages.Remove(windows10Tab);
tabCollection.TabPages.Remove(windows11Tab);
tabCollection.TabPages.Remove(modernAppsTab);
}

if (Utilities.CurrentWindowsVersion == WindowsVersion.Windows8)
{
LoadUniversalToggleStates();
LoadWindowsVIIIToggleStates();
tabCollection.TabPages.Remove(windowsXTab);
tabCollection.TabPages.Remove(windows10Tab);
tabCollection.TabPages.Remove(windows11Tab);
GetModernApps(false);
}

if (Utilities.CurrentWindowsVersion == WindowsVersion.Windows10)
{
LoadUniversalToggleStates();
LoadWindowsXToggleStates();
tabCollection.TabPages.Remove(windowsVIIITab);
tabCollection.TabPages.Remove(windows8Tab);
//tabCollection.TabPages.Remove(windows11Tab);
GetModernApps(false);
}

//if (Utilities.CurrentWindowsVersion == WindowsVersion.Windows11)
//{
// // load toggles ...
// tabCollection.TabPages.Remove(windows8Tab);
// //tabCollection.TabPages.Remove(windows10Tab);
// GetModernApps(false);
//}

_columnSorter = new ListViewColumnSorter();
listStartupItems.ListViewItemSorter = _columnSorter;

Expand Down
53 changes: 53 additions & 0 deletions Optimizer/Optimize.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1314,5 +1314,58 @@ internal static void EnableActionCenter()
Registry.CurrentUser.OpenSubKey(@"SOFTWARE\Policies\Microsoft\Windows\Explorer", true).DeleteValue("DisableNotificationCenter", false);
Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\PushNotifications", true).DeleteValue("ToastEnabled", false);
}

/* Windows 11 tweaks */

// DEPRECATED
//internal static void EnableWindows10Start()
//{
// Registry.SetValue(@"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced", "Start_ShowClassicMode", "1", RegistryValueKind.DWord);
//}

//internal static void DisableWindows10Start()
//{
// Registry.SetValue(@"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced", "Start_ShowClassicMode", "0", RegistryValueKind.DWord);
//}

internal static void AlignTaskbarToLeft()
{
Registry.SetValue(@"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced", "TaskbarAl", "0", RegistryValueKind.DWord);
}

internal static void AlignTaskbarToCenter()
{
Registry.SetValue(@"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced", "TaskbarAl", "1", RegistryValueKind.DWord);
}

internal static void DisableSnapAssist()
{
Registry.SetValue(@"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced", "EnableSnapAssistFlyout", "0", RegistryValueKind.DWord);
}

internal static void EnableSnapAssist()
{
Registry.SetValue(@"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced", "EnableSnapAssistFlyout", "1", RegistryValueKind.DWord);
}

internal static void DisableWidgets()
{
Registry.SetValue(@"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced", "TaskbarDa", "0", RegistryValueKind.DWord);
}

internal static void EnableWidgets()
{
Registry.SetValue(@"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced", "TaskbarDa", "1", RegistryValueKind.DWord);
}

internal static void SmallerTaskbar()
{
Registry.SetValue(@"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced", "TaskbarSi", "0", RegistryValueKind.DWord);
}

internal static void DefaultTaskbarSize()
{
Registry.SetValue(@"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced", "TaskbarSi", "1", RegistryValueKind.DWord);
}
}
}
2 changes: 1 addition & 1 deletion Optimizer/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ static class Program
// Enter current version here

internal readonly static float Major = 9;
internal readonly static float Minor = 5;
internal readonly static float Minor = 6;

internal readonly static bool EXPERIMENTAL_BUILD = false;

Expand Down
4 changes: 4 additions & 0 deletions Optimizer/Utilities.cs
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,10 @@ internal static string GetOS()
{
CurrentWindowsVersion = WindowsVersion.Windows10;
}
if (os.Contains("Windows 11"))
{
CurrentWindowsVersion = WindowsVersion.Windows11;
}

if (Program.UNSAFE_MODE)
{
Expand Down
2 changes: 1 addition & 1 deletion feed.json

Large diffs are not rendered by default.

Binary file modified images/feed.zip
Binary file not shown.
Binary file added images/feed/openshell.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 8747ce8

Please sign in to comment.