Repository navigation
Draw progress bar in statusline - #1318
Conversation
b10e8a9 to
bbb82c3
Compare
|
It might look better to have the progress bar shown using a slightly different background color instead of as a character. |
|
That was my thought too. I started by playing around with using the entire status bar and just changing background color, but I made the mistake of just using the titlebar color and finding the contrast was either much too distracting (e.g. default theme) or that there was no background color at all (e.g. amazon theme). I switched gears at that point and found I really liked the simplicity of a thin line, but the first idea could be workable if we added a new I was able to ctrl-z back to that experiment and push a branch gavtroy:color-progress-bar if you want to get a feel for it. Edit: and updated that branch now to include a third option of highlighting only around the current position. |
a1acf07 to
c52c5e6
Compare
982117c to
0b6ae7b
Compare
|
Changed ────── to ━━━━━━━━ . Also added a non-color "shuttle" option for consistency. |
0b6ae7b to
dc99b96
Compare
|
So I tested the different options. The line looks good in all cases (especially now that the line is thicker), but isn't as accurate on narrow screens. The color one looks good in some cases. I think this is good enough to be merged, but it might be an idea to add a second boolean option to draw the progress bar in the command area, hiding it when text is displayed there. This will reduce the clutter in the status line, while also making it more useful on small displays (and then another PR could be opened to optionally make the command line into a mouse-controlled seekbar). |
There was a problem hiding this comment.
Good enough as-is, works well, no bugs even when resizing the terminal to various sizes.
Some potential future improvements for other PRs:
- Another boolean option to display the progress bar in the command line rather than the status line could be nice to have (but it looks fine in the status line especially after the other status line format PR).
- Some color schemes could have better color selections for the background one, but that can be done later.
- Mouse support could also be added in another PR later.
1 similar comment
This comment was marked as duplicate.
This comment was marked as duplicate.
dc99b96 to
137626e
Compare
| static void toggle_progress_bar(void *data) | ||
| { | ||
| progress_bar++; | ||
| progress_bar %= 5; |
There was a problem hiding this comment.
Something like NR_PROGRESS_BAR_TYPES would be good to avoid hard-coding 5. Also, cycle (or similar) naming might be more appropriate than toggle.
There was a problem hiding this comment.
Agree but currently it's only exposed as ":toggle" (or win-toggle/spacebar in the settings screen) and all matching settings use the toggle_* naming. I'm open to adding a :cycle alias but I think it's different from what you were asking.
(And oops, missed the rebase in my first push.)
137626e to
6e2434a
Compare
Styles: - line (default) - shuttle - color - color_shuttle
6e2434a to
7ee2711
Compare
|
Thanks! Merged, let's see what the wider feedback will be. |
No description provided.