mirror of
https://github.com/rivo/tview.git
synced 2026-04-26 13:25:51 +03:00
[GH-ISSUE #868] Override themes for application individually #632
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/tview#632
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @HeavyBro1337 on GitHub (Aug 23, 2023).
Original GitHub issue: https://github.com/rivo/tview/issues/868
Hello, I want to say right away that the package is fantastic and well-done!
However, there's one quirk that I hope will be fixed in a new version.
The only limitation I encountered while using this package is styling, I am making a networked application which can use several instances of
tview.Applicationand sincetview.Stylesis a global variable shared among other primitives, I can't really personalize the theme for each session.The wiki didn't mention any style overriding (i.e. passing Theme struct as the parameter at very least).
In this screenshot you can see default theme being used.
When I execute this command, it is supposed to change theme at the current session by idea, however when somebody else joins, then the new theme is applied on that session.
The code in question
@rivo commented on GitHub (Apr 4, 2024):
@IvanKorchmit You are correct. The way it currently works is that there is only one global theme which would apply to all applications if you used multiple. (I'm curious how you use multiple instances of
Application, I have never seen that before.)I have plans to allow for more detailed styling but as of now, I can't say when this will be available.
I'm closing this issue for now. If you feel that you need more help, please comment here or open a new issue.
@HeavyBro1337 commented on GitHub (Apr 4, 2024):
Hello, I'm using
tviewfor multi-user dungeon framework via SSH and each session createsApplicationinstance which is where it is used for rendering UI. I was curious to implement something like themes for different rooms (entering dungeon would result in a dark or gray themed UI for better experience)@rivo commented on GitHub (Apr 6, 2024):
Got it. Interesting. Well, as mentioned, this is currently not supported but there may be tools to facilitate this soon. (Again, I don't know how "soon".)
If you really need it, short of patching
tview, you could think about starting separate processes for each session. But I don't know how complicated this is in your application.@HeavyBro1337 commented on GitHub (Apr 6, 2024):
Well, I'm totally fine, it would be nice to have that. I can definitely
live without that!
On Sat, Apr 6, 2024, 15:49 rivo @.***> wrote: