Update to charm libraries v2 (#923)

Reviewed-on: https://gitea.com/gitea/tea/pulls/923
Reviewed-by: techknowlogick <9+techknowlogick@noreply.gitea.com>
Co-authored-by: Michal Suchanek <msuchanek@suse.de>
Co-committed-by: Michal Suchanek <msuchanek@suse.de>
This commit is contained in:
Michal Suchanek
2026-03-09 16:36:00 +00:00
committed by techknowlogick
parent 3372c9ec59
commit c797624fcf
18 changed files with 94 additions and 104 deletions

View File

@@ -5,16 +5,18 @@ package interact
import (
"fmt"
"os"
"code.gitea.io/tea/modules/theme"
"github.com/charmbracelet/lipgloss"
"charm.land/lipgloss/v2"
)
// printTitleAndContent prints a title and content with the gitea theme
func printTitleAndContent(title, content string) {
hasDarkBG := lipgloss.HasDarkBackground(os.Stdin, os.Stdout)
style := lipgloss.NewStyle().
Foreground(theme.GetTheme().Blurred.Title.GetForeground()).Bold(true).
Foreground(theme.GetTheme().Theme(hasDarkBG).Blurred.Title.GetForeground()).Bold(true).
Padding(0, 1)
fmt.Print(style.Render(title), content+"\n")
}