Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V2 release #3834

Closed
wants to merge 443 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
443 commits
Select commit Hold shift + click to select a range
06a2f71
Merge branch 'v2_develop' into sixel-encoder-tinkering
tznind Oct 11, 2024
4959966
Merge branch 'v2_3777-hexedit' of tig:tig/Terminal.Gui into v2_3777-h…
tig Oct 11, 2024
b977f65
Merge branch 'v2_develop' into v2_3777-hexedit
tig Oct 11, 2024
996b3f0
Code cleanup
tig Oct 11, 2024
1476154
Merge branch 'v2_3777-hexedit' of tig:tig/Terminal.Gui into v2_3777-h…
tig Oct 11, 2024
505d0bd
Code cleanup - CancelEventArgs
tig Oct 11, 2024
d91d604
Code cleanup - CancelEventArgs
tig Oct 11, 2024
b4b5368
Fixed hexView colors
tig Oct 11, 2024
cc0d965
Fixes #3713 - `TextField` & `TextView` - When pressing right/left cl…
tznind Oct 11, 2024
87a4873
Merge branch 'v2_develop' into v2_3777-hexedit
tig Oct 11, 2024
9a9f48c
Fixed DrawHorizontalShadowTransparent (vertical was already fixed).
tig Oct 11, 2024
e370cfb
Merge branch 'v2_3777-hexedit' of tig:tig/Terminal.Gui into v2_3777-h…
tig Oct 11, 2024
1e99319
Fixed
tig Oct 13, 2024
c46cf78
Merge branch 'v2_develop' into sixel-encoder-tinkering
tznind Oct 13, 2024
8cb0c84
Fixed View.KeyDown/Up event handling
tig Oct 13, 2024
61be061
Fixed TableView key handling
tig Oct 13, 2024
d6852cb
KeyUp/Down api docs
tig Oct 13, 2024
04b336a
Try adding sixel to curses driver
tznind Oct 13, 2024
ee196fe
WIP: Keyboard event improvements
tig Oct 14, 2024
6df071f
Fixed.
tig Oct 14, 2024
84b2719
Fixed InvokingKeyBindings event semantics
tig Oct 14, 2024
c19cc7c
Code cleanup
tig Oct 14, 2024
f536945
Application.Keyboard Code cleanup
tig Oct 14, 2024
bc51f88
KeyDown API usage cleanup
tig Oct 14, 2024
3f3ceae
API docs
tig Oct 14, 2024
89d8b74
Key API simplification
tig Oct 14, 2024
b766e4e
Fixed listView issue.
tig Oct 14, 2024
053da7e
Application.Mouse cleanup
tig Oct 15, 2024
a9e1f2a
View.Mouse cleanup - WIP
tig Oct 15, 2024
a19781c
View.Mouse cleanup - WIP2
tig Oct 15, 2024
1abe318
View.Mouse cleanup - WIP3
tig Oct 15, 2024
0a6ba83
View.Mouse cleanup - Fixed combobox
tig Oct 15, 2024
681dd9b
View.Mouse cleanup - Fixed combobox
tig Oct 15, 2024
2e37ca3
View.Mouse cleanup - Fixed MenuBar
tig Oct 15, 2024
8807e48
View.Mouse cleanup - Fixed TableView
tig Oct 15, 2024
1363995
Merged MouseEvent and MouseEventEventArgs into MouseEventArgs
tig Oct 15, 2024
f7de547
MouseEventArgs cleanup
tig Oct 15, 2024
7866e80
MouseEventArgs cleanup
tig Oct 15, 2024
12fe1c2
Fixed OnMouseClicked
tig Oct 15, 2024
9363401
Broke OnMouseClicked
tig Oct 15, 2024
e1faab0
Refixed OnMouseClicked
tig Oct 15, 2024
7d07d84
Refixed OnMouseClicked - button
tig Oct 15, 2024
e6fd635
More fixes
tig Oct 15, 2024
f503a5c
keyEvent -> key
tig Oct 15, 2024
c50f47b
Code cleanup
tig Oct 15, 2024
23eb14c
Merge pull request #3795 from tig/v2_3793-CollectionNavigator-Use-OnK…
tig Oct 15, 2024
5590c28
Merge branch 'v2_develop' into v2_3029-MouseEvents
tig Oct 15, 2024
6a90328
Added Is<flag> helpers
tig Oct 15, 2024
64f87cd
code cleanup
tig Oct 15, 2024
bf2e032
Fixed Time/DateField crash
tig Oct 15, 2024
e85f694
Fixed Time/DateField crash 2
tig Oct 15, 2024
0a108fa
Merge pull request #3797 from tig/v2_3029-MouseEvents
tig Oct 15, 2024
2c3a761
Merge branch 'v2_develop' into v2_3777-hexedit
tig Oct 15, 2024
9d83e23
Merge branch 'v2_3777-hexedit' of tig:tig/Terminal.Gui into v2_3777-h…
tig Oct 15, 2024
5c09fa2
Fixed merge issues
tig Oct 15, 2024
8ddfd71
Merge branch 'v2_develop' into sixel-encoder-tinkering
tig Oct 15, 2024
d6a652b
Merge pull request #3783 from tig/v2_3777-hexedit
tig Oct 15, 2024
d104a56
WIP - prototyping...
tig Oct 15, 2024
70bf627
More prototyping
tig Oct 16, 2024
f5ddf6b
More prototyping 2
tig Oct 16, 2024
8c7982f
Tons of Layout refactoring. LayoutSubviews is now internal.
tig Oct 17, 2024
ed80c66
Fixed content scrolling
tig Oct 17, 2024
8f1954f
Fixes #3790. Can't build v2_develop RELEASE - "The local source 'C:\U…
BDisp Oct 17, 2024
949f593
Merge branch 'v2_develop' into v2_3761_2886-Draw-and-Layout-Perf
tig Oct 17, 2024
11b3eb0
Fixed more unit tests
tig Oct 17, 2024
9275163
Fixing unit tests
tig Oct 17, 2024
226dd4f
Fixing unit tests 2
tig Oct 17, 2024
b9b853a
Fixing unit tests 3
tig Oct 17, 2024
172409f
Fixed more unit tests ...
tig Oct 18, 2024
5dc832b
Fixing unit tests 4
tig Oct 18, 2024
2d48bc9
Working on shortcut
tig Oct 19, 2024
2e163ee
DimAuto fixes
tig Oct 19, 2024
72ea740
More shortcut stuff
tig Oct 21, 2024
4d4dbbf
Fixing stuff
tig Oct 22, 2024
a632c23
Fixed stoopid screen bug
tig Oct 22, 2024
fe2497e
Back to all unit tests passing
tig Oct 22, 2024
262c671
Added all views tester for draw/layout.
tig Oct 22, 2024
98a2265
fixed all views to deal with Driver is null
tig Oct 22, 2024
6e98d10
Switched back to Application.Begin not calling Refresh
tig Oct 22, 2024
572901b
Switched back to Application.Begin not calling Refresh
tig Oct 22, 2024
5e9178b
Everything but adornment drawing is working
tig Oct 23, 2024
008d497
Fixed TileView & ListView unit test failures
tig Oct 23, 2024
a6f03e4
Merge branch 'v2_develop' into sixel-encoder-tinkering
tig Oct 23, 2024
3156641
Make sixel 'opt in' in images scenario and apply a hack to fix TabVie…
tznind Oct 23, 2024
ce41afd
xml comments
tznind Oct 23, 2024
b31339d
Tons of stuff
tig Oct 23, 2024
ed48864
almost ready
tig Oct 24, 2024
bfb243a
Added benchmarking stuff
tig Oct 24, 2024
7b73517
More benchmarks
tig Oct 24, 2024
bc12c4b
Added timeout to test
tig Oct 24, 2024
76895f1
Fixed bugs
tig Oct 24, 2024
5a11a39
Code cleanup
tig Oct 24, 2024
a93d1ce
better names and API docs
tig Oct 24, 2024
66f5281
code reorg
tig Oct 24, 2024
317d425
debugging iterations
tig Oct 25, 2024
1c429da
debugging iterations
tig Oct 25, 2024
fa37103
reverted diag stuff that broke unit tests
tig Oct 25, 2024
ed05e17
Fixed issue with enter/leave
tig Oct 25, 2024
69cd30c
Prototype Scenario benchmark
tig Oct 25, 2024
0d51b5e
Support nullable scenarios
tig Oct 25, 2024
bbf54f4
Added Benchmarking to UI Catalog
tig Oct 25, 2024
ce900ad
Benchmark cleanup
tig Oct 25, 2024
1cbdb5c
Refactored View editors
tig Oct 25, 2024
98d0454
Refactored View editors 2
tig Oct 25, 2024
10d99a2
Beefed up benchmarking
tig Oct 26, 2024
2b7f3c2
Fixed timeout bug
tig Oct 26, 2024
f49213a
Changed benchmark screen size
tig Oct 26, 2024
f3ec218
Removed extra key
tig Oct 26, 2024
ed6ae17
Fixed animation scenario bug
tig Oct 26, 2024
fc5c3cb
Fixed animation scenario bug2
tig Oct 26, 2024
6a19d85
Fixed animation scenario bug3
tig Oct 26, 2024
1a49896
Fixing unit test failure from bad debug.fail
tig Oct 26, 2024
68bc258
Cleaned up launch settings
tig Oct 26, 2024
d6470fb
IsInitialized->Initialized
tig Oct 26, 2024
94b254a
IDesignable for TableView
tig Oct 26, 2024
6bfa8ba
IDesignable for GraphView
tig Oct 26, 2024
320ff8b
IDesignable for SpinnerView
tig Oct 26, 2024
7315ff7
IDesignable for TreeView
tig Oct 26, 2024
8ea89b8
IDesignable for TreeView
tig Oct 26, 2024
ee29ed8
View Draw API docs and code cleanup
tig Oct 26, 2024
92dac0e
View Draw API docs and code cleanup
tig Oct 26, 2024
6e873e0
View Draw API docs and code cleanup
tig Oct 26, 2024
245cfea
Fix TabView and unit tests.
BDisp Oct 27, 2024
606bdf1
Added View.Set/GetAtribute. Made Driver.Set/GetAttribute internal
tig Oct 27, 2024
6b5d291
Resolving merge conflicts.
BDisp Oct 27, 2024
04881bc
Remove not accessed local variable.
BDisp Oct 27, 2024
dde9b92
Remove unused local variable.
BDisp Oct 27, 2024
bcc1168
Fix typo.
BDisp Oct 27, 2024
116399c
Add #nullable enable.
BDisp Oct 27, 2024
7491983
Tweaked drawing code.
tig Oct 27, 2024
a7040b8
Fixed PosDim bug
tig Oct 27, 2024
c1597b3
Merge branch 'v2_3761_2886-Draw-and-Layout-Perf-tabview' of github.co…
tig Oct 27, 2024
51fcfb5
Draw->DrawIndicator
tig Oct 27, 2024
87486b1
Renamed Refresh. COde Cleanup
tig Oct 27, 2024
53708fa
api doc
tig Oct 28, 2024
e0551f4
NeedsDisplay -> NeedsDraw
tig Oct 28, 2024
d92ef0f
Added a port of System.Drawing.Region with unit tests.
tig Oct 28, 2024
844179b
ConsoleDriver now uses Region for Clip.
tig Oct 28, 2024
7baede5
Remove unused code from UnmanagedLibrary (#3799)
kasperk81 Oct 28, 2024
2f7d80a
Merge pull request #3734 from tznind/sixel-encoder-tinkering
tig Oct 28, 2024
cbb7ddc
Merged latest v2_develop
tig Oct 28, 2024
262bc01
Enabled FileDialog IDesignable
tig Oct 28, 2024
17e3fe8
Non-rectangular clip reigion support basically works
tig Oct 29, 2024
4399404
fix the build issue of F# example
syohex Oct 30, 2024
5a41d2c
Fixing unit tests. WIP
tig Oct 30, 2024
0e6a2bc
Fixing unit tests. TableView. WIP
tig Oct 30, 2024
d835b56
Fixed more clipping bugs and unit tests. All tests pass!
tig Oct 30, 2024
fdeb8e9
WIP: Figuring out how to make margin transparent
tig Oct 30, 2024
7e0f606
WIP: Figuring out how to make margin transparent
tig Oct 30, 2024
8835126
All tests pass (esxcept ScrollView and TabView which are disabled for…
tig Nov 1, 2024
b0b5b23
Code cleanup
tig Nov 1, 2024
ef06f4b
Implemented deferred Margin drawing to enable shadow with minimal per…
tig Nov 3, 2024
593160d
Code cleanup and refactor
tig Nov 3, 2024
563d58a
Code cleanup and refactor
tig Nov 3, 2024
e4b5523
drawming.md
tig Nov 3, 2024
304784c
Code cleanup and refactor
tig Nov 4, 2024
2f9cf08
Code cleanup and refactor
tig Nov 4, 2024
7656602
#nullable enable
tig Nov 4, 2024
66485a0
#nullable enable - Attribute.cs
tig Nov 4, 2024
2214d8c
#nullable enable
tig Nov 4, 2024
a5badb8
Added arrangmenteditor to AllViewsTester
tig Nov 4, 2024
c0ee541
Code cleanup and API docs
tig Nov 4, 2024
76b4b72
Code cleanup and API docs
tig Nov 4, 2024
55387d3
Made more Driver APIs internal
tig Nov 4, 2024
947914b
Made more Driver APIs internal
tig Nov 4, 2024
7fb321b
Cleanup
tig Nov 5, 2024
b48bc2b
typo
tig Nov 5, 2024
77ae7ae
Rebuildling TabView - WIP
tig Nov 6, 2024
e6180b6
Revert "Rebuildling TabView - WIP"
tig Nov 6, 2024
49d36f2
Fix SingleBackgroundWorker scenario.
BDisp Nov 6, 2024
10a2d7f
Merge branch 'BDisp-v2_3761_2886-Draw-and-Layout-Perf-fix' into v2_37…
tig Nov 6, 2024
720729d
Merge pull request #42 from BDisp/v2_3761_2886-Draw-and-Layout-Perf-fix
tig Nov 6, 2024
5a7ac91
Merge branch 'v2_3761_2886-Draw-and-Layout-Perf' of tig:tig/Terminal.…
tig Nov 6, 2024
07b295b
Code cleanup
tig Nov 6, 2024
3ad8969
WIP: adding superviewrenderslinecanvas tests
tig Nov 6, 2024
69a2c4d
Messing with border
tig Nov 7, 2024
45ce64a
Added Exclusions to LineCanvas
tig Nov 7, 2024
3d4658d
LineCanvas - Exclude
tig Nov 7, 2024
32f316f
LineCanvas - Exclude
tig Nov 7, 2024
9288de7
LineCanvas - Exclude
tig Nov 7, 2024
e2bb22e
Auto-join is mostly all working
tig Nov 7, 2024
95f21c3
LineCanvas code cleanup and API docs
tig Nov 7, 2024
9fc9438
Perf work
tig Nov 7, 2024
3743046
Unit test cleanup
tig Nov 7, 2024
f8c384a
Unit test cleanup2
tig Nov 7, 2024
262777e
Unit test cleanup2
tig Nov 7, 2024
1013b90
Partiall re-fixed TabView
tig Nov 7, 2024
054559a
Fixed SyntaxHighlighting
tig Nov 7, 2024
4ccb3fb
Merge pull request #3805 from syohex/fix-fsharp-example
tig Nov 7, 2024
72f0f3b
Merge branch 'v2_develop' into v2_3761_2886-Draw-and-Layout-Perf
tig Nov 7, 2024
b597925
Merge branch 'v2_2489_scroll-scrollbar-new' of tig:BDisp/Terminal.Gui…
tig Nov 7, 2024
dc7bd44
Merged v2_develop
tig Nov 8, 2024
127bfd5
Refactoring... WIP
tig Nov 9, 2024
427f5b1
Refactoring... WIP 2
tig Nov 9, 2024
b2eae4c
Refactoring... WIP 3
tig Nov 10, 2024
9777357
pulled & merged
tig Nov 10, 2024
701d592
Unit tests pass
tig Nov 10, 2024
805f702
Scrolling scenario upgraded
tig Nov 10, 2024
315b3cd
unit tests pass
tig Nov 10, 2024
362c1d9
Removed legacy scrollview stuff.
tig Nov 10, 2024
8d41641
REMOVED RESPONDER!
tig Nov 10, 2024
23d5ee2
REMOVED RESPONDER 2!
tig Nov 10, 2024
2c48ac6
REMOVED RESPONDER 3!
tig Nov 10, 2024
d3d3df8
Fixed feedback from bdisp
tig Nov 10, 2024
dbedeb6
Merge pull request #3798 from tig/v2_3761_2886-Draw-and-Layout-Perf
tig Nov 10, 2024
f206bb0
Merge branch 'v2_develop' into BDisp-v2_2489_scroll-scrollbar-new
tig Nov 10, 2024
6f9816b
Fixed bugs
tig Nov 10, 2024
f7e0a29
Refactored and went back and forth. Things are working well. Tests no…
tig Nov 11, 2024
c7a2542
Refactored and went back and forth. Things are working well. Tests no…
tig Nov 11, 2024
e591453
Refactored again
tig Nov 12, 2024
7fae0c3
Refactored again
tig Nov 12, 2024
f922cba
Really messed stuff up
tig Nov 13, 2024
a500cc5
Merge branch 'v2_develop' of tig:tig/Terminal.Gui into v2_develop
tig Nov 13, 2024
808ac92
Refixed some stuff. WIP
tig Nov 13, 2024
41a5ac7
ScrollSlider refactored and groovy
tig Nov 14, 2024
13fca41
Fightin math.
tig Nov 14, 2024
ecfa51c
We're back!
tig Nov 15, 2024
b04de75
Working??
tig Nov 15, 2024
70c30ac
Working!
tig Nov 15, 2024
a87d435
AutoHide tweaks
tig Nov 15, 2024
1cbc052
Removed dead prop
tig Nov 15, 2024
ddce5a4
Refactored View.ScrollBar
tig Nov 16, 2024
49e0cd8
Added unit tests for Viewport/FrameChanged events. Fixed bugs.
tig Nov 16, 2024
307b15a
Added todo
tig Nov 16, 2024
0900efc
Merge branch 'v2_2489-scrollbar' of tig:tig/Terminal.Gui into v2_2489…
tig Nov 16, 2024
29c2e39
Tweaked autohide logic
tig Nov 16, 2024
e7fc187
Tweaked scroll logic
tig Nov 16, 2024
095c06c
fixed scenario
tig Nov 16, 2024
0313e8f
fixed Scrlling scenario
tig Nov 16, 2024
861dfee
Code cleanup
tig Nov 16, 2024
bc46801
Code cleanup
tig Nov 16, 2024
f527e59
Scenario cleanup. scrolling.md
tig Nov 17, 2024
a9b3a3e
Charmap refactor WIP
tig Nov 17, 2024
06a636c
Little things.
tig Nov 17, 2024
902577f
Upgrade hexView
tig Nov 18, 2024
f6a82b4
Code cleanup
tig Nov 18, 2024
14dde1a
updated docs
tig Nov 18, 2024
245d78e
Removed restriction in View.Move
tig Nov 18, 2024
2f2076d
removed Showpercent
tig Nov 18, 2024
7777668
Added AllowNegativeXWhenWidthGreaterThanContentWidth
tig Nov 18, 2024
e782c0e
Added AllowNegativeXWhenWidthGreaterThanContentWidth
tig Nov 18, 2024
5c2035d
fixed ListView test wrt AllowNegativeXWhenWidthGreaterThanContentWidth
tig Nov 18, 2024
30adbd6
ListView cleanup
tig Nov 18, 2024
3e48ce2
ListView cleanup 2
tig Nov 18, 2024
93a0859
ListView cleanup 3
tig Nov 18, 2024
b37eeb2
Shortcut bug breaking hexeditor
tig Nov 18, 2024
2a79e96
reverted - Shortcut bug breaking hexeditor
tig Nov 18, 2024
6c54756
reverted - Shortcut bug breaking hexeditor 2
tig Nov 18, 2024
4664481
Merge pull request #3820 from tig/v2_2489-scrollbar
tig Nov 19, 2024
208461f
Merge branch 'v2_develop' of tig:tig/Terminal.Gui into v2_develop
tig Nov 19, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
removed Showpercent
  • Loading branch information
tig committed Nov 18, 2024
commit 2f2076ddb7246e9a0a8791376b264310f8a50712
41 changes: 21 additions & 20 deletions Terminal.Gui/View/View.ScrollBars.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,29 @@ namespace Terminal.Gui;
public partial class View
{
private Lazy<ScrollBar> _horizontalScrollBar = null!;

/// <summary>
/// Gets the horizontal <see cref="ScrollBar"/>. This property is lazy-loaded and will not be created until it is accessed.
/// </summary>
/// <remarks>
/// <para>
/// See <see cref="ScrollBar"/> for more information on how to use the ScrollBar.
/// </para>
/// </remarks>
public ScrollBar HorizontalScrollBar => _horizontalScrollBar.Value;

private Lazy<ScrollBar> _verticalScrollBar = null!;

/// <summary>
/// Gets the vertical <see cref="ScrollBar"/>. This property is lazy-loaded and will not be created until it is accessed.
/// </summary>
/// <remarks>
/// <para>
/// See <see cref="ScrollBar"/> for more information on how to use the ScrollBar.
/// </para>
/// </remarks>
public ScrollBar VerticalScrollBar => _verticalScrollBar.Value;

/// <summary>
/// Initializes the ScrollBars of the View. Called by the View constructor.
/// </summary>
Expand Down Expand Up @@ -151,26 +172,6 @@ private void ConfigureHorizontalScrollBarEvents (ScrollBar scrollBar)
};
}

/// <summary>
/// Gets the horizontal <see cref="ScrollBar"/>. This property is lazy-loaded and will not be created until it is accessed.
/// </summary>
/// <remarks>
/// <para>
/// See <see cref="ScrollBar"/> for more information on how to use the ScrollBar.
/// </para>
/// </remarks>
public ScrollBar HorizontalScrollBar => _horizontalScrollBar.Value;

/// <summary>
/// Gets the vertical <see cref="ScrollBar"/>. This property is lazy-loaded and will not be created until it is accessed.
/// </summary>
/// <remarks>
/// <para>
/// See <see cref="ScrollBar"/> for more information on how to use the ScrollBar.
/// </para>
/// </remarks>
public ScrollBar VerticalScrollBar => _verticalScrollBar.Value;

/// <summary>
/// Clean up the ScrollBars of the View. Called by View.Dispose.
/// </summary>
Expand Down
33 changes: 5 additions & 28 deletions Terminal.Gui/Views/ScrollBar/ScrollBar.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ namespace Terminal.Gui;
/// See the <see href="https://gui-cs.github.io/Terminal.GuiV2Docs/docs/scrolling.html">Scrolling Deep Dive</see>.
/// </para>
/// <para>
/// By default, the built-in View scrollbars have both <see cref="View.Visible"/> and <see cref="AutoShow"/> set to
/// By default, the built-in View scrollbars (<see cref="View.VerticalScrollBar"/>/<see cref="View.HorizontalScrollBar"/>) have both <see cref="View.Visible"/> and <see cref="AutoShow"/> set to
/// <see langword="false"/>.
/// To enable them, either set <see cref="AutoShow"/> set to <see langword="true"/> or explictly set
/// To enable them, either set <see cref="AutoShow"/> set to <see langword="true"/> or explicitly set
/// <see cref="View.Visible"/>
/// to <see langword="true"/>.
/// </para>
Expand Down Expand Up @@ -81,6 +81,8 @@ public ScrollBar ()
// This sets the width/height etc...
OnOrientationChanged (Orientation);

return;

void OnDecreaseButtonOnAccept (object? s, CommandEventArgs e)
{
Position -= Increment;
Expand All @@ -104,24 +106,9 @@ private void ShowHide ()
Visible = VisibleContentSize < ScrollableContentSize;
}

if (Orientation == Orientation.Vertical)
{
_slider.VisibleContentSize = VisibleContentSize;
}
else
{
_slider.VisibleContentSize = VisibleContentSize;
}

_slider.VisibleContentSize = VisibleContentSize;
_slider.Size = CalculateSliderSize ();
_sliderPosition = CalculateSliderPositionFromContentPosition (_position);

// This keeps the position constant while slider is moving
if (_sliderPosition.Value != _slider.Position)
{
//Position = CalculatePositionFromSliderPosition (_sliderPosition.Value);
}

_slider.Position = _sliderPosition.Value;
}

