mirror of
https://github.com/Hofknecht/SystemTrayMenu.git
synced 2024-05-20 04:12:19 +12:00
[BUG] Remove TaskbarForm (#142), version 1.0.17.4
This commit is contained in:
parent
a45d0d8017
commit
a72defa020
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -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()
|
||||
|
|
|
@ -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")]
|
||||
|
|
13
Properties/Settings.Designer.cs
generated
13
Properties/Settings.Designer.cs
generated
|
@ -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()]
|
||||
|
|
9
Resources/lang.Designer.cs
generated
9
Resources/lang.Designer.cs
generated
|
@ -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>
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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>
|
||||
|
|
22
UserInterface/SettingsForm.Designer.cs
generated
22
UserInterface/SettingsForm.Designer.cs
generated
|
@ -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;
|
||||
}
|
||||
}
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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
Loading…
Reference in a new issue