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

Modernize fold icon appearance #458

Closed
bobbylight opened this issue Sep 24, 2022 · 1 comment
Closed

Modernize fold icon appearance #458

bobbylight opened this issue Sep 24, 2022 · 1 comment
Assignees
Milestone

Comments

@bobbylight
Copy link
Owner

Describe the solution you'd like
RSTA's fold icons are +/- icons. This is a well-known visual paradigm, but many code editors are moving towards chevrons. While RSTA does currently have methods to assign icons for folded/collapsed states, it would be nice if RSTA had this more modern appearance baked in.

As mentioned earlier, RSTA lets you assign your own icons for fold regions (see setFoldIcons(Icon, Icon)), it does not let you customize the vertical line rendered when an icon is armed/hovered over that shows an expanded fold's region. This effect typically isn't done with chevron folds as that visual style is all about a clean, minimalistic look. Thus we'll need some way to turn off that effect as well to fully implement the chevron style.

Are there any workarounds?
None, other than assign custom icons with the current API and live with the armed fold region line.

@bobbylight bobbylight self-assigned this Sep 24, 2022
@bobbylight bobbylight added this to the 3.2.1 milestone Sep 24, 2022
@bobbylight
Copy link
Owner Author

bobbylight commented Sep 24, 2022

This is available now. See the following new API:

  • FoldIndicatorStyle - An enum of out-of-the-box visual styles the fold region supports in the Gutter. Can be further customized by other methods. Currently supports CLASSIC (the visual appearance in RSTA 3.2.0 and earlier) and MODERN (the chevron style)
  • Gutter.setFoldIndicatorStyle(FoldIndicatorStyle) - Toggles the fold indicator's style
  • Gutter.setShowArmedFoldRange(boolean) - Toggles whether a line is rendered to denote the armed, expanded fold's collapsible region of lines. This property is set properly with calls to setFoldIndicatorStyle(), but can also be toggled individually for additional customization
  • Gutter.setFoldIcons(FoldIndicatorIcon, FoldIndicatorIcon) - Sets the actual collapsed and folded icons to use. This is also set properly with calls to setFoldIndicatorStyle() but can also be used by itself for additional customization

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant