Skip to content

Commit 16020b0

Browse files
feat: changes style of focussed box
1 parent a0f42f6 commit 16020b0

File tree

2 files changed

+26
-3
lines changed

2 files changed

+26
-3
lines changed

pkg/gui/styles.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ import (
55
)
66

77
var (
8+
// Border colors
9+
FocusedBorderColor = lipgloss.Color("#7D56F4") // Purple - for focused panel
10+
UnfocusedBorderColor = lipgloss.Color("#4A4A4A") // Dim gray - for unfocused panels
11+
812
TitleStyle = lipgloss.NewStyle().
913
Foreground(lipgloss.Color("#FAFAFA")).
1014
Background(lipgloss.Color("#7D56F4")).

pkg/gui/views.go

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,9 +121,15 @@ func ViewMainMenuWithDim(m ModelView, dim boxlayout.Dimensions) string {
121121
}
122122
}
123123

124+
// Choose border color based on focus (Main Menu is panel 0)
125+
borderColor := UnfocusedBorderColor
126+
if activePanel == 0 {
127+
borderColor = FocusedBorderColor
128+
}
129+
124130
boxStyle := lipgloss.NewStyle().
125131
Border(lipgloss.RoundedBorder()).
126-
BorderForeground(lipgloss.Color("#7D56F4")).
132+
BorderForeground(borderColor).
127133
Padding(0, 1).
128134
Width(actualBoxWidth - 2).
129135
Height(boxHeight - 2)
@@ -260,9 +266,15 @@ func ViewSubMenuWithDim(m ModelView, dim boxlayout.Dimensions) string {
260266
}
261267
}
262268

269+
// Choose border color based on focus (Sub Menu is panel 1)
270+
borderColor := UnfocusedBorderColor
271+
if activePanel == 1 {
272+
borderColor = FocusedBorderColor
273+
}
274+
263275
boxStyle := lipgloss.NewStyle().
264276
Border(lipgloss.RoundedBorder()).
265-
BorderForeground(lipgloss.Color("#7D56F4")).
277+
BorderForeground(borderColor).
266278
Padding(0, 1).
267279
Width(actualBoxWidth - 2).
268280
Height(boxHeight - 2)
@@ -314,6 +326,7 @@ func ViewDetailsWithDim(m ModelView, dim boxlayout.Dimensions) string {
314326

315327
detailOutput := m.GetDetailOutput()
316328
detailScroll := m.GetDetailScroll()
329+
activePanel := m.GetActivePanel()
317330

318331
// Split content into lines for scrolling
319332
contentLines := strings.Split(detailOutput, "\n")
@@ -401,9 +414,15 @@ func ViewDetailsWithDim(m ModelView, dim boxlayout.Dimensions) string {
401414
}
402415
}
403416

417+
// Choose border color based on focus (Details is panel 2)
418+
borderColor := UnfocusedBorderColor
419+
if activePanel == 2 {
420+
borderColor = FocusedBorderColor
421+
}
422+
404423
detailBoxStyle := lipgloss.NewStyle().
405424
Border(lipgloss.RoundedBorder()).
406-
BorderForeground(lipgloss.Color("#7D56F4")).
425+
BorderForeground(borderColor).
407426
Padding(0, 1).
408427
Width(actualBoxWidth - 2).
409428
Height(boxHeight - 2)

0 commit comments

Comments
 (0)