Skip to content
This repository was archived by the owner on Dec 3, 2025. It is now read-only.

Commit 5c96360

Browse files
committed
Don't scroll date format comboboxes on mousewheel
They constantly change value when I'm trying to scroll up and down in the Appearance page and I don't notice.
1 parent 9a95b25 commit 5c96360

4 files changed

Lines changed: 38 additions & 18 deletions

File tree

AngelLoader/Forms/CustomControls/DarkComboBox.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,13 @@ public bool DarkModeEnabled
5454
}
5555

5656
[DefaultValue(false)]
57+
[PublicAPI]
5758
public bool FireMouseLeaveOnLeaveWindow { get; set; }
5859

60+
[DefaultValue(false)]
61+
[PublicAPI]
62+
public bool SuppressScrollWheelValueChange { get; set; }
63+
5964
#if DEBUG
6065

6166
[Browsable(false)]

AngelLoader/Forms/MainForm.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,14 @@ static bool TryGetHWndFromMousePos(Message msg, out IntPtr result)
334334
MainSplitContainer.Panel2.Focus();
335335
}
336336
}
337-
Native.SendMessage(hWnd, m.Msg, m.WParam, m.LParam);
337+
if (Control.FromHandle(hWnd) is DarkComboBox { SuppressScrollWheelValueChange: true, Focused: false })
338+
{
339+
return BlockMessage;
340+
}
341+
else
342+
{
343+
Native.SendMessage(hWnd, m.Msg, m.WParam, m.LParam);
344+
}
338345
}
339346
return BlockMessage;
340347
}

AngelLoader/Forms/Settings/AppearancePage.Designer.cs

Lines changed: 13 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

AngelLoader/Forms/Settings/AppearancePage_InitSlim.Generated.cs

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ sealed partial class AppearancePage
88
private void InitSlim()
99
{
1010
this.PagePanel = new System.Windows.Forms.Panel();
11+
this.DummyAutoScrollPanel = new System.Windows.Forms.Control();
1112
this.PlayWithoutFMGroupBox = new AngelLoader.Forms.CustomControls.DarkGroupBox();
1213
this.PlayWithoutFM_MultipleButtonsRadioButton = new AngelLoader.Forms.CustomControls.DarkRadioButton();
1314
this.PlayWithoutFM_SingleButtonRadioButton = new AngelLoader.Forms.CustomControls.DarkRadioButton();
@@ -60,7 +61,6 @@ private void InitSlim()
6061
this.ClassicThemeRadioButton = new AngelLoader.Forms.CustomControls.DarkRadioButton();
6162
this.LanguageGroupBox = new AngelLoader.Forms.CustomControls.DarkGroupBox();
6263
this.LanguageComboBox = new AngelLoader.Forms.CustomControls.DarkComboBoxWithBackingItems();
63-
this.DummyAutoScrollPanel = new System.Windows.Forms.Control();
6464
this.PagePanel.SuspendLayout();
6565
this.PlayWithoutFMGroupBox.SuspendLayout();
6666
this.FMsListGroupBox.SuspendLayout();
@@ -91,6 +91,13 @@ private void InitSlim()
9191
this.PagePanel.Size = new System.Drawing.Size(496, 1163);
9292
this.PagePanel.TabIndex = 0;
9393
//
94+
// DummyAutoScrollPanel
95+
//
96+
this.DummyAutoScrollPanel.Location = new System.Drawing.Point(8, 288);
97+
this.DummyAutoScrollPanel.Size = new System.Drawing.Size(480, 8);
98+
this.DummyAutoScrollPanel.TabIndex = 0;
99+
this.DummyAutoScrollPanel.TabStop = false;
100+
//
94101
// PlayWithoutFMGroupBox
95102
//
96103
this.PlayWithoutFMGroupBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
@@ -346,6 +353,7 @@ private void InitSlim()
346353
//
347354
this.Date1ComboBox.FormattingEnabled = true;
348355
this.Date1ComboBox.Size = new System.Drawing.Size(88, 21);
356+
this.Date1ComboBox.SuppressScrollWheelValueChange = true;
349357
this.Date1ComboBox.TabIndex = 0;
350358
//
351359
// DateSeparator1TextBox
@@ -359,20 +367,23 @@ private void InitSlim()
359367
this.Date4ComboBox.FormattingEnabled = true;
360368
this.Date4ComboBox.Location = new System.Drawing.Point(360, 0);
361369
this.Date4ComboBox.Size = new System.Drawing.Size(88, 21);
370+
this.Date4ComboBox.SuppressScrollWheelValueChange = true;
362371
this.Date4ComboBox.TabIndex = 6;
363372
//
364373
// Date2ComboBox
365374
//
366375
this.Date2ComboBox.FormattingEnabled = true;
367376
this.Date2ComboBox.Location = new System.Drawing.Point(120, 0);
368377
this.Date2ComboBox.Size = new System.Drawing.Size(88, 21);
378+
this.Date2ComboBox.SuppressScrollWheelValueChange = true;
369379
this.Date2ComboBox.TabIndex = 2;
370380
//
371381
// Date3ComboBox
372382
//
373383
this.Date3ComboBox.FormattingEnabled = true;
374384
this.Date3ComboBox.Location = new System.Drawing.Point(240, 0);
375385
this.Date3ComboBox.Size = new System.Drawing.Size(88, 21);
386+
this.Date3ComboBox.SuppressScrollWheelValueChange = true;
376387
this.Date3ComboBox.TabIndex = 4;
377388
//
378389
// RatingUseStarsCheckBox
@@ -557,13 +568,6 @@ private void InitSlim()
557568
this.LanguageComboBox.Size = new System.Drawing.Size(184, 21);
558569
this.LanguageComboBox.TabIndex = 0;
559570
//
560-
// DummyAutoScrollPanel
561-
//
562-
this.DummyAutoScrollPanel.Location = new System.Drawing.Point(8, 288);
563-
this.DummyAutoScrollPanel.Size = new System.Drawing.Size(480, 8);
564-
this.DummyAutoScrollPanel.TabIndex = 0;
565-
this.DummyAutoScrollPanel.TabStop = false;
566-
//
567571
// AppearancePage
568572
//
569573
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);

0 commit comments

Comments
 (0)