From f779018b370c0f4976988258d0aa51fc50633da1 Mon Sep 17 00:00:00 2001 From: Christian Rocha Date: Thu, 19 Aug 2021 22:03:17 -0400 Subject: [PATCH] Colorize repo title and clone command --- tui/bubbles/repo/bubble.go | 10 ++++------ tui/style/style.go | 10 +++------- 2 files changed, 7 insertions(+), 13 deletions(-) diff --git a/tui/bubbles/repo/bubble.go b/tui/bubbles/repo/bubble.go index eafba0df5b29ca629df8d0b942e047f811cd54bf..609fd2dace458b3b2584030d9c57ae4b985f10eb 100644 --- a/tui/bubbles/repo/bubble.go +++ b/tui/bubbles/repo/bubble.go @@ -107,20 +107,18 @@ func (b Bubble) headerView() string { n = "Home" } title := ts.Render(n) - note := ns.Width(b.width - b.widthMargin - lipgloss.Width(title)). - Render(b.sshAddress()) + note := ns.Width(b.width - b.widthMargin - lipgloss.Width(title)).Render(b.sshAddress()) return lipgloss.JoinHorizontal(lipgloss.Top, title, note) } func (b *Bubble) View() string { - s := b.styles header := b.headerView() - bs := s.RepoBody.Copy() + bs := b.styles.RepoBody.Copy() if b.Active { - bs = bs.BorderForeground(s.ActiveBorderColor) + bs = bs.BorderForeground(b.styles.ActiveBorderColor) } body := bs. - Width(b.width - b.widthMargin - s.RepoBody.GetVerticalFrameSize()). + Width(b.width - b.widthMargin - b.styles.RepoBody.GetVerticalFrameSize()). Height(b.height - b.heightMargin - lipgloss.Height(header)). Render(b.readmeViewport.View()) return header + body diff --git a/tui/style/style.go b/tui/style/style.go index aad8135b3dedb39245b750c93205a3c41480900c..5043a98a2ab67b581d3a69b5c71ace592efc6abc 100644 --- a/tui/style/style.go +++ b/tui/style/style.go @@ -35,8 +35,6 @@ type Styles struct { Error lipgloss.Style ErrorTitle lipgloss.Style ErrorBody lipgloss.Style - - Command lipgloss.Style } func DefaultStyles() *Styles { @@ -108,11 +106,13 @@ func DefaultStyles() *Styles { s.RepoTitle = lipgloss.NewStyle(). Border(s.RepoTitleBorder). BorderForeground(s.InactiveBorderColor). - Padding(0, 2) + Padding(0, 2). + Foreground(lipgloss.Color("252")) s.RepoNote = lipgloss.NewStyle(). Border(s.RepoNoteBorder, true, true, true, false). BorderForeground(s.InactiveBorderColor). + Foreground(lipgloss.Color("168")). Padding(0, 2) s.RepoBody = lipgloss.NewStyle(). @@ -147,9 +147,5 @@ func DefaultStyles() *Styles { MarginLeft(2). Width(52) // for now - s.Command = lipgloss.NewStyle(). - Background(lipgloss.Color("237")). - Foreground(lipgloss.Color("204")) - return s }