mirror of
https://github.com/gui-cs/Terminal.Gui.git
synced 2025-12-26 07:47:54 +01:00
tweaks
This commit is contained in:
@@ -9,9 +9,6 @@ public partial class TextView
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
private void ConfigureLayout ()
|
private void ConfigureLayout ()
|
||||||
{
|
{
|
||||||
// Subscribe to ViewportChanged to sync internal scroll fields
|
|
||||||
ViewportChanged += TextView_ViewportChanged;
|
|
||||||
|
|
||||||
// Vertical ScrollBar: AutoShow enabled by default as per requirements
|
// Vertical ScrollBar: AutoShow enabled by default as per requirements
|
||||||
VerticalScrollBar.AutoShow = true;
|
VerticalScrollBar.AutoShow = true;
|
||||||
|
|
||||||
@@ -21,28 +18,13 @@ public partial class TextView
|
|||||||
|
|
||||||
private void TextView_LayoutComplete (object? sender, LayoutEventArgs e)
|
private void TextView_LayoutComplete (object? sender, LayoutEventArgs e)
|
||||||
{
|
{
|
||||||
|
_topRow = Viewport.Y;
|
||||||
|
_leftColumn = Viewport.X;
|
||||||
WrapTextModel ();
|
WrapTextModel ();
|
||||||
UpdateContentSize ();
|
UpdateContentSize ();
|
||||||
AdjustScrollPosition ();
|
AdjustScrollPosition ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void TextView_ViewportChanged (object? sender, DrawEventArgs e)
|
|
||||||
{
|
|
||||||
// Sync internal scroll position fields with Viewport
|
|
||||||
// Only update if values actually changed to prevent infinite loops
|
|
||||||
if (_topRow != Viewport.Y)
|
|
||||||
{
|
|
||||||
_topRow = Viewport.Y;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (_leftColumn != Viewport.X)
|
|
||||||
{
|
|
||||||
_leftColumn = Viewport.X;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// INTERNAL: Adjusts the scroll position and cursor to ensure the cursor is visible in the viewport.
|
/// INTERNAL: Adjusts the scroll position and cursor to ensure the cursor is visible in the viewport.
|
||||||
/// This method handles both horizontal and vertical scrolling, word wrap considerations, and syncs
|
/// This method handles both horizontal and vertical scrolling, word wrap considerations, and syncs
|
||||||
|
|||||||
Reference in New Issue
Block a user