[Feature] Stay open when 'Enter' pressed and reactivated within 200ms (#226), version 1.0.24.3

This commit is contained in:
Markus Hofknecht 2021-10-26 22:09:40 +02:00
parent bf1629eb4c
commit ceb128b702
21 changed files with 404 additions and 61 deletions

View file

@ -53,7 +53,7 @@ namespace SystemTrayMenu.Handler
try
{
hook.RegisterHotKey();
hook.KeyPressed += (s, e) => HotKeyPressed?.Invoke();
hook.KeyPressed += (sender, e) => HotKeyPressed?.Invoke();
}
catch (InvalidOperationException ex)
{

View file

@ -244,10 +244,10 @@ namespace SystemTrayMenu.Business
menu.AdjustScrollbar();
}
timerShowProcessStartedAsLoadingIcon.Interval = 250;
timerShowProcessStartedAsLoadingIcon.Interval = Properties.Settings.Default.TimeUntilClosesAfterEnterPressed;
timerStillActiveCheck.Interval = 1000;
timerStillActiveCheck.Tick += StillActiveTick;
void StillActiveTick(object senderTimer, EventArgs eTimer)
timerStillActiveCheck.Tick += (sender, e) => StillActiveTick();
void StillActiveTick()
{
if (!IsActive())
{
@ -668,20 +668,24 @@ namespace SystemTrayMenu.Business
menu.Deactivate += Deactivate;
void Deactivate(object sender, EventArgs e)
{
FadeHalfOrOutIfNeeded();
if (!IsActive())
if (!Properties.Settings.Default.StaysOpenWhenFocusLostAfterEnterPressed ||
!timerStillActiveCheck.Enabled)
{
deactivatedTime = DateTime.Now;
FadeHalfOrOutIfNeeded();
if (!IsActive())
{
deactivatedTime = DateTime.Now;
}
}
}
menu.Activated += Activated;
void Activated(object sender, EventArgs e)
menu.Activated += (sender, e) => Activated();
void Activated()
{
if (IsActive() &&
menus[0].IsUsable)
if (IsActive() && menus[0].IsUsable)
{
AsList.ForEach(m => m.ShowWithFade());
timerStillActiveCheck.Stop();
timerStillActiveCheck.Start();
}
}
@ -881,9 +885,18 @@ namespace SystemTrayMenu.Business
row.Cells[0].Value = rowData.ReadLoadedIcon();
timerShowProcessStartedAsLoadingIcon.Tick -= Tick;
timerShowProcessStartedAsLoadingIcon.Stop();
if (Properties.Settings.Default.StaysOpenWhenFocusLostAfterEnterPressed)
{
timerStillActiveCheck.Stop();
FadeHalfOrOutIfNeeded();
}
}
timerShowProcessStartedAsLoadingIcon.Stop();
timerShowProcessStartedAsLoadingIcon.Start();
timerStillActiveCheck.Stop();
timerStillActiveCheck.Start();
}
}
}

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.24.2")]
[assembly: AssemblyFileVersion("1.0.24.2")]
[assembly: AssemblyVersion("1.0.24.3")]
[assembly: AssemblyFileVersion("1.0.24.3")]

View file

