Skip to content

Commit 0f195d4

Browse files
committed
make input roll scroll bars visible even when the whole input roll is not
1 parent 15ac116 commit 0f195d4

2 files changed

Lines changed: 17 additions & 2 deletions

File tree

src/BizHawk.Client.EmuHawk/CustomControls/InputRoll/InputRoll.cs

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1766,7 +1766,6 @@ private void RecalculateScrollBars()
17661766
}
17671767
}
17681768

1769-
_vBar.Location = new Point(Width - _vBar.Width, 0);
17701769
_vBar.Height = Height;
17711770
_vBar.Visible = true;
17721771
}
@@ -1788,7 +1787,6 @@ private void RecalculateScrollBars()
17881787
_hBar.Maximum = TotalColWidth - _drawWidth + _hBar.LargeChange;
17891788
}
17901789

1791-
_hBar.Location = new Point(0, Height - _hBar.Height);
17921790
_hBar.Width = Width - (NeedsVScrollbar ? (_vBar.Width + 1) : 0);
17931791
_hBar.Visible = true;
17941792
}
@@ -1797,6 +1795,17 @@ private void RecalculateScrollBars()
17971795
_hBar.Visible = false;
17981796
_hBar.Value = 0;
17991797
}
1798+
1799+
RepositionScrollbars();
1800+
}
1801+
1802+
public void RepositionScrollbars()
1803+
{
1804+
int edge = Parent != null ? Math.Min(Width, Parent.Width - Left) : Width;
1805+
_vBar.Location = new Point(Math.Max(edge - _vBar.Width, 0), 0);
1806+
1807+
edge = Parent != null ? Math.Min(Height, Parent.Height - Top) : Height;
1808+
_hBar.Location = new Point(0, Math.Max(edge - _hBar.Height, 0));
18001809
}
18011810

18021811
private void UpdateDrawSize()

src/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.ListView.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,7 @@ private void RepositionRolls()
242242
int y = margin;
243243
for (int i = 0; i < _inputRolls.Count; i++)
244244
{
245+
_inputRolls[i].SuspendDrawing();
245246
_inputRolls[i].Top = y - tasViewVBar.Value;
246247
_inputRolls[i].Height = _inputRolls[i].TotalColWidth + 1 + tasViewHBar.Height;
247248

@@ -262,6 +263,8 @@ private void RepositionRolls()
262263
{
263264
roll.Width = _tasViewPanel.Width - (tasViewVBar.Visible ? tasViewVBar.Width : 0);
264265
roll.Anchor = AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right;
266+
roll.RepositionScrollbars();
267+
roll.ResumeDrawing();
265268
roll.Refresh();
266269
}
267270

@@ -278,6 +281,7 @@ private void RepositionRolls()
278281
int x = margin;
279282
for (int i = 0; i < _inputRolls.Count; i++)
280283
{
284+
_inputRolls[i].SuspendDrawing();
281285
_inputRolls[i].Left = x - tasViewHBar.Value;
282286
_inputRolls[i].Width = _inputRolls[i].TotalColWidth + 1 + tasViewVBar.Width;
283287

@@ -298,6 +302,8 @@ private void RepositionRolls()
298302
{
299303
roll.Height = _tasViewPanel.Height - (tasViewHBar.Visible ? tasViewHBar.Height : 0);
300304
roll.Anchor = AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom;
305+
roll.RepositionScrollbars();
306+
roll.ResumeDrawing();
301307
roll.Refresh();
302308
}
303309

0 commit comments

Comments
 (0)