Expand Down Expand Up @@ -235,16 +222,6 @@ public bool AutoShow
}
}

/// <summary>
/// Gets or sets whether the Scroll will show the percentage the slider
/// takes up within the <see cref="ScrollableContentSize"/>.
/// </summary>
public bool ShowPercent
{
get => _slider.ShowPercent;
set => _slider.ShowPercent = value;
}

private int? _visibleContentSize;

/// <summary>
Expand Down
45 changes: 0 additions & 45 deletions Terminal.Gui/Views/ScrollBar/ScrollSlider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -100,22 +100,6 @@ protected override bool OnClearingViewport ()
return true;
}

private bool _showPercent;

/// <summary>
/// Gets or sets whether the ScrollSlider will set <see cref="View.Text"/> to show the percentage the slider
/// takes up within the <see cref="View.SuperView"/>'s Viewport.
/// </summary>
public bool ShowPercent
{
get => _showPercent;
set
{
_showPercent = value;
SetNeedsDraw ();
}
}

private int? _size;

/// <summary>
Expand Down Expand Up @@ -290,33 +274,6 @@ protected virtual void OnScrolled (int distance) { }
/// <summary>Raised when the <see cref="Position"/> has changed. Indicates how much to scroll.</summary>
public event EventHandler<EventArgs<int>>? Scrolled;

/// <inheritdoc/>
protected override bool OnDrawingText ()
{
if (!ShowPercent)
{
Text = string.Empty;

return false;
}

if (SuperView is null)
{
return false;
}

if (Orientation == Orientation.Vertical)
{
Text = $"{(int)Math.Round ((double)Viewport.Height / SuperView!.GetContentSize ().Height * 100)}%";
}
else
{
Text = $"{(int)Math.Round ((double)Viewport.Width / SuperView!.GetContentSize ().Width * 100)}%";
}

return false;
}

/// <inheritdoc/>
public override Attribute GetNormalColor () { return base.GetHotNormalColor (); }

Expand Down Expand Up @@ -478,10 +435,8 @@ int sliderBounds
/// <inheritdoc/>
public bool EnableForDesign ()
{
ShowPercent = true;
Size = 5;

return true;
}

}
10 changes: 0 additions & 10 deletions UICatalog/Scenarios/ScrollBarDemo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -278,16 +278,6 @@ int GetMaxLabelWidth (int groupId)
autoShow.CheckedStateChanging += (s, e) => scrollBar.AutoShow = e.NewValue == CheckState.Checked;
demoFrame.Add (autoShow);

var ckbShowPercent = new CheckBox
{
Y = Pos.Top (lblOptions),
X = Pos.Right (autoShow) + 1,
Text = "ShowP_ercent",
CheckedState = scrollBar.ShowPercent ? CheckState.Checked : CheckState.UnChecked
};
ckbShowPercent.CheckedStateChanging += (s, e) => scrollBar.ShowPercent = e.NewValue == CheckState.Checked;
demoFrame.Add (ckbShowPercent);

var lblSliderPosition = new Label
{
Text = "SliderPosition:",
Expand Down
22 changes: 0 additions & 22 deletions UnitTests/Views/ScrollSliderTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1007,26 +1007,4 @@ public void Draws_Correctly (int superViewportWidth, int superViewportHeight, in

_ = TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
}

[Fact]
public void ShowPercent_True_ShowsPercentage ()
{
View super = new ()
{
Id = "super",
Width = 10,
Height = 10
};
ScrollSlider scrollSlider = new ()
{
Id = "scrollSlider",
Height = 10,
Width = 10,
};
super.Add (scrollSlider);
scrollSlider.ShowPercent = true;
Assert.True (scrollSlider.ShowPercent);
super.Draw ();
Assert.Contains ("0%", scrollSlider.Text);
}
}
Loading