Skip to content

Conversation

mstv
Copy link
Member

@mstv mstv commented Jan 9, 2025

Proposed changes

  • chore(TreeViewExtensions): Remove namespace block
  • chore(TreeViewExtensions): Alpha-sort methods
  • refactor(TreeView): Extract EnsureVerticallyVisible and ScrollLeftMost from LeftPanel.Tree.ExpandPathToSelectedNode
  • replace all occurrences of TreeNode.EnsureVisible

Screenshots

Before

image

After

image

Test methodology

  • manual

Please do not squash-merge


✒️ I contribute this code under The Developer Certificate of Origin.

@mstv mstv self-assigned this Jan 9, 2025
Copy link
Member

@gerhardol gerhardol left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Used with #12116, works fine

@@ -71,6 +84,15 @@ public static void RestoreExpandedNodesState(this TreeNode node, HashSet<string>
}
}

public static void ScrollLeftMost(this TreeView? treeView)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason to keep this public?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason to keep this public?

Yes, I am also calling this after setting TreeView.TopNode (in #12116).

mstv added 3 commits January 11, 2025 00:02
and ScrollLeftMost from LeftPanel.Tree.ExpandPathToSelectedNode
and replace all occurrences of TreeNode.EnsureVisible
@mstv mstv force-pushed the fix/treeview_hscroll branch from 8db7b49 to eff5cf5 Compare January 10, 2025 23:03
@mstv mstv merged commit eff5cf5 into gitextensions:master Jan 10, 2025
3 of 4 checks passed
@mstv mstv deleted the fix/treeview_hscroll branch January 10, 2025 23:04
@mstv mstv added this to the v5.3 milestone Jan 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants