From 587ebcfc90c30d572f4dec6c3deef8249b8f65c2 Mon Sep 17 00:00:00 2001 From: Markus Hofknecht Date: Mon, 2 May 2022 19:55:15 +0200 Subject: [PATCH] [Feature] Option to configure drag settings (#377), version 1.2.9.5 --- Business/Menus.cs | 10 +- Properties/Settings.Designer.cs | 64 +++++ Resources/Languages/lang.Designer.cs | 27 ++ Resources/Languages/lang.cs-CZ.resx | 9 + Resources/Languages/lang.de-DE.resx | 9 + Resources/Languages/lang.es-ES.resx | 9 + Resources/Languages/lang.fa-IR.resx | 9 + Resources/Languages/lang.fr-FR.resx | 9 + Resources/Languages/lang.it-IT.resx | 9 + Resources/Languages/lang.ja-JP.resx | 9 + Resources/Languages/lang.ko-KR.resx | 9 + Resources/Languages/lang.nl-NL.resx | 9 + Resources/Languages/lang.pt-BR.resx | 9 + Resources/Languages/lang.resx | 9 + Resources/Languages/lang.ru-RU.resx | 9 + Resources/Languages/lang.tr-TR.resx | 9 + Resources/Languages/lang.vi-VN.resx | 9 + Resources/Languages/lang.zh-CN.resx | 9 + UserInterface/Menu.cs | 11 +- UserInterface/SettingsForm.Designer.cs | 337 +++++++++++++++---------- UserInterface/SettingsForm.cs | 26 ++ 21 files changed, 470 insertions(+), 140 deletions(-) diff --git a/Business/Menus.cs b/Business/Menus.cs index 39dfc67..f99e975 100644 --- a/Business/Menus.cs +++ b/Business/Menus.cs @@ -34,7 +34,6 @@ namespace SystemTrayMenu.Business private readonly Timer timerStillActiveCheck = new(); private readonly WaitLeave waitLeave = new(Properties.Settings.Default.TimeUntilCloses); private DateTime deactivatedTime = DateTime.MinValue; - private DateTime dateTimeLastOpening = DateTime.MinValue; private OpenCloseState openCloseState = OpenCloseState.Default; private TaskbarPosition taskbarPosition = new WindowsTaskbar().Position; private bool searchTextChanging; @@ -606,7 +605,6 @@ namespace SystemTrayMenu.Business } deactivatedTime = DateTime.MinValue; - dateTimeLastOpening = DateTime.Now; } internal void DisposeMenu(Menu menuToDispose) @@ -1125,7 +1123,13 @@ namespace SystemTrayMenu.Business Menu menu = (Menu)((DataGridView)sender).FindForm(); if (menu != null && menu.ScrollbarVisible) { - isDraggingSwipeScrolling = true; + bool isTouchEnabled = DllImports.NativeMethods.IsTouchEnabled(); + if ((isTouchEnabled && Properties.Settings.Default.SwipeScrollingEnabledTouch) || + (!isTouchEnabled && Properties.Settings.Default.SwipeScrollingEnabled)) + { + isDraggingSwipeScrolling = true; + } + dragSwipeScrollingStartRowIndex = GetRowUnderCursor(dgv, e.Location); } } diff --git a/Properties/Settings.Designer.cs b/Properties/Settings.Designer.cs index 491cd86..fe412dd 100644 --- a/Properties/Settings.Designer.cs +++ b/Properties/Settings.Designer.cs @@ -299,6 +299,70 @@ namespace SystemTrayMenu.Properties } } + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Configuration.SettingsProviderAttribute(typeof(CustomSettingsProvider))] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("False")] + public bool DragDropItemsEnabledTouch + { + get + { + return ((bool)(this["DragDropItemsEnabledTouch"])); + } + set + { + this["DragDropItemsEnabledTouch"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Configuration.SettingsProviderAttribute(typeof(CustomSettingsProvider))] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("True")] + public bool SwipeScrollingEnabledTouch + { + get + { + return ((bool)(this["SwipeScrollingEnabledTouch"])); + } + set + { + this["SwipeScrollingEnabledTouch"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Configuration.SettingsProviderAttribute(typeof(CustomSettingsProvider))] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("True")] + public bool DragDropItemsEnabled + { + get + { + return ((bool)(this["DragDropItemsEnabled"])); + } + set + { + this["DragDropItemsEnabled"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Configuration.SettingsProviderAttribute(typeof(CustomSettingsProvider))] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("False")] + public bool SwipeScrollingEnabled + { + get + { + return ((bool)(this["SwipeScrollingEnabled"])); + } + set + { + this["SwipeScrollingEnabled"] = value; + } + } + [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Configuration.SettingsProviderAttribute(typeof(CustomSettingsProvider))] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] diff --git a/Resources/Languages/lang.Designer.cs b/Resources/Languages/lang.Designer.cs index 84129bb..ca40bbb 100644 --- a/Resources/Languages/lang.Designer.cs +++ b/Resources/Languages/lang.Designer.cs @@ -339,6 +339,15 @@ namespace SystemTrayMenu.Resources.Languages { } } + /// + /// Looks up a localized string similar to Copy row item via drag drop. + /// + internal static string Copy_row_item_via_drag_drop { + get { + return ResourceManager.GetString("Copy row item via drag drop", resourceCulture); + } + } + /// /// Looks up a localized string similar to Couldn’t register the hot key.. /// @@ -402,6 +411,15 @@ namespace SystemTrayMenu.Resources.Languages { } } + /// + /// Looks up a localized string similar to Drag. + /// + internal static string Drag { + get { + return ResourceManager.GetString("Drag", resourceCulture); + } + } + /// /// Looks up a localized string similar to item. /// @@ -844,6 +862,15 @@ namespace SystemTrayMenu.Resources.Languages { } } + /// + /// Looks up a localized string similar to Scroll via swipe. + /// + internal static string Scroll_via_swipe { + get { + return ResourceManager.GetString("Scroll via swipe", resourceCulture); + } + } + /// /// Looks up a localized string similar to Scrollbar. /// diff --git a/Resources/Languages/lang.cs-CZ.resx b/Resources/Languages/lang.cs-CZ.resx index c306d0b..4032949 100644 --- a/Resources/Languages/lang.cs-CZ.resx +++ b/Resources/Languages/lang.cs-CZ.resx @@ -477,4 +477,13 @@ Řazení + + Zkopírujte položku řádku pomocí přetažení + + + Táhnout + + + Posouvání přejetím + \ No newline at end of file diff --git a/Resources/Languages/lang.de-DE.resx b/Resources/Languages/lang.de-DE.resx index cee233c..6c2e85f 100644 --- a/Resources/Languages/lang.de-DE.resx +++ b/Resources/Languages/lang.de-DE.resx @@ -477,4 +477,13 @@ Sortierung + + Zeilenelement per Drag-Drop kopieren + + + Ziehen + + + Per Wischen scrollen + \ No newline at end of file diff --git a/Resources/Languages/lang.es-ES.resx b/Resources/Languages/lang.es-ES.resx index 4202c7d..994c2c8 100644 --- a/Resources/Languages/lang.es-ES.resx +++ b/Resources/Languages/lang.es-ES.resx @@ -477,4 +477,13 @@ Clasificación + + Copie el elemento de la fila arrastrando y soltando + + + Arrastrar + + + Desplazarse mediante deslizar + \ No newline at end of file diff --git a/Resources/Languages/lang.fa-IR.resx b/Resources/Languages/lang.fa-IR.resx index 2c8c77c..3dac954 100644 --- a/Resources/Languages/lang.fa-IR.resx +++ b/Resources/Languages/lang.fa-IR.resx @@ -477,4 +477,13 @@ مرتب سازی + + از طریق کشیدن دراپ، آیتم ردیف را کپی کنید + + + بکشید + + + از طریق سوایپ پیمایش کنید + \ No newline at end of file diff --git a/Resources/Languages/lang.fr-FR.resx b/Resources/Languages/lang.fr-FR.resx index cc58614..ff9a530 100644 --- a/Resources/Languages/lang.fr-FR.resx +++ b/Resources/Languages/lang.fr-FR.resx @@ -477,4 +477,13 @@ Tri + + Copier l'élément de ligne par glisser-déposer + + + Glisser + + + Faire défiler par balayage + \ No newline at end of file diff --git a/Resources/Languages/lang.it-IT.resx b/Resources/Languages/lang.it-IT.resx index e1aa3f8..e3ddae4 100644 --- a/Resources/Languages/lang.it-IT.resx +++ b/Resources/Languages/lang.it-IT.resx @@ -477,4 +477,13 @@ Ordinamento + + Copia l'elemento della riga tramite trascinamento + + + Lagna + + + Scorri tramite swipe + \ No newline at end of file diff --git a/Resources/Languages/lang.ja-JP.resx b/Resources/Languages/lang.ja-JP.resx index 0d53690..fdcab00 100644 --- a/Resources/Languages/lang.ja-JP.resx +++ b/Resources/Languages/lang.ja-JP.resx @@ -477,4 +477,13 @@ 並べ替え + + ドラッグドロップで行アイテムをコピーする + + + 引っ張る + + + スワイプでスクロール + \ No newline at end of file diff --git a/Resources/Languages/lang.ko-KR.resx b/Resources/Languages/lang.ko-KR.resx index 09e2661..be89e88 100644 --- a/Resources/Languages/lang.ko-KR.resx +++ b/Resources/Languages/lang.ko-KR.resx @@ -477,4 +477,13 @@ 정렬 + + 드래그 드롭을 통해 행 항목 복사 + + + 견인 + + + 스와이프로 스크롤 + \ No newline at end of file diff --git a/Resources/Languages/lang.nl-NL.resx b/Resources/Languages/lang.nl-NL.resx index c8b7f1b..3d82837 100644 --- a/Resources/Languages/lang.nl-NL.resx +++ b/Resources/Languages/lang.nl-NL.resx @@ -477,4 +477,13 @@ Sorteren + + Kopieer rij-item via slepen en neerzetten + + + Sleuren + + + Scrollen door te vegen + \ No newline at end of file diff --git a/Resources/Languages/lang.pt-BR.resx b/Resources/Languages/lang.pt-BR.resx index da7c671..e4792b0 100644 --- a/Resources/Languages/lang.pt-BR.resx +++ b/Resources/Languages/lang.pt-BR.resx @@ -477,4 +477,13 @@ Ordenação + + Copiar item de linha por meio de arrastar e soltar + + + Arrastar + + + Rolar através de furto + \ No newline at end of file diff --git a/Resources/Languages/lang.resx b/Resources/Languages/lang.resx index 8b96cd5..fbe8118 100644 --- a/Resources/Languages/lang.resx +++ b/Resources/Languages/lang.resx @@ -477,4 +477,13 @@ Sorting + + Copy row item via drag drop + + + Drag + + + Scroll via swipe + \ No newline at end of file diff --git a/Resources/Languages/lang.ru-RU.resx b/Resources/Languages/lang.ru-RU.resx index aef543f..ea2c79a 100644 --- a/Resources/Languages/lang.ru-RU.resx +++ b/Resources/Languages/lang.ru-RU.resx @@ -477,4 +477,13 @@ Сортировка + + Скопируйте элемент строки с помощью перетаскивания + + + Тащить + + + Прокрутите свайпом + \ No newline at end of file diff --git a/Resources/Languages/lang.tr-TR.resx b/Resources/Languages/lang.tr-TR.resx index 55605ed..0bfc30a 100644 --- a/Resources/Languages/lang.tr-TR.resx +++ b/Resources/Languages/lang.tr-TR.resx @@ -477,4 +477,13 @@ Sıralama + + Sürükle bırak yoluyla satır öğesini kopyala + + + Sürüklemek + + + Kaydırarak kaydırın + \ No newline at end of file diff --git a/Resources/Languages/lang.vi-VN.resx b/Resources/Languages/lang.vi-VN.resx index fb0dc02..a495ced 100644 --- a/Resources/Languages/lang.vi-VN.resx +++ b/Resources/Languages/lang.vi-VN.resx @@ -477,4 +477,13 @@ Sắp xếp + + Sao chép mục hàng thông qua kéo thả + + + Lôi kéo + + + Cuộn qua vuốt + \ No newline at end of file diff --git a/Resources/Languages/lang.zh-CN.resx b/Resources/Languages/lang.zh-CN.resx index 7f9ee32..7b60a8f 100644 --- a/Resources/Languages/lang.zh-CN.resx +++ b/Resources/Languages/lang.zh-CN.resx @@ -477,4 +477,13 @@ 排序 + + 通过拖放复制行项目 + + + + + + 通过滑动滚动 + \ No newline at end of file diff --git a/UserInterface/Menu.cs b/UserInterface/Menu.cs index b14fe34..c0301fd 100644 --- a/UserInterface/Menu.cs +++ b/UserInterface/Menu.cs @@ -167,9 +167,14 @@ namespace SystemTrayMenu.UserInterface MouseLeave?.Invoke(); } - AllowDrop = true; - DragEnter += DragDropHelper.DragEnter; - DragDrop += DragDropHelper.DragDrop; + bool isTouchEnabled = NativeMethods.IsTouchEnabled(); + if ((isTouchEnabled && Properties.Settings.Default.DragDropItemsEnabledTouch) || + (!isTouchEnabled && Properties.Settings.Default.DragDropItemsEnabled)) + { + AllowDrop = true; + DragEnter += DragDropHelper.DragEnter; + DragDrop += DragDropHelper.DragDrop; + } } internal new event EventHandlerEmpty MouseWheel; diff --git a/UserInterface/SettingsForm.Designer.cs b/UserInterface/SettingsForm.Designer.cs index ccb1366..2beab4c 100644 --- a/UserInterface/SettingsForm.Designer.cs +++ b/UserInterface/SettingsForm.Designer.cs @@ -95,6 +95,17 @@ namespace SystemTrayMenu.UserInterface this.labelMaxMenuWidth = new System.Windows.Forms.Label(); this.tabPageAdvanced = new System.Windows.Forms.TabPage(); this.tableLayoutPanelAdvanced = new System.Windows.Forms.TableLayoutPanel(); + this.groupBoxDrag = new System.Windows.Forms.GroupBox(); + this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel(); + this.checkBoxSwipeScrolling = new System.Windows.Forms.CheckBox(); + this.checkBoxDragDropItems = new System.Windows.Forms.CheckBox(); + this.groupBoxClick = new System.Windows.Forms.GroupBox(); + this.tableLayoutPanelClick = new System.Windows.Forms.TableLayoutPanel(); + this.checkBoxSendHotkeyInsteadKillOtherInstances = new System.Windows.Forms.CheckBox(); + this.checkBoxOpenDirectoryWithOneClick = new System.Windows.Forms.CheckBox(); + this.checkBoxOpenItemWithOneClick = new System.Windows.Forms.CheckBox(); + this.checkBoxShowInTaskbar = new System.Windows.Forms.CheckBox(); + this.buttonAdvancedDefault = new System.Windows.Forms.Button(); this.groupBoxSorting = new System.Windows.Forms.GroupBox(); this.tableLayoutPanel5 = new System.Windows.Forms.TableLayoutPanel(); this.radioButtonSortByDate = new System.Windows.Forms.RadioButton(); @@ -104,13 +115,6 @@ namespace SystemTrayMenu.UserInterface this.radioButtonAlwaysShowHiddenFiles = new System.Windows.Forms.RadioButton(); this.radioButtonNeverShowHiddenFiles = new System.Windows.Forms.RadioButton(); this.radioButtonSystemSettingsShowHiddenFiles = new System.Windows.Forms.RadioButton(); - this.groupBoxClick = new System.Windows.Forms.GroupBox(); - this.tableLayoutPanelClick = new System.Windows.Forms.TableLayoutPanel(); - this.checkBoxSendHotkeyInsteadKillOtherInstances = new System.Windows.Forms.CheckBox(); - this.checkBoxOpenDirectoryWithOneClick = new System.Windows.Forms.CheckBox(); - this.checkBoxOpenItemWithOneClick = new System.Windows.Forms.CheckBox(); - this.checkBoxShowInTaskbar = new System.Windows.Forms.CheckBox(); - this.buttonAdvancedDefault = new System.Windows.Forms.Button(); this.tabPageFolders = new System.Windows.Forms.TabPage(); this.tableLayoutPanelFoldersInRootFolder = new System.Windows.Forms.TableLayoutPanel(); this.groupBoxFoldersInRootFolder = new System.Windows.Forms.GroupBox(); @@ -355,12 +359,14 @@ namespace SystemTrayMenu.UserInterface ((System.ComponentModel.ISupportInitialize)(this.numericUpDownMenuWidth)).BeginInit(); this.tabPageAdvanced.SuspendLayout(); this.tableLayoutPanelAdvanced.SuspendLayout(); + this.groupBoxDrag.SuspendLayout(); + this.tableLayoutPanel1.SuspendLayout(); + this.groupBoxClick.SuspendLayout(); + this.tableLayoutPanelClick.SuspendLayout(); this.groupBoxSorting.SuspendLayout(); this.tableLayoutPanel5.SuspendLayout(); this.groupBoxHiddenFilesAndFolders.SuspendLayout(); this.tableLayoutPanelHiddenFilesAndFolders.SuspendLayout(); - this.groupBoxClick.SuspendLayout(); - this.tableLayoutPanelClick.SuspendLayout(); this.tabPageFolders.SuspendLayout(); this.tableLayoutPanelFoldersInRootFolder.SuspendLayout(); this.groupBoxFoldersInRootFolder.SuspendLayout(); @@ -1374,14 +1380,16 @@ namespace SystemTrayMenu.UserInterface this.tableLayoutPanelAdvanced.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; this.tableLayoutPanelAdvanced.ColumnCount = 1; this.tableLayoutPanelAdvanced.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); - this.tableLayoutPanelAdvanced.Controls.Add(this.groupBoxSorting, 0, 2); - this.tableLayoutPanelAdvanced.Controls.Add(this.groupBoxHiddenFilesAndFolders, 0, 1); + this.tableLayoutPanelAdvanced.Controls.Add(this.groupBoxDrag, 0, 1); this.tableLayoutPanelAdvanced.Controls.Add(this.groupBoxClick, 0, 0); - this.tableLayoutPanelAdvanced.Controls.Add(this.buttonAdvancedDefault, 0, 3); + this.tableLayoutPanelAdvanced.Controls.Add(this.buttonAdvancedDefault, 0, 4); + this.tableLayoutPanelAdvanced.Controls.Add(this.groupBoxSorting, 0, 3); + this.tableLayoutPanelAdvanced.Controls.Add(this.groupBoxHiddenFilesAndFolders, 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 = 4; + this.tableLayoutPanelAdvanced.RowCount = 5; + 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()); @@ -1389,129 +1397,58 @@ namespace SystemTrayMenu.UserInterface this.tableLayoutPanelAdvanced.Size = new System.Drawing.Size(408, 407); this.tableLayoutPanelAdvanced.TabIndex = 0; // - // groupBoxSorting + // groupBoxDrag // - this.groupBoxSorting.AutoSize = true; - this.groupBoxSorting.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; - this.groupBoxSorting.Controls.Add(this.tableLayoutPanel5); - this.groupBoxSorting.Location = new System.Drawing.Point(3, 234); - this.groupBoxSorting.MaximumSize = new System.Drawing.Size(400, 0); - this.groupBoxSorting.MinimumSize = new System.Drawing.Size(400, 0); - this.groupBoxSorting.Name = "groupBoxSorting"; - this.groupBoxSorting.Size = new System.Drawing.Size(400, 72); - this.groupBoxSorting.TabIndex = 3; - this.groupBoxSorting.TabStop = false; - this.groupBoxSorting.Text = "groupBoxSorting"; + this.groupBoxDrag.AutoSize = true; + this.groupBoxDrag.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; + this.groupBoxDrag.Controls.Add(this.tableLayoutPanel1); + this.groupBoxDrag.Location = new System.Drawing.Point(3, 131); + this.groupBoxDrag.MaximumSize = new System.Drawing.Size(400, 0); + this.groupBoxDrag.MinimumSize = new System.Drawing.Size(400, 0); + this.groupBoxDrag.Name = "groupBoxDrag"; + this.groupBoxDrag.Size = new System.Drawing.Size(400, 72); + this.groupBoxDrag.TabIndex = 4; + this.groupBoxDrag.TabStop = false; + this.groupBoxDrag.Text = "groupBoxDrag"; // - // tableLayoutPanel5 + // tableLayoutPanel1 // - this.tableLayoutPanel5.AutoSize = true; - this.tableLayoutPanel5.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; - this.tableLayoutPanel5.ColumnCount = 1; - this.tableLayoutPanel5.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); - this.tableLayoutPanel5.Controls.Add(this.radioButtonSortByDate, 0, 1); - this.tableLayoutPanel5.Controls.Add(this.radioButtonSortByName, 0, 0); - this.tableLayoutPanel5.Dock = System.Windows.Forms.DockStyle.Fill; - this.tableLayoutPanel5.Location = new System.Drawing.Point(3, 19); - this.tableLayoutPanel5.Name = "tableLayoutPanel5"; - this.tableLayoutPanel5.RowCount = 2; - this.tableLayoutPanel5.RowStyles.Add(new System.Windows.Forms.RowStyle()); - this.tableLayoutPanel5.RowStyles.Add(new System.Windows.Forms.RowStyle()); - this.tableLayoutPanel5.Size = new System.Drawing.Size(394, 50); - this.tableLayoutPanel5.TabIndex = 1; + this.tableLayoutPanel1.AutoSize = true; + this.tableLayoutPanel1.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; + this.tableLayoutPanel1.ColumnCount = 1; + this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.tableLayoutPanel1.Controls.Add(this.checkBoxSwipeScrolling, 0, 1); + this.tableLayoutPanel1.Controls.Add(this.checkBoxDragDropItems, 0, 0); + this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill; + this.tableLayoutPanel1.Location = new System.Drawing.Point(3, 19); + this.tableLayoutPanel1.Name = "tableLayoutPanel1"; + this.tableLayoutPanel1.RowCount = 2; + this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle()); + this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle()); + this.tableLayoutPanel1.Size = new System.Drawing.Size(394, 50); + this.tableLayoutPanel1.TabIndex = 1; // - // radioButtonSortByDate + // checkBoxSwipeScrolling // - this.radioButtonSortByDate.AutoSize = true; - this.radioButtonSortByDate.Dock = System.Windows.Forms.DockStyle.Fill; - this.radioButtonSortByDate.Location = new System.Drawing.Point(3, 28); - this.radioButtonSortByDate.Name = "radioButtonSortByDate"; - this.radioButtonSortByDate.Size = new System.Drawing.Size(388, 19); - this.radioButtonSortByDate.TabIndex = 1; - this.radioButtonSortByDate.TabStop = true; - this.radioButtonSortByDate.Text = "radioButtonSortByDate"; - this.radioButtonSortByDate.UseVisualStyleBackColor = true; + this.checkBoxSwipeScrolling.AutoSize = true; + this.checkBoxSwipeScrolling.Dock = System.Windows.Forms.DockStyle.Fill; + this.checkBoxSwipeScrolling.Location = new System.Drawing.Point(3, 28); + this.checkBoxSwipeScrolling.Name = "checkBoxSwipeScrolling"; + this.checkBoxSwipeScrolling.Size = new System.Drawing.Size(388, 19); + this.checkBoxSwipeScrolling.TabIndex = 4; + this.checkBoxSwipeScrolling.Text = "checkBoxSwipeScrolling"; + this.checkBoxSwipeScrolling.UseVisualStyleBackColor = true; // - // radioButtonSortByName + // checkBoxDragDropItems // - this.radioButtonSortByName.AutoSize = true; - this.radioButtonSortByName.Dock = System.Windows.Forms.DockStyle.Fill; - this.radioButtonSortByName.Location = new System.Drawing.Point(3, 3); - this.radioButtonSortByName.Name = "radioButtonSortByName"; - this.radioButtonSortByName.Size = new System.Drawing.Size(388, 19); - this.radioButtonSortByName.TabIndex = 2; - this.radioButtonSortByName.TabStop = true; - this.radioButtonSortByName.Text = "radioButtonSortByName"; - this.radioButtonSortByName.UseVisualStyleBackColor = true; - // - // groupBoxHiddenFilesAndFolders - // - this.groupBoxHiddenFilesAndFolders.AutoSize = true; - this.groupBoxHiddenFilesAndFolders.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; - this.groupBoxHiddenFilesAndFolders.Controls.Add(this.tableLayoutPanelHiddenFilesAndFolders); - this.groupBoxHiddenFilesAndFolders.Location = new System.Drawing.Point(3, 131); - this.groupBoxHiddenFilesAndFolders.MaximumSize = new System.Drawing.Size(400, 0); - this.groupBoxHiddenFilesAndFolders.MinimumSize = new System.Drawing.Size(400, 0); - this.groupBoxHiddenFilesAndFolders.Name = "groupBoxHiddenFilesAndFolders"; - this.groupBoxHiddenFilesAndFolders.Size = new System.Drawing.Size(400, 97); - this.groupBoxHiddenFilesAndFolders.TabIndex = 2; - this.groupBoxHiddenFilesAndFolders.TabStop = false; - this.groupBoxHiddenFilesAndFolders.Text = "groupBoxHiddenFilesAndFolders"; - // - // tableLayoutPanelHiddenFilesAndFolders - // - this.tableLayoutPanelHiddenFilesAndFolders.AutoSize = true; - this.tableLayoutPanelHiddenFilesAndFolders.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; - this.tableLayoutPanelHiddenFilesAndFolders.ColumnCount = 1; - this.tableLayoutPanelHiddenFilesAndFolders.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); - this.tableLayoutPanelHiddenFilesAndFolders.Controls.Add(this.radioButtonAlwaysShowHiddenFiles, 0, 2); - this.tableLayoutPanelHiddenFilesAndFolders.Controls.Add(this.radioButtonNeverShowHiddenFiles, 0, 1); - this.tableLayoutPanelHiddenFilesAndFolders.Controls.Add(this.radioButtonSystemSettingsShowHiddenFiles, 0, 0); - this.tableLayoutPanelHiddenFilesAndFolders.Dock = System.Windows.Forms.DockStyle.Fill; - this.tableLayoutPanelHiddenFilesAndFolders.Location = new System.Drawing.Point(3, 19); - this.tableLayoutPanelHiddenFilesAndFolders.Name = "tableLayoutPanelHiddenFilesAndFolders"; - this.tableLayoutPanelHiddenFilesAndFolders.RowCount = 3; - this.tableLayoutPanelHiddenFilesAndFolders.RowStyles.Add(new System.Windows.Forms.RowStyle()); - this.tableLayoutPanelHiddenFilesAndFolders.RowStyles.Add(new System.Windows.Forms.RowStyle()); - this.tableLayoutPanelHiddenFilesAndFolders.RowStyles.Add(new System.Windows.Forms.RowStyle()); - this.tableLayoutPanelHiddenFilesAndFolders.Size = new System.Drawing.Size(394, 75); - this.tableLayoutPanelHiddenFilesAndFolders.TabIndex = 1; - // - // radioButtonAlwaysShowHiddenFiles - // - this.radioButtonAlwaysShowHiddenFiles.AutoSize = true; - this.radioButtonAlwaysShowHiddenFiles.Dock = System.Windows.Forms.DockStyle.Fill; - this.radioButtonAlwaysShowHiddenFiles.Location = new System.Drawing.Point(3, 53); - this.radioButtonAlwaysShowHiddenFiles.Name = "radioButtonAlwaysShowHiddenFiles"; - this.radioButtonAlwaysShowHiddenFiles.Size = new System.Drawing.Size(388, 19); - this.radioButtonAlwaysShowHiddenFiles.TabIndex = 2; - this.radioButtonAlwaysShowHiddenFiles.TabStop = true; - this.radioButtonAlwaysShowHiddenFiles.Text = "radioButtonAlwaysShowHiddenFiles"; - this.radioButtonAlwaysShowHiddenFiles.UseVisualStyleBackColor = true; - // - // radioButtonNeverShowHiddenFiles - // - this.radioButtonNeverShowHiddenFiles.AutoSize = true; - this.radioButtonNeverShowHiddenFiles.Dock = System.Windows.Forms.DockStyle.Fill; - this.radioButtonNeverShowHiddenFiles.Location = new System.Drawing.Point(3, 28); - this.radioButtonNeverShowHiddenFiles.Name = "radioButtonNeverShowHiddenFiles"; - this.radioButtonNeverShowHiddenFiles.Size = new System.Drawing.Size(388, 19); - this.radioButtonNeverShowHiddenFiles.TabIndex = 1; - this.radioButtonNeverShowHiddenFiles.TabStop = true; - this.radioButtonNeverShowHiddenFiles.Text = "radioButtonNeverShowHiddenFiles"; - this.radioButtonNeverShowHiddenFiles.UseVisualStyleBackColor = true; - // - // radioButtonSystemSettingsShowHiddenFiles - // - this.radioButtonSystemSettingsShowHiddenFiles.AutoSize = true; - this.radioButtonSystemSettingsShowHiddenFiles.Dock = System.Windows.Forms.DockStyle.Fill; - this.radioButtonSystemSettingsShowHiddenFiles.Location = new System.Drawing.Point(3, 3); - this.radioButtonSystemSettingsShowHiddenFiles.Name = "radioButtonSystemSettingsShowHiddenFiles"; - this.radioButtonSystemSettingsShowHiddenFiles.Size = new System.Drawing.Size(388, 19); - this.radioButtonSystemSettingsShowHiddenFiles.TabIndex = 2; - this.radioButtonSystemSettingsShowHiddenFiles.TabStop = true; - this.radioButtonSystemSettingsShowHiddenFiles.Text = "radioButtonSystemSettingsShowHiddenFiles"; - this.radioButtonSystemSettingsShowHiddenFiles.UseVisualStyleBackColor = true; + this.checkBoxDragDropItems.AutoSize = true; + this.checkBoxDragDropItems.Dock = System.Windows.Forms.DockStyle.Fill; + this.checkBoxDragDropItems.Location = new System.Drawing.Point(3, 3); + this.checkBoxDragDropItems.Name = "checkBoxDragDropItems"; + this.checkBoxDragDropItems.Size = new System.Drawing.Size(388, 19); + this.checkBoxDragDropItems.TabIndex = 3; + this.checkBoxDragDropItems.Text = "checkBoxDragDropItems"; + this.checkBoxDragDropItems.UseVisualStyleBackColor = true; // // groupBoxClick // @@ -1597,7 +1534,7 @@ namespace SystemTrayMenu.UserInterface // this.buttonAdvancedDefault.AutoSize = true; this.buttonAdvancedDefault.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; - this.buttonAdvancedDefault.Location = new System.Drawing.Point(9, 318); + this.buttonAdvancedDefault.Location = new System.Drawing.Point(9, 396); 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"; @@ -1607,6 +1544,130 @@ namespace SystemTrayMenu.UserInterface this.buttonAdvancedDefault.UseVisualStyleBackColor = true; this.buttonAdvancedDefault.Click += new System.EventHandler(this.ButtonAdvancedDefault_Click); // + // groupBoxSorting + // + this.groupBoxSorting.AutoSize = true; + this.groupBoxSorting.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; + this.groupBoxSorting.Controls.Add(this.tableLayoutPanel5); + this.groupBoxSorting.Location = new System.Drawing.Point(3, 312); + this.groupBoxSorting.MaximumSize = new System.Drawing.Size(400, 0); + this.groupBoxSorting.MinimumSize = new System.Drawing.Size(400, 0); + this.groupBoxSorting.Name = "groupBoxSorting"; + this.groupBoxSorting.Size = new System.Drawing.Size(400, 72); + this.groupBoxSorting.TabIndex = 3; + this.groupBoxSorting.TabStop = false; + this.groupBoxSorting.Text = "groupBoxSorting"; + // + // tableLayoutPanel5 + // + this.tableLayoutPanel5.AutoSize = true; + this.tableLayoutPanel5.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; + this.tableLayoutPanel5.ColumnCount = 1; + this.tableLayoutPanel5.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.tableLayoutPanel5.Controls.Add(this.radioButtonSortByDate, 0, 1); + this.tableLayoutPanel5.Controls.Add(this.radioButtonSortByName, 0, 0); + this.tableLayoutPanel5.Dock = System.Windows.Forms.DockStyle.Fill; + this.tableLayoutPanel5.Location = new System.Drawing.Point(3, 19); + this.tableLayoutPanel5.Name = "tableLayoutPanel5"; + this.tableLayoutPanel5.RowCount = 2; + this.tableLayoutPanel5.RowStyles.Add(new System.Windows.Forms.RowStyle()); + this.tableLayoutPanel5.RowStyles.Add(new System.Windows.Forms.RowStyle()); + this.tableLayoutPanel5.Size = new System.Drawing.Size(394, 50); + this.tableLayoutPanel5.TabIndex = 1; + // + // radioButtonSortByDate + // + this.radioButtonSortByDate.AutoSize = true; + this.radioButtonSortByDate.Dock = System.Windows.Forms.DockStyle.Fill; + this.radioButtonSortByDate.Location = new System.Drawing.Point(3, 28); + this.radioButtonSortByDate.Name = "radioButtonSortByDate"; + this.radioButtonSortByDate.Size = new System.Drawing.Size(388, 19); + this.radioButtonSortByDate.TabIndex = 1; + this.radioButtonSortByDate.TabStop = true; + this.radioButtonSortByDate.Text = "radioButtonSortByDate"; + this.radioButtonSortByDate.UseVisualStyleBackColor = true; + // + // radioButtonSortByName + // + this.radioButtonSortByName.AutoSize = true; + this.radioButtonSortByName.Dock = System.Windows.Forms.DockStyle.Fill; + this.radioButtonSortByName.Location = new System.Drawing.Point(3, 3); + this.radioButtonSortByName.Name = "radioButtonSortByName"; + this.radioButtonSortByName.Size = new System.Drawing.Size(388, 19); + this.radioButtonSortByName.TabIndex = 2; + this.radioButtonSortByName.TabStop = true; + this.radioButtonSortByName.Text = "radioButtonSortByName"; + this.radioButtonSortByName.UseVisualStyleBackColor = true; + // + // groupBoxHiddenFilesAndFolders + // + this.groupBoxHiddenFilesAndFolders.AutoSize = true; + this.groupBoxHiddenFilesAndFolders.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; + this.groupBoxHiddenFilesAndFolders.Controls.Add(this.tableLayoutPanelHiddenFilesAndFolders); + this.groupBoxHiddenFilesAndFolders.Location = new System.Drawing.Point(3, 209); + this.groupBoxHiddenFilesAndFolders.MaximumSize = new System.Drawing.Size(400, 0); + this.groupBoxHiddenFilesAndFolders.MinimumSize = new System.Drawing.Size(400, 0); + this.groupBoxHiddenFilesAndFolders.Name = "groupBoxHiddenFilesAndFolders"; + this.groupBoxHiddenFilesAndFolders.Size = new System.Drawing.Size(400, 97); + this.groupBoxHiddenFilesAndFolders.TabIndex = 2; + this.groupBoxHiddenFilesAndFolders.TabStop = false; + this.groupBoxHiddenFilesAndFolders.Text = "groupBoxHiddenFilesAndFolders"; + // + // tableLayoutPanelHiddenFilesAndFolders + // + this.tableLayoutPanelHiddenFilesAndFolders.AutoSize = true; + this.tableLayoutPanelHiddenFilesAndFolders.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; + this.tableLayoutPanelHiddenFilesAndFolders.ColumnCount = 1; + this.tableLayoutPanelHiddenFilesAndFolders.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.tableLayoutPanelHiddenFilesAndFolders.Controls.Add(this.radioButtonAlwaysShowHiddenFiles, 0, 2); + this.tableLayoutPanelHiddenFilesAndFolders.Controls.Add(this.radioButtonNeverShowHiddenFiles, 0, 1); + this.tableLayoutPanelHiddenFilesAndFolders.Controls.Add(this.radioButtonSystemSettingsShowHiddenFiles, 0, 0); + this.tableLayoutPanelHiddenFilesAndFolders.Dock = System.Windows.Forms.DockStyle.Fill; + this.tableLayoutPanelHiddenFilesAndFolders.Location = new System.Drawing.Point(3, 19); + this.tableLayoutPanelHiddenFilesAndFolders.Name = "tableLayoutPanelHiddenFilesAndFolders"; + this.tableLayoutPanelHiddenFilesAndFolders.RowCount = 3; + this.tableLayoutPanelHiddenFilesAndFolders.RowStyles.Add(new System.Windows.Forms.RowStyle()); + this.tableLayoutPanelHiddenFilesAndFolders.RowStyles.Add(new System.Windows.Forms.RowStyle()); + this.tableLayoutPanelHiddenFilesAndFolders.RowStyles.Add(new System.Windows.Forms.RowStyle()); + this.tableLayoutPanelHiddenFilesAndFolders.Size = new System.Drawing.Size(394, 75); + this.tableLayoutPanelHiddenFilesAndFolders.TabIndex = 1; + // + // radioButtonAlwaysShowHiddenFiles + // + this.radioButtonAlwaysShowHiddenFiles.AutoSize = true; + this.radioButtonAlwaysShowHiddenFiles.Dock = System.Windows.Forms.DockStyle.Fill; + this.radioButtonAlwaysShowHiddenFiles.Location = new System.Drawing.Point(3, 53); + this.radioButtonAlwaysShowHiddenFiles.Name = "radioButtonAlwaysShowHiddenFiles"; + this.radioButtonAlwaysShowHiddenFiles.Size = new System.Drawing.Size(388, 19); + this.radioButtonAlwaysShowHiddenFiles.TabIndex = 2; + this.radioButtonAlwaysShowHiddenFiles.TabStop = true; + this.radioButtonAlwaysShowHiddenFiles.Text = "radioButtonAlwaysShowHiddenFiles"; + this.radioButtonAlwaysShowHiddenFiles.UseVisualStyleBackColor = true; + // + // radioButtonNeverShowHiddenFiles + // + this.radioButtonNeverShowHiddenFiles.AutoSize = true; + this.radioButtonNeverShowHiddenFiles.Dock = System.Windows.Forms.DockStyle.Fill; + this.radioButtonNeverShowHiddenFiles.Location = new System.Drawing.Point(3, 28); + this.radioButtonNeverShowHiddenFiles.Name = "radioButtonNeverShowHiddenFiles"; + this.radioButtonNeverShowHiddenFiles.Size = new System.Drawing.Size(388, 19); + this.radioButtonNeverShowHiddenFiles.TabIndex = 1; + this.radioButtonNeverShowHiddenFiles.TabStop = true; + this.radioButtonNeverShowHiddenFiles.Text = "radioButtonNeverShowHiddenFiles"; + this.radioButtonNeverShowHiddenFiles.UseVisualStyleBackColor = true; + // + // radioButtonSystemSettingsShowHiddenFiles + // + this.radioButtonSystemSettingsShowHiddenFiles.AutoSize = true; + this.radioButtonSystemSettingsShowHiddenFiles.Dock = System.Windows.Forms.DockStyle.Fill; + this.radioButtonSystemSettingsShowHiddenFiles.Location = new System.Drawing.Point(3, 3); + this.radioButtonSystemSettingsShowHiddenFiles.Name = "radioButtonSystemSettingsShowHiddenFiles"; + this.radioButtonSystemSettingsShowHiddenFiles.Size = new System.Drawing.Size(388, 19); + this.radioButtonSystemSettingsShowHiddenFiles.TabIndex = 2; + this.radioButtonSystemSettingsShowHiddenFiles.TabStop = true; + this.radioButtonSystemSettingsShowHiddenFiles.Text = "radioButtonSystemSettingsShowHiddenFiles"; + this.radioButtonSystemSettingsShowHiddenFiles.UseVisualStyleBackColor = true; + // // tabPageFolders // this.tabPageFolders.Controls.Add(this.tableLayoutPanelFoldersInRootFolder); @@ -4572,6 +4633,14 @@ namespace SystemTrayMenu.UserInterface this.tabPageAdvanced.PerformLayout(); this.tableLayoutPanelAdvanced.ResumeLayout(false); this.tableLayoutPanelAdvanced.PerformLayout(); + this.groupBoxDrag.ResumeLayout(false); + this.groupBoxDrag.PerformLayout(); + this.tableLayoutPanel1.ResumeLayout(false); + this.tableLayoutPanel1.PerformLayout(); + this.groupBoxClick.ResumeLayout(false); + this.groupBoxClick.PerformLayout(); + this.tableLayoutPanelClick.ResumeLayout(false); + this.tableLayoutPanelClick.PerformLayout(); this.groupBoxSorting.ResumeLayout(false); this.groupBoxSorting.PerformLayout(); this.tableLayoutPanel5.ResumeLayout(false); @@ -4580,10 +4649,6 @@ namespace SystemTrayMenu.UserInterface this.groupBoxHiddenFilesAndFolders.PerformLayout(); this.tableLayoutPanelHiddenFilesAndFolders.ResumeLayout(false); this.tableLayoutPanelHiddenFilesAndFolders.PerformLayout(); - this.groupBoxClick.ResumeLayout(false); - this.groupBoxClick.PerformLayout(); - this.tableLayoutPanelClick.ResumeLayout(false); - this.tableLayoutPanelClick.PerformLayout(); this.tabPageFolders.ResumeLayout(false); this.tabPageFolders.PerformLayout(); this.tableLayoutPanelFoldersInRootFolder.ResumeLayout(false); @@ -5045,5 +5110,9 @@ namespace SystemTrayMenu.UserInterface private System.Windows.Forms.TableLayoutPanel tableLayoutPanel5; private System.Windows.Forms.RadioButton radioButtonSortByDate; private System.Windows.Forms.RadioButton radioButtonSortByName; + private System.Windows.Forms.GroupBox groupBoxDrag; + private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1; + private System.Windows.Forms.CheckBox checkBoxSwipeScrolling; + private System.Windows.Forms.CheckBox checkBoxDragDropItems; } } \ No newline at end of file diff --git a/UserInterface/SettingsForm.cs b/UserInterface/SettingsForm.cs index 9cc381f..7e586a7 100644 --- a/UserInterface/SettingsForm.cs +++ b/UserInterface/SettingsForm.cs @@ -149,6 +149,9 @@ namespace SystemTrayMenu.UserInterface checkBoxSendHotkeyInsteadKillOtherInstances.Text = Translator.GetText("Send hotkey to other instance"); checkBoxOpenItemWithOneClick.Text = Translator.GetText("Single click to open an item instead of double click"); checkBoxOpenDirectoryWithOneClick.Text = Translator.GetText("Single click to open a directory instead of double click"); + groupBoxDrag.Text = Translator.GetText("Drag"); + checkBoxDragDropItems.Text = Translator.GetText("Copy row item via drag drop"); + checkBoxSwipeScrolling.Text = Translator.GetText("Scroll via swipe"); groupBoxHiddenFilesAndFolders.Text = Translator.GetText("Hidden files and folders"); radioButtonSystemSettingsShowHiddenFiles.Text = Translator.GetText("Use operating system settings"); radioButtonNeverShowHiddenFiles.Text = Translator.GetText("Never show hidden files, folders or drives"); @@ -399,6 +402,17 @@ namespace SystemTrayMenu.UserInterface checkBoxOpenItemWithOneClick.Checked = Settings.Default.OpenItemWithOneClick; checkBoxOpenDirectoryWithOneClick.Checked = Settings.Default.OpenDirectoryWithOneClick; + if (DllImports.NativeMethods.IsTouchEnabled()) + { + checkBoxDragDropItems.Checked = Settings.Default.DragDropItemsEnabledTouch; + checkBoxSwipeScrolling.Checked = Settings.Default.SwipeScrollingEnabledTouch; + } + else + { + checkBoxDragDropItems.Checked = Settings.Default.DragDropItemsEnabled; + checkBoxSwipeScrolling.Checked = Settings.Default.SwipeScrollingEnabled; + } + radioButtonSystemSettingsShowHiddenFiles.Checked = Settings.Default.SystemSettingsShowHiddenFiles; radioButtonNeverShowHiddenFiles.Checked = Settings.Default.NeverShowHiddenFiles; radioButtonAlwaysShowHiddenFiles.Checked = Settings.Default.AlwaysShowHiddenFiles; @@ -835,6 +849,18 @@ namespace SystemTrayMenu.UserInterface Settings.Default.SendHotkeyInsteadKillOtherInstances = checkBoxSendHotkeyInsteadKillOtherInstances.Checked; Settings.Default.OpenItemWithOneClick = checkBoxOpenItemWithOneClick.Checked; Settings.Default.OpenDirectoryWithOneClick = checkBoxOpenDirectoryWithOneClick.Checked; + + if (DllImports.NativeMethods.IsTouchEnabled()) + { + Settings.Default.DragDropItemsEnabledTouch = checkBoxDragDropItems.Checked; + Settings.Default.SwipeScrollingEnabledTouch = checkBoxSwipeScrolling.Checked; + } + else + { + Settings.Default.DragDropItemsEnabled = checkBoxDragDropItems.Checked; + Settings.Default.SwipeScrollingEnabled = checkBoxSwipeScrolling.Checked; + } + Settings.Default.SystemSettingsShowHiddenFiles = radioButtonSystemSettingsShowHiddenFiles.Checked; Settings.Default.AlwaysShowHiddenFiles = radioButtonAlwaysShowHiddenFiles.Checked; Settings.Default.NeverShowHiddenFiles = radioButtonNeverShowHiddenFiles.Checked;