Im-Beast / deno_tui

🦕 Deno module for creating Terminal User Interfaces
https://deno.land/x/tui
MIT License
266 stars 18 forks source link

feat req: Allow changing direction of ProgressBarComponent #16

Closed aapoalas closed 1 year ago

aapoalas commented 1 year ago

What this feature is meaning to achieve ProgressBarComponent currently supports horizontal and vertical modes. It would be nice if it could also support horizontal-reverse and vertical-reverse modes. Alternate names would be rtl, ltr, ttb, btt.

Solution Invert min-max-value to draw scale calculations.

Describe alternatives you've considered I could manually invert my own inputs to the component, but due to how I'm streaming in values for these it would be a bit of a pain to do.

ElectronicsArchiver commented 1 year ago

This seems more sensible no?

{
  direction : 'vertical' ,
  reverse : true
}
Im-Beast commented 1 year ago

When 2.0 launches this will be possible. ProgressBar in version 2.0 has two separate properties: orientation and direction. orientation specifies whether progressbar should be horizontal or vertical and direction specifies the direction of progress flow – "normal" or "reversed"