diff --git a/AngelLoader/Forms/MainForm.cs b/AngelLoader/Forms/MainForm.cs index 5eb0d9fe5..d090f10e7 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; @@ -600,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; @@ -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) @@ -3849,6 +3852,26 @@ private void ChooseReadmeComboBox_DropDownClosed(object sender, EventArgs e) private void ReadmeRichTextBox_LinkClicked(object sender, LinkClickedEventArgs e) => Core.OpenLink(e.LinkText); + private void ReadmeRichTextBox_MouseLeave(object sender, EventArgs e) + { + if (!CursorOverControl(ReadmeZoomInButton) && !CursorOverControl(ReadmeZoomOutButton) && + !CursorOverControl(ReadmeResetZoomButton) && !CursorOverControl(ReadmeFullScreenButton) && + !CursorOverControl(ChooseReadmeComboBox)) + { + ShowReadmeControls(false); + } + } + + private void Panel2_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(); diff --git a/AngelLoader/Forms/MainForm_InitManual.cs b/AngelLoader/Forms/MainForm_InitManual.cs index d2b97855b..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 // @@ -443,6 +444,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; @@ -1474,6 +1480,7 @@ private void InitComponentManual() ReadmeRichTextBox.Dock = DockStyle.Fill; ReadmeRichTextBox.TabIndex = 0; ReadmeRichTextBox.LinkClicked += ReadmeRichTextBox_LinkClicked; + ReadmeRichTextBox.MouseLeave += ReadmeRichTextBox_MouseLeave; // // MainForm //