ajalt / mordant

Multiplatform text styling for Kotlin command-line applications
https://ajalt.github.io/mordant/
Apache License 2.0
957 stars 34 forks source link

Disable glow for progress animation #122

Closed cmdjulian closed 11 months ago

cmdjulian commented 11 months ago

Is there a way to disable the white glow in the animation?

image

Essentially I want something which looks like your example with static color which does advance without this animation.

image

ajalt commented 11 months ago

Yes, set progressbar.pulse to false in your theme flags: Terminal(theme=Theme { flags["progressbar.pulse"] = false }).

I'll add more docs for that and add a parameter to the progressBar method to allow changing that per-bar.

cmdjulian commented 11 months ago

Nice, thx 😊 In the mean time, I get a terminal instance already pre-build by clikt, can I change the setting even when the terminal already is created?

ajalt commented 11 months ago

Yes, set it on your context:

class Tool: CliktCommand() {
    init { context { terminal = Terminal(...) } }
}