marcusolsson / tui-go

A UI library for terminal applications.
MIT License
2.1k stars 123 forks source link

Modal windows/dialogs #46

Open marcusolsson opened 7 years ago

marcusolsson commented 7 years ago

tui-go should support modal windows that ask for confirmation or other user input. This would be painted on top of the application and will need some design discussions on how to support basic compositing.

Example:

┌──────────────┐
│ Really quit? │
│              │
│ OK    Cancel │
└──────────────┘
leaanthony commented 7 years ago

Agree (from previous discussion) about everything being keyboard friendly. I think the easiest way to support this feature is just having layers where all keyboard input is sent to the current layer. Regarding rendering, initially a painters algorithm would be easiest, then we can look at optimising this if needed.

marcusolsson commented 7 years ago

I agree that would probably be a great place to start :+1:

meain commented 7 years ago

Maybe add two types of modals. Full width as well as those need to just stay in the center.

Syleron commented 6 years ago

any updates on this request?

marcusolsson commented 6 years ago

Unfortunately not. I've had limited time to work on tui lately and have been prioritizing bugs. It would be really helpful if you wanted to share your use case and thoughts on how you'd expect the API to look.

marcusolsson commented 6 years ago

@Syleron Pushed some work-in-progress of this in #103. If you have the time, let me know if this would work for you!

Syleron commented 6 years ago

@marcusolsson Thank you! I will have a closer look and get back to you.