Code Monkey home page Code Monkey logo

tui-realm-treeview's Issues

[BUG] - upgrade to tuirealm 0.5

Description

When I upgrade to tui-realm 0.5, treeview cannot compile.

Steps to reproduce

Upgrade to tuirealm 0.5, this component will not work.

Expected behaviour

It should work as before, but now it complains two version of tui-realm is used.

Environment

  • OS: Arch linux
  • Architecturex x86_64x
  • Rust version: 1.53.0
  • tui-realm-treeview version 0.2

Additional information

Thanks.

Add any other context about the problem here.

[Feature Request] - Keep fold/unfold state

Description

I use treeview to represent the file tree. When I refresh the treeview, all opened folder will become collapsed. Is there a way to preserve the state of treeview when doing refresh?

Changes

  1. Have the state saved during refresh, like selected and unfolded.
  2. Treeview could have an option to unfold several levels duing initialize.

[Feature Request] - Vec of `TextSpan` in each node

Thanks for the component. There is one thing that will be hellpful for me - add the ability to stylerize text at each tree node.

Description

add the ability to stylerize text at each tree node

Changes

Node<String, String> to Node<String, Vec<TextSpan>>

[Feature Request] - Optionally skip rendering the root node

Description

For my use case, I'm not finding it useful to be able to collapse the root node of a tree, and displaying the root node of the tree directly below the component title is a bit redundant.

There would be no reason for my users to collapse the root node, so I don't want to let them.

I'm not sure that I described that well, so here's what I'm trying to accomplish:

 โ•ญtree-viewerโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
 โ”‚๐Ÿฆ„ Cargo.toml                               โ”‚
 โ”‚   target โ–ถ                                 โ”‚
 โ”‚   Cargo.lock                               โ”‚
 โ”‚   .gitignore                               โ”‚
 โ”‚   .git โ–ถ                                   โ”‚
 โ”‚   src โ–ถ                                    โ”‚
 โ”‚                                            โ”‚
 โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ

Changes

Add an option that when used, skips the root node like shown above.

Implementation

I am not completely up to speed yet, but I'd like to do something along the lines of

  • Add a hide_root_node method to TreeView
  • Add hide_root_node field to TreeWidget
  • Add a separate render_root_node function to TreeWidget that just iterates children if hide_root_node is true, or calls iter_nodes if not.

I've implemented the render_root_node part and things seem to work.

If the approach above sounds acceptable, I'd be happy to attempt a PR with the rest.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.