Input roll scrolling (#2528)

* Change the BranchView's ScrollSpeed property to 1. The MarkerControl's is 1, and I assume that ScrollSpeed used to be pixel-based and the value of 13 is an accidental left-over.

* Standard behavior for scroll bars across a majority of other applications is for the up/down buttons to scroll 1 unit at a time while wheel may scroll multiple units at a time. So, do this. (Previous behavior was that both methods of scrolling would scroll by the same amount.)
This commit is contained in:
SuuperW 2021-01-15 15:03:18 -06:00 committed by GitHub
parent b3e69782dd
commit 889d3262b1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 29 deletions

View File

@ -214,12 +214,10 @@ namespace BizHawk.Client.EmuHawk
{
if (_horizontalOrientation != value)
{
int temp = ScrollSpeed;
_horizontalOrientation = value;
OrientationChanged();
_hBar.SmallChange = CellWidth;
_vBar.SmallChange = CellHeight;
ScrollSpeed = temp;
}
}
}
@ -228,30 +226,7 @@ namespace BizHawk.Client.EmuHawk
/// Gets or sets the scrolling speed
/// </summary>
[Category("Behavior")]
public int ScrollSpeed
{
get
{
if (HorizontalOrientation)
{
return _hBar.SmallChange / CellWidth;
}
return _vBar.SmallChange / CellHeight;
}
set
{
if (HorizontalOrientation)
{
_hBar.SmallChange = value * CellWidth;
}
else
{
_vBar.SmallChange = value * CellHeight;
}
}
}
public int ScrollSpeed { get; set; }
/// <summary>
/// Gets or sets the sets the virtual number of rows to be displayed. Does not include the column header row.
@ -1274,7 +1249,7 @@ namespace BizHawk.Client.EmuHawk
int newVal;
if (increment)
{
newVal = bar.Value + bar.SmallChange;
newVal = bar.Value + bar.SmallChange * ScrollSpeed;
if (newVal > bar.Maximum - bar.LargeChange)
{
newVal = bar.Maximum - bar.LargeChange;
@ -1282,7 +1257,7 @@ namespace BizHawk.Client.EmuHawk
}
else
{
newVal = bar.Value - bar.SmallChange;
newVal = bar.Value - bar.SmallChange * ScrollSpeed;
if (newVal < 0)
{
newVal = 0;

View File

@ -161,7 +161,7 @@
this.BranchView.MultiSelect = true;
this.BranchView.Name = "BranchView";
this.BranchView.RowCount = 0;
this.BranchView.ScrollSpeed = 13;
this.BranchView.ScrollSpeed = 1;
this.BranchView.SeekingCutoffInterval = 0;
this.BranchView.Size = new System.Drawing.Size(186, 224);
this.BranchView.TabIndex = 0;