[BUG] Remove TaskbarForm (#142), version 1.0.17.4

This commit is contained in:
Markus Hofknecht 2020-10-24 20:03:00 +02:00
parent a45d0d8017
commit a72defa020
11 changed files with 7 additions and 2224 deletions

View file

@ -17,7 +17,6 @@ namespace SystemTrayMenu
{
private readonly AppNotifyIcon menuNotifyIcon = new AppNotifyIcon();
private readonly Menus menus = new Menus();
private readonly TaskbarForm taskbarForm = null;
public App()
{
@ -35,56 +34,13 @@ namespace SystemTrayMenu
menuNotifyIcon.OpenLog += Log.OpenLogFile;
menus.MainPreload();
if (!Properties.Settings.Default.HideTaskbarForm)
{
taskbarForm = new TaskbarForm();
taskbarForm.Activated += TasbkarItemActivated;
void TasbkarItemActivated(object sender, EventArgs e)
{
SetStateNormal();
taskbarForm.Activate();
taskbarForm.Focus();
menus.SwitchOpenCloseByTaskbarItem();
}
taskbarForm.Resize += TaskbarForm_Resize;
taskbarForm.FormClosed += TaskbarForm_FormClosed;
static void TaskbarForm_FormClosed(object sender, FormClosedEventArgs e)
{
Application.Exit();
}
taskbarForm.Deactivate += TaskbarForm_Deactivate;
void TaskbarForm_Resize(object sender, EventArgs e)
{
SetStateNormal();
}
}
DllImports.NativeMethods.User32ShowInactiveTopmost(taskbarForm);
}
public void Dispose()
{
taskbarForm?.Dispose();
SystemEvents.DisplaySettingsChanged -= AppRestart.ByDisplaySettings;
menus.Dispose();
menuNotifyIcon.Dispose();
}
private void TaskbarForm_Deactivate(object sender, EventArgs e)
{
SetStateNormal();
}
/// <summary>
/// This ensures that next click on taskbaritem works as activate event/click event.
/// </summary>
private void SetStateNormal()
{
if (Form.ActiveForm == taskbarForm)
{
taskbarForm.WindowState = FormWindowState.Normal;
}
}
}
}

View file

@ -438,12 +438,6 @@ namespace SystemTrayMenu.Business
return menuData;
}
internal void SwitchOpenCloseByTaskbarItem()
{
SwitchOpenClose(true);
timerStillActiveCheck.Start();
}
internal void SwitchOpenClose(bool byClick)
{
waitToOpenMenu.MouseActive = byClick;
@ -588,8 +582,7 @@ namespace SystemTrayMenu.Business
private static bool IsActive()
{
return Form.ActiveForm is Menu ||
Form.ActiveForm is UserInterface.TaskbarForm;
return Form.ActiveForm is Menu;
}
private static void OpenFolder()

View file

@ -39,5 +39,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.17.3")]
[assembly: AssemblyFileVersion("1.0.17.3")]
[assembly: AssemblyVersion("1.0.17.4")]
[assembly: AssemblyFileVersion("1.0.17.4")]

View file

@ -88,19 +88,6 @@ namespace SystemTrayMenu.Properties {
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Configuration.SettingsProviderAttribute(typeof(CustomSettingsProvider))]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("False")]
public bool HideTaskbarForm {
get {
return ((bool)(this["HideTaskbarForm"]));
}
set {
this["HideTaskbarForm"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Configuration.SettingsProviderAttribute(typeof(CustomSettingsProvider))]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]

View file

@ -204,15 +204,6 @@ namespace SystemTrayMenu.Resources {
}
}
/// <summary>
/// Looks up a localized string similar to Hide Taskbar Icon.
/// </summary>
internal static string Hide_Taskbar_Icon {
get {
return ResourceManager.GetString("Hide Taskbar Icon", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Hotkey.
/// </summary>

View file

@ -198,9 +198,6 @@
<data name="Expert" xml:space="preserve">
<value>Experte</value>
</data>
<data name="Hide Taskbar Icon" xml:space="preserve">
<value>Taskbar Icon verstecken</value>
</data>
<data name="Single click to start item" xml:space="preserve">
<value>Öffnen durch einfachen Klick</value>
</data>

View file

@ -198,9 +198,6 @@
<data name="Expert" xml:space="preserve">
<value>Expert</value>
</data>
<data name="Hide Taskbar Icon" xml:space="preserve">
<value>Hide Taskbar Icon</value>
</data>
<data name="Single click to start item" xml:space="preserve">
<value>Single-click to open an item</value>
</data>

View file

@ -55,7 +55,6 @@ namespace SystemTrayMenu.UserInterface
this.tabPageExpert = new System.Windows.Forms.TabPage();
this.tableLayoutPanelExpert = new System.Windows.Forms.TableLayoutPanel();
this.checkBoxOpenItemWithOneClick = new System.Windows.Forms.CheckBox();
this.checkBoxHideTaskbarForm = new System.Windows.Forms.CheckBox();
this.checkBoxDarkModeAlwaysOn = new System.Windows.Forms.CheckBox();
this.tableLayoutPanelMain.SuspendLayout();
this.tabControlExpert.SuspendLayout();
@ -345,13 +344,11 @@ namespace SystemTrayMenu.UserInterface
this.tableLayoutPanelExpert.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
this.tableLayoutPanelExpert.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
this.tableLayoutPanelExpert.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 12F));
this.tableLayoutPanelExpert.Controls.Add(this.checkBoxDarkModeAlwaysOn, 0, 2);
this.tableLayoutPanelExpert.Controls.Add(this.checkBoxOpenItemWithOneClick, 0, 1);
this.tableLayoutPanelExpert.Controls.Add(this.checkBoxHideTaskbarForm, 0, 0);
this.tableLayoutPanelExpert.Controls.Add(this.checkBoxOpenItemWithOneClick, 0, 0);
this.tableLayoutPanelExpert.Controls.Add(this.checkBoxDarkModeAlwaysOn, 0, 1);
this.tableLayoutPanelExpert.Location = new System.Drawing.Point(3, 3);
this.tableLayoutPanelExpert.Name = "tableLayoutPanelExpert";
this.tableLayoutPanelExpert.RowCount = 4;
this.tableLayoutPanelExpert.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tableLayoutPanelExpert.RowCount = 3;
this.tableLayoutPanelExpert.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tableLayoutPanelExpert.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tableLayoutPanelExpert.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 40F));
@ -370,18 +367,6 @@ namespace SystemTrayMenu.UserInterface
this.checkBoxOpenItemWithOneClick.Text = "checkBoxOpenItemWithOneClick";
this.checkBoxOpenItemWithOneClick.UseVisualStyleBackColor = true;
//
// checkBoxHideTaskbarForm
//
this.checkBoxHideTaskbarForm.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
this.checkBoxHideTaskbarForm.AutoSize = true;
this.checkBoxHideTaskbarForm.Location = new System.Drawing.Point(9, 7);
this.checkBoxHideTaskbarForm.Margin = new System.Windows.Forms.Padding(9, 7, 9, 0);
this.checkBoxHideTaskbarForm.Name = "checkBoxHideTaskbarForm";
this.checkBoxHideTaskbarForm.Size = new System.Drawing.Size(185, 17);
this.checkBoxHideTaskbarForm.TabIndex = 107;
this.checkBoxHideTaskbarForm.Text = "checkBoxShowTaskbarForm";
this.checkBoxHideTaskbarForm.UseVisualStyleBackColor = true;
//
// tableLayoutPanelBottom
//
this.tableLayoutPanelBottom.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
@ -507,7 +492,6 @@ namespace SystemTrayMenu.UserInterface
private System.Windows.Forms.TabPage tabPageExpert;
private System.Windows.Forms.TableLayoutPanel tableLayoutPanelExpert;
private System.Windows.Forms.CheckBox checkBoxOpenItemWithOneClick;
private System.Windows.Forms.CheckBox checkBoxHideTaskbarForm;
private System.Windows.Forms.CheckBox checkBoxDarkModeAlwaysOn;
}
}

