mirror of
https://github.com/gui-cs/Terminal.Gui.git
synced 2025-12-29 01:07:58 +01:00
Fixed bugs
This commit is contained in:
@@ -143,7 +143,8 @@ public class Scroll : View, IOrientation, IDesignable
|
||||
}
|
||||
|
||||
int framePos = Orientation == Orientation.Vertical ? args.CurrentValue.Y : args.CurrentValue.X;
|
||||
SliderPosition = framePos;
|
||||
|
||||
RaiseSliderPositionChangeEvents (CalculateSliderPosition (_contentPosition), framePos);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -152,13 +153,11 @@ public class Scroll : View, IOrientation, IDesignable
|
||||
public int SliderPosition
|
||||
{
|
||||
get => CalculateSliderPosition (_contentPosition);
|
||||
set => RaiseSliderPositionChangeEvents (value);
|
||||
set => RaiseSliderPositionChangeEvents (_slider.Position, value);
|
||||
}
|
||||
|
||||
private void RaiseSliderPositionChangeEvents (int newSliderPosition)
|
||||
private void RaiseSliderPositionChangeEvents (int currentSliderPosition, int newSliderPosition)
|
||||
{
|
||||
int currentSliderPosition = CalculateSliderPosition (_contentPosition);
|
||||
|
||||
if (/*newSliderPosition > Size - ViewportDimension ||*/ currentSliderPosition == newSliderPosition)
|
||||
{
|
||||
return;
|
||||
|
||||
@@ -154,11 +154,11 @@ public class ScrollBar : View, IOrientation, IDesignable
|
||||
|
||||
if (Orientation == Orientation.Vertical)
|
||||
{
|
||||
Visible = Frame.Height - (_decreaseButton.Frame.Height + _increaseButton.Frame.Height) < Size;
|
||||
Visible = Frame.Height < Size;
|
||||
}
|
||||
else
|
||||
{
|
||||
Visible = Frame.Width - (_decreaseButton.Frame.Width + _increaseButton.Frame.Width) < Size;
|
||||
Visible = Frame.Width < Size;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -208,8 +208,16 @@ public class ScrollBar : View, IOrientation, IDesignable
|
||||
/// </summary>
|
||||
public int Size
|
||||
{
|
||||
get => _scroll.Size;
|
||||
set => _scroll.Size = value;
|
||||
get
|
||||
{
|
||||
// Add two for increment/decrement buttons
|
||||
return _scroll.Size + 2;
|
||||
}
|
||||
set
|
||||
{
|
||||
// Remove two for increment/decrement buttons
|
||||
_scroll.Size = value - 2;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -346,7 +346,7 @@ internal class CharMap : View, IDesignable
|
||||
|
||||
//ViewportSettings = ViewportSettings.AllowLocationGreaterThanContentSize;
|
||||
|
||||
SetContentSize (new (COLUMN_WIDTH * 16 + RowLabelWidth, _maxCodePoint / 16 * _rowHeight)); // +1 for Header
|
||||
SetContentSize (new (COLUMN_WIDTH * 16 + RowLabelWidth, _maxCodePoint / 16 * _rowHeight + 1)); // +1 for Header
|
||||
|
||||
AddCommand (
|
||||
Command.Up,
|
||||
@@ -483,7 +483,7 @@ internal class CharMap : View, IDesignable
|
||||
{
|
||||
Viewport = Viewport with
|
||||
{
|
||||
Y = Math.Min (args.CurrentValue, GetContentSize ().Height - (Viewport.Height - 2))
|
||||
Y = Math.Min (args.CurrentValue, GetContentSize ().Height - (Viewport.Height - 1))
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user