mirror of
https://github.com/mrusme/neonmodem.git
synced 2024-12-04 14:46:37 -05:00
Added Dialog param
This commit is contained in:
parent
dbaeadf833
commit
78da08af0b
@ -6,7 +6,7 @@ import (
|
||||
"github.com/charmbracelet/lipgloss"
|
||||
)
|
||||
|
||||
func (tk *ToolKit) Dialog(title string, content string) string {
|
||||
func (tk *ToolKit) Dialog(title string, content string, bbar bool) string {
|
||||
var view strings.Builder = strings.Builder{}
|
||||
|
||||
var style lipgloss.Style
|
||||
@ -27,16 +27,25 @@ func (tk *ToolKit) Dialog(title string, content string) string {
|
||||
}
|
||||
bindings = append(bindings, "esc close")
|
||||
|
||||
var ui string
|
||||
if bbar {
|
||||
bottombar := tk.theme.DialogBox.Bottombar.
|
||||
Width(tk.ViewWidth()).
|
||||
Render(strings.Join(bindings, " · "))
|
||||
|
||||
ui := lipgloss.JoinVertical(
|
||||
ui = lipgloss.JoinVertical(
|
||||
lipgloss.Center,
|
||||
titlebar,
|
||||
content,
|
||||
bottombar,
|
||||
)
|
||||
} else {
|
||||
ui = lipgloss.JoinVertical(
|
||||
lipgloss.Center,
|
||||
titlebar,
|
||||
content,
|
||||
)
|
||||
}
|
||||
|
||||
var tmp string
|
||||
if tk.IsFocused() {
|
||||
|
@ -46,6 +46,7 @@ func buildView(mi interface{}, cached bool) string {
|
||||
return m.tk.Dialog(
|
||||
title,
|
||||
m.textarea.View(),
|
||||
true,
|
||||
)
|
||||
|
||||
}
|
||||
|
@ -27,6 +27,7 @@ func buildView(mi interface{}, cached bool) string {
|
||||
return m.tk.Dialog(
|
||||
"Post",
|
||||
viewportStyle.Render(m.viewport.View()),
|
||||
true,
|
||||
)
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user