View file

@ -35,7 +35,6 @@ namespace SystemTrayMenu.UserInterface
checkBoxAutostart.Text = Translator.GetText("Launch on startup");
labelHotkey.Text = Translator.GetText("Hotkey");
labelLanguage.Text = Translator.GetText("Language");
checkBoxHideTaskbarForm.Text = Translator.GetText("Hide Taskbar Icon");
checkBoxOpenItemWithOneClick.Text = Translator.GetText("Single click to start item");
checkBoxDarkModeAlwaysOn.Text = Translator.GetText("Dark Mode always active");
buttonOk.Text = Translator.GetText("buttonOk");
@ -80,7 +79,6 @@ namespace SystemTrayMenu.UserInterface
}
}
checkBoxHideTaskbarForm.Checked = Properties.Settings.Default.HideTaskbarForm;
checkBoxOpenItemWithOneClick.Checked = Properties.Settings.Default.OpenItemWithOneClick;
checkBoxDarkModeAlwaysOn.Checked = Properties.Settings.Default.IsDarkModeAlwaysOn;
}
@ -296,7 +294,6 @@ namespace SystemTrayMenu.UserInterface
private void SetExpertOptions()
{
Properties.Settings.Default.HideTaskbarForm = checkBoxHideTaskbarForm.Checked;
Properties.Settings.Default.OpenItemWithOneClick = checkBoxOpenItemWithOneClick.Checked;
Properties.Settings.Default.IsDarkModeAlwaysOn = checkBoxDarkModeAlwaysOn.Checked;
}

View file

@ -1,34 +0,0 @@
// <copyright file="TaskbarForm.cs" company="PlaceholderCompany">
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace SystemTrayMenu.UserInterface
{
using System.Drawing;
using System.Windows.Forms;
public partial class TaskbarForm : Form
{
public TaskbarForm()
{
InitializeComponent();
SetLocation();
}
private void TaskbarForm_LocationChanged(object sender, System.EventArgs e)
{
SetLocation();
}
/// <summary>
/// Hide below taskbar.
/// </summary>
private void SetLocation()
{
Screen screen = Screen.PrimaryScreen;
Location = new Point(
screen.Bounds.Right - Size.Width,
screen.Bounds.Bottom + 80);
}
}
}

File diff suppressed because it is too large Load diff