From 2dc057dc3c627130034bcb9698c3f3ce8f86ee36 Mon Sep 17 00:00:00 2001 From: Xanfre Date: Sat, 17 Aug 2019 17:14:46 -0500 Subject: [PATCH 1/5] FMsDGV: Change colors to be more visually comprehensive --- AngelLoader/Forms/MainForm_InitManual.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/AngelLoader/Forms/MainForm_InitManual.cs b/AngelLoader/Forms/MainForm_InitManual.cs index d2b97855b..6399d598d 100644 --- a/AngelLoader/Forms/MainForm_InitManual.cs +++ b/AngelLoader/Forms/MainForm_InitManual.cs @@ -443,6 +443,11 @@ private void InitComponentManual() FMsDGV.StandardTab = true; FMsDGV.TabIndex = 0; FMsDGV.VirtualMode = true; + FMsDGV.BackgroundColor = SystemColors.Control; + FMsDGV.EnableHeadersVisualStyles = false; + FMsDGV.ColumnHeadersDefaultCellStyle.SelectionBackColor = SystemColors.Menu; + FMsDGV.ColumnHeadersDefaultCellStyle.SelectionForeColor = SystemColors.Menu; + FMsDGV.ColumnHeadersDefaultCellStyle.Padding = new Padding(1); FMsDGV.CellDoubleClick += FMsDGV_CellDoubleClick; FMsDGV.CellValueNeeded += FMsDGV_CellValueNeeded_Initial; FMsDGV.ColumnHeaderMouseClick += FMsDGV_ColumnHeaderMouseClick; From 67f96db1a15ac976b4ce64e8746d0e7d2b31de86 Mon Sep 17 00:00:00 2001 From: Xanfre Date: Sat, 17 Aug 2019 17:20:43 -0500 Subject: [PATCH 2/5] Temporary fix for odd mouse behavior --- AngelLoader/Forms/MainForm.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/AngelLoader/Forms/MainForm.cs b/AngelLoader/Forms/MainForm.cs index 5eb0d9fe5..ab71cc37e 100644 --- a/AngelLoader/Forms/MainForm.cs +++ b/AngelLoader/Forms/MainForm.cs @@ -935,7 +935,10 @@ private void MainForm_Load(object sender, EventArgs e) AppMouseKeyHook.MouseMoveExt += HookMouseMove; AppMouseKeyHook.KeyDown += HookKeyDown; AppMouseKeyHook.KeyUp += HookKeyUp; - Application.AddMessageFilter(this); + // This causes some oddities on MainForm, such as wrongly highlighting the control box when + // hovering over certain regions of the form + // Disable for now + //Application.AddMessageFilter(this); } private void MainForm_Shown(object sender, EventArgs e) From c78f432c28ceb2ac38476692a1791b0ae9aad81f Mon Sep 17 00:00:00 2001 From: Xanfre Date: Sat, 17 Aug 2019 19:18:46 -0500 Subject: [PATCH 3/5] Implement better method for displaying readme controls --- AngelLoader/Forms/MainForm.cs | 53 ++++++++++++++++++------ AngelLoader/Forms/MainForm_InitManual.cs | 7 ++++ 2 files changed, 47 insertions(+), 13 deletions(-) diff --git a/AngelLoader/Forms/MainForm.cs b/AngelLoader/Forms/MainForm.cs index ab71cc37e..286a18f12 100644 --- a/AngelLoader/Forms/MainForm.cs +++ b/AngelLoader/Forms/MainForm.cs @@ -575,18 +575,6 @@ private void HookMouseDown(object sender, MouseEventExtArgs e) } } - private void HookMouseMove(object sender, MouseEventExtArgs e) - { - if (!CanFocus) return; - if (ViewBlocked) - { - e.Handled = true; - return; - } - - ShowReadmeControls(CursorOverReadmeArea()); - } - private void HookKeyDown(object sender, KeyEventArgs e) { if (e.Alt && e.KeyCode == Keys.F4) return; @@ -932,7 +920,6 @@ private void MainForm_Load(object sender, EventArgs e) // Hook these up last so they don't cause anything to happen while we're initializing AppMouseKeyHook = Hook.AppEvents(); AppMouseKeyHook.MouseDownExt += HookMouseDown; - AppMouseKeyHook.MouseMoveExt += HookMouseMove; AppMouseKeyHook.KeyDown += HookKeyDown; AppMouseKeyHook.KeyUp += HookKeyUp; // This causes some oddities on MainForm, such as wrongly highlighting the control box when @@ -3852,6 +3839,21 @@ private void ChooseReadmeComboBox_DropDownClosed(object sender, EventArgs e) private void ReadmeRichTextBox_LinkClicked(object sender, LinkClickedEventArgs e) => Core.OpenLink(e.LinkText); + private void ReadmeRichTextBox_MouseEnter(object sender, EventArgs e) + { + ShowReadmeControls(true); + } + + private void ReadmeRichTextBox_MouseLeave(object sender, EventArgs e) + { + if (!CursorOverControl(ReadmeZoomInButton) && !CursorOverControl(ReadmeZoomOutButton) && + !CursorOverControl(ReadmeResetZoomButton) && !CursorOverControl(ReadmeFullScreenButton) && + !CursorOverControl(ChooseReadmeComboBox)) + { + ShowReadmeControls(false); + } + } + private void ReadmeZoomInButton_Click(object sender, EventArgs e) => ReadmeRichTextBox.ZoomIn(); private void ReadmeZoomOutButton_Click(object sender, EventArgs e) => ReadmeRichTextBox.ZoomOut(); @@ -3864,6 +3866,31 @@ private void ReadmeFullScreenButton_Click(object sender, EventArgs e) ShowReadmeControls(CursorOverReadmeArea()); } + private void ReadmeZoomInButton_MouseLeave(object sender, EventArgs e) + { + ShowReadmeControls(false); + } + + private void ReadmeZoomOutButton_MouseLeave(object sender, EventArgs e) + { + ShowReadmeControls(false); + } + + private void ReadmeResetZoomButton_MouseLeave(object sender, EventArgs e) + { + ShowReadmeControls(false); + } + + private void ReadmeFullScreenButton_MouseLeave(object sender, EventArgs e) + { + ShowReadmeControls(false); + } + + private void ChooseReadmeComboBox_MouseLeave(object sender, EventArgs e) + { + ShowReadmeControls(false); + } + private void SetReadmeVisible(bool enabled) { ReadmeRichTextBox.Visible = enabled; diff --git a/AngelLoader/Forms/MainForm_InitManual.cs b/AngelLoader/Forms/MainForm_InitManual.cs index 6399d598d..4ca78868b 100644 --- a/AngelLoader/Forms/MainForm_InitManual.cs +++ b/AngelLoader/Forms/MainForm_InitManual.cs @@ -1414,6 +1414,7 @@ private void InitComponentManual() ReadmeFullScreenButton.Visible = false; ReadmeFullScreenButton.Click += ReadmeFullScreenButton_Click; ReadmeFullScreenButton.Paint += ReadmeFullScreenButton_Paint; + ReadmeFullScreenButton.MouseLeave += ReadmeFullScreenButton_MouseLeave; // // ZoomInButton // @@ -1428,6 +1429,7 @@ private void InitComponentManual() ReadmeZoomInButton.UseVisualStyleBackColor = false; ReadmeZoomInButton.Visible = false; ReadmeZoomInButton.Click += ReadmeZoomInButton_Click; + ReadmeZoomInButton.MouseLeave += ReadmeZoomInButton_MouseLeave; // // ZoomOutButton // @@ -1443,6 +1445,7 @@ private void InitComponentManual() ReadmeZoomOutButton.UseVisualStyleBackColor = false; ReadmeZoomOutButton.Visible = false; ReadmeZoomOutButton.Click += ReadmeZoomOutButton_Click; + ReadmeZoomOutButton.MouseLeave += ReadmeZoomOutButton_MouseLeave; // // ResetZoomButton // @@ -1457,6 +1460,7 @@ private void InitComponentManual() ReadmeResetZoomButton.UseVisualStyleBackColor = false; ReadmeResetZoomButton.Visible = false; ReadmeResetZoomButton.Click += ReadmeResetZoomButton_Click; + ReadmeResetZoomButton.MouseLeave += ReadmeResetZoomButton_MouseLeave; #endregion // @@ -1471,6 +1475,7 @@ private void InitComponentManual() ChooseReadmeComboBox.Visible = false; ChooseReadmeComboBox.SelectedIndexChanged += ChooseReadmeComboBox_SelectedIndexChanged; ChooseReadmeComboBox.DropDownClosed += ChooseReadmeComboBox_DropDownClosed; + ChooseReadmeComboBox.MouseLeave += ChooseReadmeComboBox_MouseLeave; // // ReadmeRichTextBox // @@ -1479,6 +1484,8 @@ private void InitComponentManual() ReadmeRichTextBox.Dock = DockStyle.Fill; ReadmeRichTextBox.TabIndex = 0; ReadmeRichTextBox.LinkClicked += ReadmeRichTextBox_LinkClicked; + ReadmeRichTextBox.MouseEnter += ReadmeRichTextBox_MouseEnter; + ReadmeRichTextBox.MouseLeave += ReadmeRichTextBox_MouseLeave; // // MainForm // From d1e9f9d3d2592db5f6b43d3ef2d5a6a347b3462f Mon Sep 17 00:00:00 2001 From: Xanfre Date: Sat, 17 Aug 2019 20:35:04 -0500 Subject: [PATCH 4/5] Remove mouseleave handling for readme controls themselves --- AngelLoader/Forms/MainForm.cs | 25 ------------------------ AngelLoader/Forms/MainForm_InitManual.cs | 5 ----- 2 files changed, 30 deletions(-) diff --git a/AngelLoader/Forms/MainForm.cs b/AngelLoader/Forms/MainForm.cs index 286a18f12..4840ab739 100644 --- a/AngelLoader/Forms/MainForm.cs +++ b/AngelLoader/Forms/MainForm.cs @@ -3866,31 +3866,6 @@ private void ReadmeFullScreenButton_Click(object sender, EventArgs e) ShowReadmeControls(CursorOverReadmeArea()); } - private void ReadmeZoomInButton_MouseLeave(object sender, EventArgs e) - { - ShowReadmeControls(false); - } - - private void ReadmeZoomOutButton_MouseLeave(object sender, EventArgs e) - { - ShowReadmeControls(false); - } - - private void ReadmeResetZoomButton_MouseLeave(object sender, EventArgs e) - { - ShowReadmeControls(false); - } - - private void ReadmeFullScreenButton_MouseLeave(object sender, EventArgs e) - { - ShowReadmeControls(false); - } - - private void ChooseReadmeComboBox_MouseLeave(object sender, EventArgs e) - { - ShowReadmeControls(false); - } - private void SetReadmeVisible(bool enabled) { ReadmeRichTextBox.Visible = enabled; diff --git a/AngelLoader/Forms/MainForm_InitManual.cs b/AngelLoader/Forms/MainForm_InitManual.cs index 4ca78868b..5847948e9 100644 --- a/AngelLoader/Forms/MainForm_InitManual.cs +++ b/AngelLoader/Forms/MainForm_InitManual.cs @@ -1414,7 +1414,6 @@ private void InitComponentManual() ReadmeFullScreenButton.Visible = false; ReadmeFullScreenButton.Click += ReadmeFullScreenButton_Click; ReadmeFullScreenButton.Paint += ReadmeFullScreenButton_Paint; - ReadmeFullScreenButton.MouseLeave += ReadmeFullScreenButton_MouseLeave; // // ZoomInButton // @@ -1429,7 +1428,6 @@ private void InitComponentManual() ReadmeZoomInButton.UseVisualStyleBackColor = false; ReadmeZoomInButton.Visible = false; ReadmeZoomInButton.Click += ReadmeZoomInButton_Click; - ReadmeZoomInButton.MouseLeave += ReadmeZoomInButton_MouseLeave; // // ZoomOutButton // @@ -1445,7 +1443,6 @@ private void InitComponentManual() ReadmeZoomOutButton.UseVisualStyleBackColor = false; ReadmeZoomOutButton.Visible = false; ReadmeZoomOutButton.Click += ReadmeZoomOutButton_Click; - ReadmeZoomOutButton.MouseLeave += ReadmeZoomOutButton_MouseLeave; // // ResetZoomButton // @@ -1460,7 +1457,6 @@ private void InitComponentManual() ReadmeResetZoomButton.UseVisualStyleBackColor = false; ReadmeResetZoomButton.Visible = false; ReadmeResetZoomButton.Click += ReadmeResetZoomButton_Click; - ReadmeResetZoomButton.MouseLeave += ReadmeResetZoomButton_MouseLeave; #endregion // @@ -1475,7 +1471,6 @@ private void InitComponentManual() ChooseReadmeComboBox.Visible = false; ChooseReadmeComboBox.SelectedIndexChanged += ChooseReadmeComboBox_SelectedIndexChanged; ChooseReadmeComboBox.DropDownClosed += ChooseReadmeComboBox_DropDownClosed; - ChooseReadmeComboBox.MouseLeave += ChooseReadmeComboBox_MouseLeave; // // ReadmeRichTextBox // From c9948a85d5cc186827daa2a87c9e5e6f18ecc50b Mon Sep 17 00:00:00 2001 From: Xanfre Date: Sat, 17 Aug 2019 23:23:31 -0500 Subject: [PATCH 5/5] Partial revert --- AngelLoader/Forms/MainForm.cs | 24 +++++++++++++++++++++--- AngelLoader/Forms/MainForm_InitManual.cs | 2 +- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/AngelLoader/Forms/MainForm.cs b/AngelLoader/Forms/MainForm.cs index 4840ab739..d090f10e7 100644 --- a/AngelLoader/Forms/MainForm.cs +++ b/AngelLoader/Forms/MainForm.cs @@ -588,6 +588,18 @@ private void HookKeyDown(object sender, KeyEventArgs e) } } + private void HookMouseMove(object sender, MouseEventExtArgs e) + { + if (!CanFocus) return; + if (ViewBlocked) + { + e.Handled = true; + return; + } + + ShowReadmeControls(CursorOverReadmeArea()); + } + private void HookKeyUp(object sender, KeyEventArgs e) { if (e.Alt && e.KeyCode == Keys.F4) return; @@ -920,6 +932,7 @@ private void MainForm_Load(object sender, EventArgs e) // Hook these up last so they don't cause anything to happen while we're initializing AppMouseKeyHook = Hook.AppEvents(); AppMouseKeyHook.MouseDownExt += HookMouseDown; + AppMouseKeyHook.MouseMoveExt += HookMouseMove; AppMouseKeyHook.KeyDown += HookKeyDown; AppMouseKeyHook.KeyUp += HookKeyUp; // This causes some oddities on MainForm, such as wrongly highlighting the control box when @@ -3839,12 +3852,17 @@ private void ChooseReadmeComboBox_DropDownClosed(object sender, EventArgs e) private void ReadmeRichTextBox_LinkClicked(object sender, LinkClickedEventArgs e) => Core.OpenLink(e.LinkText); - private void ReadmeRichTextBox_MouseEnter(object sender, EventArgs e) + private void ReadmeRichTextBox_MouseLeave(object sender, EventArgs e) { - ShowReadmeControls(true); + if (!CursorOverControl(ReadmeZoomInButton) && !CursorOverControl(ReadmeZoomOutButton) && + !CursorOverControl(ReadmeResetZoomButton) && !CursorOverControl(ReadmeFullScreenButton) && + !CursorOverControl(ChooseReadmeComboBox)) + { + ShowReadmeControls(false); + } } - private void ReadmeRichTextBox_MouseLeave(object sender, EventArgs e) + private void Panel2_MouseLeave(object sender, EventArgs e) { if (!CursorOverControl(ReadmeZoomInButton) && !CursorOverControl(ReadmeZoomOutButton) && !CursorOverControl(ReadmeResetZoomButton) && !CursorOverControl(ReadmeFullScreenButton) && diff --git a/AngelLoader/Forms/MainForm_InitManual.cs b/AngelLoader/Forms/MainForm_InitManual.cs index 5847948e9..397d72263 100644 --- a/AngelLoader/Forms/MainForm_InitManual.cs +++ b/AngelLoader/Forms/MainForm_InitManual.cs @@ -355,6 +355,7 @@ private void InitComponentManual() MainSplitContainer.Size = new Size(1671, 672); MainSplitContainer.SplitterDistance = 309; MainSplitContainer.TabIndex = 0; + MainSplitContainer.Panel2.MouseLeave += Panel2_MouseLeave; // // TopSplitContainer // @@ -1479,7 +1480,6 @@ private void InitComponentManual() ReadmeRichTextBox.Dock = DockStyle.Fill; ReadmeRichTextBox.TabIndex = 0; ReadmeRichTextBox.LinkClicked += ReadmeRichTextBox_LinkClicked; - ReadmeRichTextBox.MouseEnter += ReadmeRichTextBox_MouseEnter; ReadmeRichTextBox.MouseLeave += ReadmeRichTextBox_MouseLeave; // // MainForm