Open 0xJWLabs opened 1 month ago
Have you tried using https://pkg.go.dev/github.com/rivo/tview#InputField.SetFieldStyle? It should look something like:
table.SetSelectedStyle(
tcell.Style{}.
Background(tcell.GetColor("#40ea37")).
Foreground(tcell.ColorBlack),
)
The documentation for AddFormItem()
explains this:
Note, however, that the Form class will override some of its attributes to make it work in the form context. Specifically, these are:
- The label width
- The label color
- The background color
- The field text color
- The field background color
You'll want to use Form.SetFieldBackgroundColor()
and Form.SetFieldTextColor()
, or, even better, the new Form.SetFieldStyle()
function if you want to change the appearance of the form elements.
Description
In my application using tview, I've created a login form with input fields for email, password, an optional code, and a checkbox. I am trying to set the background and text colors for these elements, but they don't seem to change, even though the code is correctly detecting the form items.
Code Snippet
Here's a snippet of the relevant part of the code:
Expected Behavior
Actual Behavior