@ -283,6 +283,38 @@ namespace SystemTrayMenu.Properties
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Configuration.SettingsProviderAttribute(typeof(CustomSettingsProvider))]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("true")]
public bool StaysOpenWhenFocusLostAfterEnterPressed
{
get
{
return ((bool)(this["StaysOpenWhenFocusLostAfterEnterPressed"]));
}
set
{
this["StaysOpenWhenFocusLostAfterEnterPressed"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Configuration.SettingsProviderAttribute(typeof(CustomSettingsProvider))]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("200")]
public int TimeUntilClosesAfterEnterPressed
{
get
{
return ((int)(this["TimeUntilClosesAfterEnterPressed"]));
}
set
{
this["TimeUntilClosesAfterEnterPressed"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Configuration.SettingsProviderAttribute(typeof(CustomSettingsProvider))]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]

View file

@ -321,6 +321,15 @@ namespace SystemTrayMenu.Resources {
}
}
/// <summary>
/// Looks up a localized string similar to Expert.
/// </summary>
internal static string Expert {
get {
return ResourceManager.GetString("Expert", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Folder.
/// </summary>
@ -402,6 +411,15 @@ namespace SystemTrayMenu.Resources {
}
}
/// <summary>
/// Looks up a localized string similar to If the focus is lost and the Enter key was pressed.
/// </summary>
internal static string If_the_focus_is_lost_and_the_Enter_key_was_pressed {
get {
return ResourceManager.GetString("If the focus is lost and the Enter key was pressed", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Language.
/// </summary>
@ -474,6 +492,15 @@ namespace SystemTrayMenu.Resources {
}
}
/// <summary>
/// Looks up a localized string similar to Milliseconds until the menu closes if in this case the menu is not reactivated.
/// </summary>
internal static string Milliseconds_until_the_menu_closes_if_in_this_case_the_menu_is_not_reactivated {
get {
return ResourceManager.GetString("Milliseconds until the menu closes if in this case the menu is not reactivated", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Milliseconds until the menu closes if in this case the mouse then leaves the menu.
/// </summary>

View file

@ -354,4 +354,13 @@
<data name="Task Manger" xml:space="preserve">
<value>Správce úloh</value>
</data>
<data name="Expert" xml:space="preserve">
<value>Expert</value>
</data>
<data name="If the focus is lost and the Enter key was pressed" xml:space="preserve">
<value>Pokud dojde ke ztrátě fokusu a byla stisknuta klávesa Enter</value>
</data>
<data name="Milliseconds until the menu closes if in this case the menu is not reactivated" xml:space="preserve">
<value>Milisekundy, než se nabídka zavře, pokud v tomto případě není nabídka znovu aktivována</value>
</data>
</root>

View file

@ -354,4 +354,13 @@
<data name="Task Manger" xml:space="preserve">
<value>Taskmanager</value>
</data>
<data name="Expert" xml:space="preserve">
<value>Experte</value>
</data>
<data name="If the focus is lost and the Enter key was pressed" xml:space="preserve">
<value>Wenn der Fokus verloren geht und die Eingabetaste gedrückt wurde</value>
</data>
<data name="Milliseconds until the menu closes if in this case the menu is not reactivated" xml:space="preserve">
<value>Millisekunden bis das Menü schließt, wenn in diesem Fall das Menü nicht wieder aktiviert wird</value>
</data>
</root>

View file

@ -354,4 +354,13 @@
<data name="Task Manger" xml:space="preserve">
<value>Administrador de tareas</value>
</data>
<data name="Expert" xml:space="preserve">
<value>Experto</value>
</data>
<data name="If the focus is lost and the Enter key was pressed" xml:space="preserve">
<value>Si se pierde el enfoque y se presionó la tecla Enter</value>
</data>
<data name="Milliseconds until the menu closes if in this case the menu is not reactivated" xml:space="preserve">
<value>Milisegundos hasta que se cierre el menú si en este caso no se reactiva el menú</value>
</data>
</root>

View file

@ -354,4 +354,13 @@
<data name="Task Manger" xml:space="preserve">
<value>Gestionnaire des tâches</value>
</data>
<data name="Expert" xml:space="preserve">
<value>Expert</value>
</data>
<data name="If the focus is lost and the Enter key was pressed" xml:space="preserve">
<value>Si le focus est perdu et que la touche Entrée a été enfoncée</value>
</data>
<data name="Milliseconds until the menu closes if in this case the menu is not reactivated" xml:space="preserve">
<value>Millisecondes jusqu'à la fermeture du menu si dans ce cas le menu n'est pas réactivé</value>
</data>
</root>

View file

@ -354,4 +354,13 @@
<data name="Task Manger" xml:space="preserve">
<value>Task Manger</value>
</data>
<data name="Expert" xml:space="preserve">
<value>Esperto</value>
</data>
<data name="If the focus is lost and the Enter key was pressed" xml:space="preserve">
<value>Se la messa a fuoco è persa ed è stato premuto il tasto Invio</value>
</data>
<data name="Milliseconds until the menu closes if in this case the menu is not reactivated" xml:space="preserve">
<value>Millisecondi alla chiusura del menu se in questo caso il menu non viene riattivato</value>
</data>
</root>

View file

@ -354,4 +354,13 @@
<data name="Task Manger" xml:space="preserve">
<value>タスクマネージャー</value>
</data>
<data name="Expert" xml:space="preserve">
<value>エキスパート</value>
</data>
<data name="If the focus is lost and the Enter key was pressed" xml:space="preserve">
<value>フォーカスが失われ、Enterキーが押された場合</value>
</data>
<data name="Milliseconds until the menu closes if in this case the menu is not reactivated" xml:space="preserve">
<value>この場合、メニューが再度アクティブ化されない場合、メニューが閉じるまでのミリ秒</value>
</data>
</root>

View file

@ -354,4 +354,13 @@
<data name="Task Manger" xml:space="preserve">
<value>작업 관리자</value>
</data>
<data name="Expert" xml:space="preserve">
<value>전문가</value>
</data>
<data name="If the focus is lost and the Enter key was pressed" xml:space="preserve">
<value>초점을 잃고 Enter 키를 누른 경우</value>
</data>
<data name="Milliseconds until the menu closes if in this case the menu is not reactivated" xml:space="preserve">
<value>이 경우 메뉴가 다시 활성화되지 않으면 메뉴가 닫힐 때까지의 시간(밀리초)</value>
</data>
</root>

View file

@ -354,4 +354,13 @@
<data name="Task Manger" xml:space="preserve">
<value>Taakbeheer</value>
</data>
<data name="Expert" xml:space="preserve">
<value>Deskundige</value>
</data>
<data name="If the focus is lost and the Enter key was pressed" xml:space="preserve">
<value>Als de focus verloren is gegaan en de Enter-toets is ingedrukt</value>
</data>
<data name="Milliseconds until the menu closes if in this case the menu is not reactivated" xml:space="preserve">
<value>Milliseconden totdat het menu wordt gesloten als het menu in dit geval niet opnieuw wordt geactiveerd</value>
</data>
</root>

View file

@ -354,4 +354,13 @@
<data name="Task Manger" xml:space="preserve">
<value>Gerenciador de tarefas</value>
</data>
<data name="Expert" xml:space="preserve">
<value>Especialista</value>
</data>
<data name="If the focus is lost and the Enter key was pressed" xml:space="preserve">
<value>Se o foco foi perdido e a tecla Enter foi pressionada</value>
</data>
<data name="Milliseconds until the menu closes if in this case the menu is not reactivated" xml:space="preserve">
<value>Milissegundos até o menu fechar se, neste caso, o menu não for reativado</value>
</data>
</root>

View file

@ -354,4 +354,13 @@
<data name="Activated" xml:space="preserve">
<value>Activated</value>
</data>
<data name="Expert" xml:space="preserve">
<value>Expert</value>
</data>
<data name="If the focus is lost and the Enter key was pressed" xml:space="preserve">
<value>If the focus is lost and the Enter key was pressed</value>
</data>
<data name="Milliseconds until the menu closes if in this case the menu is not reactivated" xml:space="preserve">
<value>Milliseconds until the menu closes if in this case the menu is not reactivated</value>
</data>
</root>

View file

@ -354,4 +354,13 @@
<data name="Task Manger" xml:space="preserve">
<value>Диспетчер задач</value>
</data>
<data name="Expert" xml:space="preserve">
<value>Эксперт</value>
</data>
<data name="If the focus is lost and the Enter key was pressed" xml:space="preserve">
<value>Если фокус потерян и была нажата клавиша Enter</value>
</data>
<data name="Milliseconds until the menu closes if in this case the menu is not reactivated" xml:space="preserve">
<value>Миллисекунды до закрытия меню, если в этом случае меню не активируется повторно.</value>
</data>
</root>

View file

@ -354,4 +354,13 @@
<data name="Task Manger" xml:space="preserve">
<value>Görev Yöneticisi</value>
</data>
<data name="Expert" xml:space="preserve">
<value>Uzman</value>
</data>
<data name="If the focus is lost and the Enter key was pressed" xml:space="preserve">
<value>Odak kaybolursa ve Enter tuşuna basıldıysa</value>
</data>
<data name="Milliseconds until the menu closes if in this case the menu is not reactivated" xml:space="preserve">
<value>Bu durumda menü yeniden etkinleştirilmezse menü kapanana kadar milisaniye</value>
</data>
</root>

View file

@ -354,4 +354,13 @@
<data name="Task Manger" xml:space="preserve">
<value>Quản lý công việc</value>
</data>
<data name="Expert" xml:space="preserve">
<value>Thạo</value>
</data>
<data name="If the focus is lost and the Enter key was pressed" xml:space="preserve">
<value>Nếu mất tiêu điểm và nhấn phím Enter</value>
</data>
<data name="Milliseconds until the menu closes if in this case the menu is not reactivated" xml:space="preserve">
<value>Mili giây cho đến khi menu đóng lại nếu trong trường hợp này, menu chưa được kích hoạt lại</value>
</data>
</root>

View file

@ -354,4 +354,13 @@
<data name="Task Manger" xml:space="preserve">
<value>任务管理器</value>
</data>
<data name="Expert" xml:space="preserve">
<value>专家</value>
</data>
<data name="If the focus is lost and the Enter key was pressed" xml:space="preserve">
<value>如果失去焦点并且按下了 Enter 键</value>
</data>
<data name="Milliseconds until the menu closes if in this case the menu is not reactivated" xml:space="preserve">
<value>如果在这种情况下菜单未重新激活,则菜单关闭前的毫秒数</value>
</data>
</root>

View file

@ -77,18 +77,25 @@ namespace SystemTrayMenu.UserInterface
this.numericUpDownMenuWidth = new System.Windows.Forms.NumericUpDown();
this.labelMaxMenuWidth = new System.Windows.Forms.Label();
this.checkBoxAppearAtMouseLocation = new System.Windows.Forms.CheckBox();
this.buttonAdvancedDefault = new System.Windows.Forms.Button();
this.tabPageExpert = new System.Windows.Forms.TabPage();
this.tableLayoutPanelExpert = new System.Windows.Forms.TableLayoutPanel();
this.buttonExpertDefault = new System.Windows.Forms.Button();
this.groupBoxStaysOpen = new System.Windows.Forms.GroupBox();
this.tableLayoutPanelStaysOpen = new System.Windows.Forms.TableLayoutPanel();
this.tableLayoutPanel4 = new System.Windows.Forms.TableLayoutPanel();
this.labelTimeUntilClosesAfterEnterPressed = new System.Windows.Forms.Label();
this.numericUpDownTimeUntilClosesAfterEnterPressed = new System.Windows.Forms.NumericUpDown();
this.checkBoxStayOpenWhenItemClicked = new System.Windows.Forms.CheckBox();
this.checkBoxStayOpenWhenFocusLost = new System.Windows.Forms.CheckBox();
this.tableLayoutPanelTimeUntilCloses = new System.Windows.Forms.TableLayoutPanel();
this.labelTimeUntilCloses = new System.Windows.Forms.Label();
this.numericUpDownTimeUntilClose = new System.Windows.Forms.NumericUpDown();
this.checkBoxStayOpenWhenFocusLostAfterEnterPressed = new System.Windows.Forms.CheckBox();
this.groupBoxOpenSubmenus = new System.Windows.Forms.GroupBox();
this.tableLayoutPanelTimeUntilOpen = new System.Windows.Forms.TableLayoutPanel();
this.numericUpDownTimeUntilOpens = new System.Windows.Forms.NumericUpDown();
this.labelTimeUntilOpen = new System.Windows.Forms.Label();
this.buttonAdvancedDefault = new System.Windows.Forms.Button();
this.tabPageCustomize = new System.Windows.Forms.TabPage();
this.tableLayoutPanelCustomize = new System.Windows.Forms.TableLayoutPanel();
this.groupBoxColorsLightMode = new System.Windows.Forms.GroupBox();
@ -294,8 +301,12 @@ namespace SystemTrayMenu.UserInterface
((System.ComponentModel.ISupportInitialize)(this.numericUpDownMenuHeight)).BeginInit();
this.tableLayoutPanelMaxMenuWidth.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.numericUpDownMenuWidth)).BeginInit();
this.tabPageExpert.SuspendLayout();
this.tableLayoutPanelExpert.SuspendLayout();
this.groupBoxStaysOpen.SuspendLayout();
this.tableLayoutPanelStaysOpen.SuspendLayout();
this.tableLayoutPanel4.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.numericUpDownTimeUntilClosesAfterEnterPressed)).BeginInit();
this.tableLayoutPanelTimeUntilCloses.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.numericUpDownTimeUntilClose)).BeginInit();
this.groupBoxOpenSubmenus.SuspendLayout();
@ -410,6 +421,7 @@ namespace SystemTrayMenu.UserInterface
//
this.tabControl.Controls.Add(this.tabPageGeneral);
this.tabControl.Controls.Add(this.tabPageAdvanced);
this.tabControl.Controls.Add(this.tabPageExpert);
this.tabControl.Controls.Add(this.tabPageCustomize);
this.tabControl.Location = new System.Drawing.Point(6, 3);
this.tabControl.Margin = new System.Windows.Forms.Padding(6, 3, 6, 3);
@ -838,18 +850,16 @@ namespace SystemTrayMenu.UserInterface
this.tableLayoutPanelAdvanced.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
this.tableLayoutPanelAdvanced.Controls.Add(this.groupBoxClick, 0, 0);
this.tableLayoutPanelAdvanced.Controls.Add(this.groupBoxSizeAndLocation, 0, 1);
this.tableLayoutPanelAdvanced.Controls.Add(this.groupBoxStaysOpen, 0, 2);
this.tableLayoutPanelAdvanced.Controls.Add(this.groupBoxOpenSubmenus, 0, 3);
this.tableLayoutPanelAdvanced.Controls.Add(this.buttonAdvancedDefault, 0, 4);
this.tableLayoutPanelAdvanced.Controls.Add(this.buttonAdvancedDefault, 0, 2);
this.tableLayoutPanelAdvanced.Dock = System.Windows.Forms.DockStyle.Fill;
this.tableLayoutPanelAdvanced.Location = new System.Drawing.Point(3, 3);
this.tableLayoutPanelAdvanced.Name = "tableLayoutPanelAdvanced";
this.tableLayoutPanelAdvanced.RowCount = 5;
this.tableLayoutPanelAdvanced.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tableLayoutPanelAdvanced.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tableLayoutPanelAdvanced.RowCount = 3;
this.tableLayoutPanelAdvanced.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tableLayoutPanelAdvanced.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tableLayoutPanelAdvanced.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tableLayoutPanelAdvanced.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
this.tableLayoutPanelAdvanced.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
this.tableLayoutPanelAdvanced.Size = new System.Drawing.Size(408, 407);
this.tableLayoutPanelAdvanced.TabIndex = 0;
//
@ -1054,17 +1064,75 @@ namespace SystemTrayMenu.UserInterface
this.checkBoxAppearAtMouseLocation.Text = "checkBoxAppearAtMouseLocation";
this.checkBoxAppearAtMouseLocation.UseVisualStyleBackColor = true;
//
// buttonAdvancedDefault
//
this.buttonAdvancedDefault.AutoSize = true;
this.buttonAdvancedDefault.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
this.buttonAdvancedDefault.Location = new System.Drawing.Point(9, 205);
this.buttonAdvancedDefault.Margin = new System.Windows.Forms.Padding(9, 9, 3, 9);
this.buttonAdvancedDefault.MinimumSize = new System.Drawing.Size(75, 25);
this.buttonAdvancedDefault.Name = "buttonAdvancedDefault";
this.buttonAdvancedDefault.Size = new System.Drawing.Size(144, 25);
this.buttonAdvancedDefault.TabIndex = 0;
this.buttonAdvancedDefault.Text = "buttonAdvancedDefault";
this.buttonAdvancedDefault.UseVisualStyleBackColor = true;
this.buttonAdvancedDefault.Click += new System.EventHandler(this.ButtonAdvancedDefault_Click);
//
// tabPageExpert
//
this.tabPageExpert.Controls.Add(this.tableLayoutPanelExpert);
this.tabPageExpert.Location = new System.Drawing.Point(4, 24);
this.tabPageExpert.Name = "tabPageExpert";
this.tabPageExpert.Padding = new System.Windows.Forms.Padding(3);
this.tabPageExpert.Size = new System.Drawing.Size(414, 413);
this.tabPageExpert.TabIndex = 1;
this.tabPageExpert.Text = "tabPageExpert";
this.tabPageExpert.UseVisualStyleBackColor = true;
//
// tableLayoutPanelExpert
//
this.tableLayoutPanelExpert.AutoSize = true;
this.tableLayoutPanelExpert.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
this.tableLayoutPanelExpert.ColumnCount = 1;
this.tableLayoutPanelExpert.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
this.tableLayoutPanelExpert.Controls.Add(this.buttonExpertDefault, 0, 2);
this.tableLayoutPanelExpert.Controls.Add(this.groupBoxStaysOpen, 0, 1);
this.tableLayoutPanelExpert.Controls.Add(this.groupBoxOpenSubmenus, 0, 0);
this.tableLayoutPanelExpert.Dock = System.Windows.Forms.DockStyle.Fill;
this.tableLayoutPanelExpert.Location = new System.Drawing.Point(3, 3);
this.tableLayoutPanelExpert.Name = "tableLayoutPanelExpert";
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());
this.tableLayoutPanelExpert.Size = new System.Drawing.Size(408, 407);
this.tableLayoutPanelExpert.TabIndex = 1;
//
// buttonExpertDefault
//
this.buttonExpertDefault.AutoSize = true;
this.buttonExpertDefault.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
this.buttonExpertDefault.Location = new System.Drawing.Point(9, 233);
this.buttonExpertDefault.Margin = new System.Windows.Forms.Padding(9, 9, 3, 9);
this.buttonExpertDefault.MinimumSize = new System.Drawing.Size(75, 25);
this.buttonExpertDefault.Name = "buttonExpertDefault";
this.buttonExpertDefault.Size = new System.Drawing.Size(124, 25);
this.buttonExpertDefault.TabIndex = 0;
this.buttonExpertDefault.Text = "buttonExpertDefault";
this.buttonExpertDefault.UseVisualStyleBackColor = true;
this.buttonExpertDefault.Click += new System.EventHandler(this.ButtonExpertDefault_Click);
//
// groupBoxStaysOpen
//
this.groupBoxStaysOpen.AutoSize = true;
this.groupBoxStaysOpen.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
this.groupBoxStaysOpen.Controls.Add(this.tableLayoutPanelStaysOpen);
this.groupBoxStaysOpen.Location = new System.Drawing.Point(3, 199);
this.groupBoxStaysOpen.Location = new System.Drawing.Point(3, 63);
this.groupBoxStaysOpen.MaximumSize = new System.Drawing.Size(400, 0);
this.groupBoxStaysOpen.MinimumSize = new System.Drawing.Size(400, 0);
this.groupBoxStaysOpen.Name = "groupBoxStaysOpen";
this.groupBoxStaysOpen.Padding = new System.Windows.Forms.Padding(3, 3, 3, 6);
this.groupBoxStaysOpen.Size = new System.Drawing.Size(400, 104);
this.groupBoxStaysOpen.Size = new System.Drawing.Size(400, 158);
this.groupBoxStaysOpen.TabIndex = 0;
this.groupBoxStaysOpen.TabStop = false;
this.groupBoxStaysOpen.Text = "groupBoxStaysOpen";
@ -1075,19 +1143,59 @@ namespace SystemTrayMenu.UserInterface
this.tableLayoutPanelStaysOpen.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
this.tableLayoutPanelStaysOpen.ColumnCount = 1;
this.tableLayoutPanelStaysOpen.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
this.tableLayoutPanelStaysOpen.Controls.Add(this.tableLayoutPanel4, 0, 4);
this.tableLayoutPanelStaysOpen.Controls.Add(this.checkBoxStayOpenWhenItemClicked, 0, 0);
this.tableLayoutPanelStaysOpen.Controls.Add(this.checkBoxStayOpenWhenFocusLost, 0, 1);
this.tableLayoutPanelStaysOpen.Controls.Add(this.tableLayoutPanelTimeUntilCloses, 0, 2);
this.tableLayoutPanelStaysOpen.Controls.Add(this.checkBoxStayOpenWhenFocusLostAfterEnterPressed, 0, 3);
this.tableLayoutPanelStaysOpen.Dock = System.Windows.Forms.DockStyle.Fill;
this.tableLayoutPanelStaysOpen.Location = new System.Drawing.Point(3, 19);
this.tableLayoutPanelStaysOpen.Name = "tableLayoutPanelStaysOpen";
this.tableLayoutPanelStaysOpen.RowCount = 3;
this.tableLayoutPanelStaysOpen.RowCount = 5;
this.tableLayoutPanelStaysOpen.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tableLayoutPanelStaysOpen.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tableLayoutPanelStaysOpen.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tableLayoutPanelStaysOpen.Size = new System.Drawing.Size(394, 79);
this.tableLayoutPanelStaysOpen.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tableLayoutPanelStaysOpen.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tableLayoutPanelStaysOpen.Size = new System.Drawing.Size(394, 133);
this.tableLayoutPanelStaysOpen.TabIndex = 0;
//
// tableLayoutPanel4
//
this.tableLayoutPanel4.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
this.tableLayoutPanel4.AutoSize = true;
this.tableLayoutPanel4.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
this.tableLayoutPanel4.ColumnCount = 2;
this.tableLayoutPanel4.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
this.tableLayoutPanel4.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tableLayoutPanel4.Controls.Add(this.labelTimeUntilClosesAfterEnterPressed, 1, 0);
this.tableLayoutPanel4.Controls.Add(this.numericUpDownTimeUntilClosesAfterEnterPressed, 0, 0);
this.tableLayoutPanel4.Location = new System.Drawing.Point(0, 104);
this.tableLayoutPanel4.Margin = new System.Windows.Forms.Padding(0);
this.tableLayoutPanel4.Name = "tableLayoutPanel4";
this.tableLayoutPanel4.RowCount = 1;
this.tableLayoutPanel4.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tableLayoutPanel4.Size = new System.Drawing.Size(394, 29);
this.tableLayoutPanel4.TabIndex = 2;
//
// labelTimeUntilClosesAfterEnterPressed
//
this.labelTimeUntilClosesAfterEnterPressed.Anchor = System.Windows.Forms.AnchorStyles.Left;
this.labelTimeUntilClosesAfterEnterPressed.AutoSize = true;
this.labelTimeUntilClosesAfterEnterPressed.Location = new System.Drawing.Point(64, 7);
this.labelTimeUntilClosesAfterEnterPressed.MaximumSize = new System.Drawing.Size(330, 0);
this.labelTimeUntilClosesAfterEnterPressed.Name = "labelTimeUntilClosesAfterEnterPressed";
this.labelTimeUntilClosesAfterEnterPressed.Size = new System.Drawing.Size(210, 15);
this.labelTimeUntilClosesAfterEnterPressed.TabIndex = 0;
this.labelTimeUntilClosesAfterEnterPressed.Text = "labelTimeUntilClosesAfterEnterPressed";
//
// numericUpDownTimeUntilClosesAfterEnterPressed
//
this.numericUpDownTimeUntilClosesAfterEnterPressed.Location = new System.Drawing.Point(3, 3);
this.numericUpDownTimeUntilClosesAfterEnterPressed.Name = "numericUpDownTimeUntilClosesAfterEnterPressed";
this.numericUpDownTimeUntilClosesAfterEnterPressed.Size = new System.Drawing.Size(55, 23);
this.numericUpDownTimeUntilClosesAfterEnterPressed.TabIndex = 1;
//
// checkBoxStayOpenWhenItemClicked
//
this.checkBoxStayOpenWhenItemClicked.AutoSize = true;
@ -1151,12 +1259,25 @@ namespace SystemTrayMenu.UserInterface
this.numericUpDownTimeUntilClose.KeyDown += new System.Windows.Forms.KeyEventHandler(this.StopPlayingDingSoundEnterKeyPressed_KeyDown);
this.numericUpDownTimeUntilClose.KeyUp += new System.Windows.Forms.KeyEventHandler(this.StopPlayingDingSoundEnterKeyPressed_KeyUp);
//
// checkBoxStayOpenWhenFocusLostAfterEnterPressed
//
this.checkBoxStayOpenWhenFocusLostAfterEnterPressed.AutoSize = true;
this.checkBoxStayOpenWhenFocusLostAfterEnterPressed.Checked = true;
this.checkBoxStayOpenWhenFocusLostAfterEnterPressed.CheckState = System.Windows.Forms.CheckState.Checked;
this.checkBoxStayOpenWhenFocusLostAfterEnterPressed.Location = new System.Drawing.Point(3, 82);
this.checkBoxStayOpenWhenFocusLostAfterEnterPressed.Name = "checkBoxStayOpenWhenFocusLostAfterEnterPressed";
this.checkBoxStayOpenWhenFocusLostAfterEnterPressed.Size = new System.Drawing.Size(305, 19);
this.checkBoxStayOpenWhenFocusLostAfterEnterPressed.TabIndex = 1;
this.checkBoxStayOpenWhenFocusLostAfterEnterPressed.Text = "checkBoxStayOpenWhenFocusLostAfterEnterPressed";
this.checkBoxStayOpenWhenFocusLostAfterEnterPressed.UseVisualStyleBackColor = true;
this.checkBoxStayOpenWhenFocusLostAfterEnterPressed.CheckedChanged += new System.EventHandler(this.CheckBoxStayOpenWhenFocusLostAfterEnterPressed_CheckedChanged);
//
// groupBoxOpenSubmenus
//
this.groupBoxOpenSubmenus.AutoSize = true;
this.groupBoxOpenSubmenus.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
this.groupBoxOpenSubmenus.Controls.Add(this.tableLayoutPanelTimeUntilOpen);
this.groupBoxOpenSubmenus.Location = new System.Drawing.Point(3, 309);
this.groupBoxOpenSubmenus.Location = new System.Drawing.Point(3, 3);
this.groupBoxOpenSubmenus.MaximumSize = new System.Drawing.Size(400, 0);
this.groupBoxOpenSubmenus.MinimumSize = new System.Drawing.Size(400, 0);
this.groupBoxOpenSubmenus.Name = "groupBoxOpenSubmenus";
@ -1203,20 +1324,6 @@ namespace SystemTrayMenu.UserInterface
this.labelTimeUntilOpen.TabIndex = 0;
this.labelTimeUntilOpen.Text = "labelTimeUntilOpen";
//
// buttonAdvancedDefault
//
this.buttonAdvancedDefault.AutoSize = true;
this.buttonAdvancedDefault.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
this.buttonAdvancedDefault.Location = new System.Drawing.Point(9, 375);
this.buttonAdvancedDefault.Margin = new System.Windows.Forms.Padding(9, 9, 3, 9);
this.buttonAdvancedDefault.MinimumSize = new System.Drawing.Size(75, 25);
this.buttonAdvancedDefault.Name = "buttonAdvancedDefault";
this.buttonAdvancedDefault.Size = new System.Drawing.Size(144, 25);
this.buttonAdvancedDefault.TabIndex = 0;
this.buttonAdvancedDefault.Text = "buttonAdvancedDefault";
this.buttonAdvancedDefault.UseVisualStyleBackColor = true;
this.buttonAdvancedDefault.Click += new System.EventHandler(this.ButtonAdvancedDefault_Click);
//
// tabPageCustomize
//
this.tabPageCustomize.AutoScroll = true;
@ -3744,10 +3851,17 @@ namespace SystemTrayMenu.UserInterface
this.tableLayoutPanelMaxMenuWidth.ResumeLayout(false);
this.tableLayoutPanelMaxMenuWidth.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.numericUpDownMenuWidth)).EndInit();
this.tabPageExpert.ResumeLayout(false);
this.tabPageExpert.PerformLayout();
this.tableLayoutPanelExpert.ResumeLayout(false);
this.tableLayoutPanelExpert.PerformLayout();
this.groupBoxStaysOpen.ResumeLayout(false);
this.groupBoxStaysOpen.PerformLayout();
this.tableLayoutPanelStaysOpen.ResumeLayout(false);
this.tableLayoutPanelStaysOpen.PerformLayout();
this.tableLayoutPanel4.ResumeLayout(false);
this.tableLayoutPanel4.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.numericUpDownTimeUntilClosesAfterEnterPressed)).EndInit();
this.tableLayoutPanelTimeUntilCloses.ResumeLayout(false);
this.tableLayoutPanelTimeUntilCloses.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.numericUpDownTimeUntilClose)).EndInit();
@ -4135,5 +4249,12 @@ namespace SystemTrayMenu.UserInterface
private System.Windows.Forms.Button buttonOpenFolder;
private System.Windows.Forms.Button buttonAddTaskManagerStartupTask;
private System.Windows.Forms.Label labelStartupTaskStatus;
private System.Windows.Forms.TabPage tabPageExpert;
private System.Windows.Forms.TableLayoutPanel tableLayoutPanelExpert;
private System.Windows.Forms.Button buttonExpertDefault;
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel4;
private System.Windows.Forms.Label labelTimeUntilClosesAfterEnterPressed;
private System.Windows.Forms.NumericUpDown numericUpDownTimeUntilClosesAfterEnterPressed;
private System.Windows.Forms.CheckBox checkBoxStayOpenWhenFocusLostAfterEnterPressed;
}
}

View file

@ -106,6 +106,7 @@ namespace SystemTrayMenu.UserInterface
Text = Translator.GetText("Settings");
tabPageGeneral.Text = Translator.GetText("General");
tabPageAdvanced.Text = Translator.GetText("Advanced");
tabPageExpert.Text = Translator.GetText("Expert");
tabPageCustomize.Text = Translator.GetText("Customize");
groupBoxFolder.Text = Translator.GetText("Folder");
buttonChangeFolder.Text = Translator.GetText("Change folder");
@ -134,13 +135,16 @@ namespace SystemTrayMenu.UserInterface
labelMaxMenuWidth.Text = Translator.GetText("Pixels maximum menu width");
labelMaxMenuHeight.Text = Translator.GetText("Pixels maximum menu height");
checkBoxAppearAtMouseLocation.Text = Translator.GetText("Appear at mouse location");
buttonAdvancedDefault.Text = Translator.GetText("Default");
groupBoxStaysOpen.Text = Translator.GetText("Stays open");
checkBoxStayOpenWhenItemClicked.Text = Translator.GetText("If an item was clicked");
checkBoxStayOpenWhenFocusLost.Text = Translator.GetText("If the focus is lost and if the mouse is still on the menu");
labelTimeUntilCloses.Text = Translator.GetText("Milliseconds until the menu closes if in this case the mouse then leaves the menu");
groupBoxOpenSubmenus.Text = Translator.GetText("Time until a menu opens");
labelTimeUntilOpen.Text = Translator.GetText("Milliseconds until a menu opens when the mouse is on it");
buttonAdvancedDefault.Text = Translator.GetText("Default");
checkBoxStayOpenWhenFocusLostAfterEnterPressed.Text = Translator.GetText("If the focus is lost and the Enter key was pressed");
labelTimeUntilClosesAfterEnterPressed.Text = Translator.GetText("Milliseconds until the menu closes if in this case the menu is not reactivated");
buttonExpertDefault.Text = Translator.GetText("Default");
groupBoxColorsLightMode.Text = Translator.GetText("Colors Light Mode");
groupBoxColorsDarkMode.Text = Translator.GetText("Colors Dark Mode");
labelMenuLightMode.Text = Translator.GetText("Menu");
@ -317,6 +321,13 @@ namespace SystemTrayMenu.UserInterface
numericUpDownTimeUntilOpens.Increment = 10;
numericUpDownTimeUntilOpens.Value = Settings.Default.TimeUntilOpens;
checkBoxStayOpenWhenFocusLostAfterEnterPressed.Checked = Settings.Default.StaysOpenWhenFocusLostAfterEnterPressed;
numericUpDownTimeUntilClosesAfterEnterPressed.Minimum = 20;
numericUpDownTimeUntilClosesAfterEnterPressed.Maximum = 1000;
numericUpDownTimeUntilClosesAfterEnterPressed.Increment = 10;
numericUpDownTimeUntilClosesAfterEnterPressed.Value = Settings.Default.TimeUntilClosesAfterEnterPressed;
checkBoxDarkModeAlwaysOn.Checked = Settings.Default.IsDarkModeAlwaysOn;
textBoxColorSelectedItem.Text = Settings.Default.ColorSelectedItem;
textBoxColorSelecetedItemDarkMode.Text = Settings.Default.ColorDarkModeSelecetedItem;
@ -583,7 +594,7 @@ namespace SystemTrayMenu.UserInterface
tabControl.Size = new Size(
tabControl.Size.Width,
tableLayoutPanelAdvanced.Size.Height + (int)(50 * Scaling.Factor));
tableLayoutPanelGeneral.Size.Height + (int)(50 * Scaling.Factor));
}
private void ButtonOk_Click(object sender, EventArgs e)
@ -631,6 +642,8 @@ namespace SystemTrayMenu.UserInterface
Settings.Default.StaysOpenWhenFocusLost = checkBoxStayOpenWhenFocusLost.Checked;
Settings.Default.TimeUntilCloses = (int)numericUpDownTimeUntilClose.Value;
Settings.Default.TimeUntilOpens = (int)numericUpDownTimeUntilOpens.Value;
Settings.Default.StaysOpenWhenFocusLostAfterEnterPressed = checkBoxStayOpenWhenFocusLostAfterEnterPressed.Checked;
Settings.Default.TimeUntilClosesAfterEnterPressed = (int)numericUpDownTimeUntilClosesAfterEnterPressed.Value;
Settings.Default.IsDarkModeAlwaysOn = checkBoxDarkModeAlwaysOn.Checked;
@ -726,26 +739,6 @@ namespace SystemTrayMenu.UserInterface
textBoxHotkey.SetHotkey("Ctrl+LWin");
}
private void ButtonAdvancedDefault_Click(object sender, EventArgs e)
{
checkBoxOpenItemWithOneClick.Checked = true;
checkBoxAppearAtMouseLocation.Checked = false;
numericUpDownSizeInPercentage.Value = 100;
numericUpDownMenuWidth.Value = 300;
numericUpDownMenuHeight.Value = 600;
checkBoxStayOpenWhenItemClicked.Checked = true;
checkBoxStayOpenWhenFocusLost.Checked = true;
numericUpDownTimeUntilClose.Value = 1000;
numericUpDownTimeUntilOpens.Value = 100;
}
private void ButtonCancel_Click(object sender, EventArgs e)
{
Settings.Default.Reload();
DialogResult = DialogResult.Cancel;
Close();
}
private void ButtonChange_Click(object sender, EventArgs e)
{
Config.SetFolderByUser(false);
@ -785,11 +778,35 @@ namespace SystemTrayMenu.UserInterface
inHotkey = false;
}
private void ButtonAdvancedDefault_Click(object sender, EventArgs e)
{
checkBoxOpenItemWithOneClick.Checked = true;
checkBoxAppearAtMouseLocation.Checked = false;
numericUpDownSizeInPercentage.Value = 100;
numericUpDownMenuWidth.Value = 300;
numericUpDownMenuHeight.Value = 600;
}
private void CheckBoxStayOpenWhenFocusLost_CheckedChanged(object sender, EventArgs e)
{
numericUpDownTimeUntilClose.Enabled = checkBoxStayOpenWhenFocusLost.Checked;
}
private void CheckBoxStayOpenWhenFocusLostAfterEnterPressed_CheckedChanged(object sender, EventArgs e)
{
numericUpDownTimeUntilClosesAfterEnterPressed.Enabled = checkBoxStayOpenWhenFocusLostAfterEnterPressed.Checked;
}
private void ButtonExpertDefault_Click(object sender, EventArgs e)
{
checkBoxStayOpenWhenItemClicked.Checked = true;
checkBoxStayOpenWhenFocusLost.Checked = true;
numericUpDownTimeUntilClose.Value = 1000;
numericUpDownTimeUntilOpens.Value = 100;
checkBoxStayOpenWhenFocusLostAfterEnterPressed.Checked = true;
numericUpDownTimeUntilClosesAfterEnterPressed.Value = 200;
}
private void TextBoxColorsChanged(object sender, EventArgs e)
{
TextBox textBox = (TextBox)sender;
@ -942,5 +959,12 @@ namespace SystemTrayMenu.UserInterface
e.Handled = e.SuppressKeyPress = true;
}
}
private void ButtonCancel_Click(object sender, EventArgs e)
{
Settings.Default.Reload();
DialogResult = DialogResult.Cancel;
Close();
}
}
}