summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGrail Finder <wohilas@gmail.com>2025-12-03 14:32:09 +0300
committerGrail Finder <wohilas@gmail.com>2025-12-03 14:32:09 +0300
commit87f67b374dca8cc1d3797ee6ffc606c2deb06053 (patch)
treece959f97dbf51ab0403815d9b09fbe8eb651ff78
parent1416a8ebbf5653d2a87fb386993d328fe42b4ca0 (diff)
Enha: colors
-rw-r--r--props_table.go32
1 files changed, 16 insertions, 16 deletions
diff --git a/props_table.go b/props_table.go
index b10bb8e..dc4020c 100644
--- a/props_table.go
+++ b/props_table.go
@@ -11,10 +11,10 @@ import (
// Define constants for cell types
const (
- CellTypeCheckbox = "checkbox"
- CellTypeDropdown = "dropdown"
- CellTypeInput = "input"
- CellTypeHeader = "header"
+ CellTypeCheckbox = "checkbox"
+ CellTypeDropdown = "dropdown"
+ CellTypeInput = "input"
+ CellTypeHeader = "header"
CellTypeListPopup = "listpopup"
)
@@ -31,7 +31,8 @@ func makePropsTable(props map[string]float32) *tview.Table {
// Create a new table
table := tview.NewTable().
SetBorders(true).
- SetSelectable(true, false) // Allow row selection but not column selection
+ SetSelectable(true, false).
+ SetSelectedStyle(tcell.StyleDefault.Background(tcell.ColorDarkCyan).Foreground(tcell.ColorWhite)) // Allow row selection but not column selection
table.SetTitle("Properties Configuration (Press 'x' to exit)").
SetTitleAlign(tview.AlignLeft)
@@ -67,7 +68,7 @@ func makePropsTable(props map[string]float32) *tview.Table {
}
valueCell := tview.NewTableCell(valueText).
- SetTextColor(tcell.ColorGreen).
+ SetTextColor(tcell.ColorYellow).
SetAlign(tview.AlignCenter)
table.SetCell(row, 1, valueCell)
@@ -80,8 +81,6 @@ func makePropsTable(props map[string]float32) *tview.Table {
row++
}
-
-
// Helper function to add a dropdown-like row, that opens a list popup
addListPopupRow := func(label string, options []string, initialValue string, onChange func(string)) {
table.SetCell(row, 0,
@@ -91,7 +90,7 @@ func makePropsTable(props map[string]float32) *tview.Table {
SetSelectable(false))
valueCell := tview.NewTableCell(initialValue).
- SetTextColor(tcell.ColorGreen).
+ SetTextColor(tcell.ColorYellow).
SetAlign(tview.AlignCenter)
table.SetCell(row, 1, valueCell)
@@ -114,7 +113,7 @@ func makePropsTable(props map[string]float32) *tview.Table {
SetSelectable(false))
valueCell := tview.NewTableCell(initialValue).
- SetTextColor(tcell.ColorGreen).
+ SetTextColor(tcell.ColorYellow).
SetAlign(tview.AlignCenter)
table.SetCell(row, 1, valueCell)
@@ -313,13 +312,13 @@ func makePropsTable(props map[string]float32) *tview.Table {
// Create a simple modal with the input field
modalFlex := tview.NewFlex().
SetDirection(tview.FlexRow).
- AddItem(tview.NewBox(), 0, 1, false). // Spacer
+ AddItem(tview.NewBox(), 0, 1, false). // Spacer
AddItem(tview.NewFlex().
- AddItem(tview.NewBox(), 0, 1, false). // Spacer
+ AddItem(tview.NewBox(), 0, 1, false). // Spacer
AddItem(inputFld, 30, 1, true). // Input field
- AddItem(tview.NewBox(), 0, 1, false), // Spacer
- 0, 1, true).
- AddItem(tview.NewBox(), 0, 1, false) // Spacer
+ AddItem(tview.NewBox(), 0, 1, false), // Spacer
+ 0, 1, true).
+ AddItem(tview.NewBox(), 0, 1, false) // Spacer
// Add modal page and make it visible
pages.AddPage("editModal", modalFlex, true, true)
@@ -338,4 +337,5 @@ func makePropsTable(props map[string]float32) *tview.Table {
})
return table
-} \ No newline at end of file
+}
+