diff --git a/Terminal.Gui/Views/Scroll/Scroll.cs b/Terminal.Gui/Views/Scroll/Scroll.cs
index 39bc896c6..5b0b2f418 100644
--- a/Terminal.Gui/Views/Scroll/Scroll.cs
+++ b/Terminal.Gui/Views/Scroll/Scroll.cs
@@ -405,8 +405,7 @@ public class Scroll : View, IOrientation, IDesignable
Width = 1;
Height = Dim.Fill ();
- Size = 1000;
- ContentPosition = 10;
+ Size = 250;
return true;
}
diff --git a/Terminal.Gui/Views/Scroll/ScrollBar.cs b/Terminal.Gui/Views/Scroll/ScrollBar.cs
index 3cc48bea4..2e3f2e898 100644
--- a/Terminal.Gui/Views/Scroll/ScrollBar.cs
+++ b/Terminal.Gui/Views/Scroll/ScrollBar.cs
@@ -309,7 +309,6 @@ public class ScrollBar : View, IOrientation, IDesignable
Width = 1;
Height = Dim.Fill ();
Size = 200;
- ContentPosition = 10;
//ShowPercent = true;
return true;
}
diff --git a/Terminal.Gui/Views/Scroll/ScrollSlider.cs b/Terminal.Gui/Views/Scroll/ScrollSlider.cs
index c61c9bc04..e20eecbf4 100644
--- a/Terminal.Gui/Views/Scroll/ScrollSlider.cs
+++ b/Terminal.Gui/Views/Scroll/ScrollSlider.cs
@@ -210,11 +210,11 @@ public class ScrollSlider : View, IOrientation, IDesignable
if (Orientation == Orientation.Vertical)
{
- return Math.Clamp (newPosittion, 0, ViewportDimension - Viewport.Height);
+ return Math.Clamp (newPosittion, 0, Math.Max (0, ViewportDimension - Viewport.Height));
}
else
{
- return Math.Clamp (newPosittion, 0, ViewportDimension - Viewport.Width);
+ return Math.Clamp (newPosittion, 0, Math.Max (0, ViewportDimension - Viewport.Width));
}
}
@@ -233,7 +233,7 @@ public class ScrollSlider : View, IOrientation, IDesignable
return;
}
- int scrollAmount = newPosition -_position;
+ int scrollAmount = newPosition - _position;
_position = newPosition;
OnPositionChanged (_position);
@@ -361,9 +361,21 @@ public class ScrollSlider : View, IOrientation, IDesignable
///
public bool EnableForDesign ()
{
- Orientation = Orientation.Vertical;
- Width = 1;
- Height = 10;
+ OrientationChanged += (sender, args) =>
+ {
+ if (args.CurrentValue == Orientation.Vertical)
+ {
+ Width = Dim.Fill ();
+ Height = 5;
+ }
+ else
+ {
+ Width = 5;
+ Height = Dim.Fill();
+ }
+ };
+
+ Orientation = Orientation.Horizontal;
ShowPercent = true;
return true;
diff --git a/UICatalog/Scenarios/Editor.cs b/UICatalog/Scenarios/Editor.cs
index 17bcc2211..16f3417dd 100644
--- a/UICatalog/Scenarios/Editor.cs
+++ b/UICatalog/Scenarios/Editor.cs
@@ -262,6 +262,7 @@ public class Editor : Scenario
AlignmentModes = AlignmentModes.StartToEnd | AlignmentModes.IgnoreFirstOrLast
};
+ _textView.VerticalScrollBar.AutoHide = false;
_textView.UnwrappedCursorPosition += (s, e) =>
{
siCursorPosition.Title = $"Ln {e.Point.Y + 1}, Col {e.Point.X + 1}";
diff --git a/UICatalog/Scenarios/HexEditor.cs b/UICatalog/Scenarios/HexEditor.cs
index 614bc1944..74065ebf5 100644
--- a/UICatalog/Scenarios/HexEditor.cs
+++ b/UICatalog/Scenarios/HexEditor.cs
@@ -44,6 +44,8 @@ public class HexEditor : Scenario
_hexView.Arrangement = ViewArrangement.Resizable;
_hexView.Edited += _hexView_Edited;
_hexView.PositionChanged += _hexView_PositionChanged;
+ _hexView.VerticalScrollBar.AutoHide = false;
+
app.Add (_hexView);
var menu = new MenuBar
diff --git a/UICatalog/Scenarios/TreeViewFileSystem.cs b/UICatalog/Scenarios/TreeViewFileSystem.cs
index cdf654f7a..cce95fd84 100644
--- a/UICatalog/Scenarios/TreeViewFileSystem.cs
+++ b/UICatalog/Scenarios/TreeViewFileSystem.cs
@@ -182,6 +182,8 @@ public class TreeViewFileSystem : Scenario
_treeViewFiles = new TreeView { X = 0, Y = 0, Width = Dim.Percent (50), Height = Dim.Fill () };
_treeViewFiles.DrawLine += TreeViewFiles_DrawLine;
+ _treeViewFiles.VerticalScrollBar.AutoHide = false;
+
_detailsFrame = new DetailsFrame (_iconProvider)
{
X = Pos.Right (_treeViewFiles), Y = 0, Width = Dim.Fill (), Height = Dim.Fill ()
diff --git a/UICatalog/UICatalog.cs b/UICatalog/UICatalog.cs
index d6a9fd107..6ed41dc42 100644
--- a/UICatalog/UICatalog.cs
+++ b/UICatalog/UICatalog.cs
@@ -799,6 +799,8 @@ public class UICatalogApp
CategoryList.OpenSelectedItem += (s, a) => { ScenarioList!.SetFocus (); };
CategoryList.SelectedItemChanged += CategoryView_SelectedChanged;
+ CategoryList.VerticalScrollBar.AutoHide = true;
+
// Create the scenario list. The contents of the scenario list changes whenever the
// Category list selection changes (to show just the scenarios that belong to the selected
// category).
@@ -821,6 +823,8 @@ public class UICatalogApp
BorderStyle = CategoryList.BorderStyle,
SuperViewRendersLineCanvas = true
};
+ //ScenarioList.VerticalScrollBar.AutoHide = false;
+ //ScenarioList.HorizontalScrollBar.AutoHide = false;
// TableView provides many options for table headers. For simplicity we turn all
// of these off. By enabling FullRowSelect and turning off headers, TableView looks just