mirror of
https://github.com/zoriya/bubbles.git
synced 2026-08-16 01:43:21 +00:00
feat(textarea): add helpers for default light and dark styles
This commit is contained in:
+11
-1
@@ -290,7 +290,7 @@ func New() Model {
|
|||||||
vp.KeyMap = viewport.KeyMap{}
|
vp.KeyMap = viewport.KeyMap{}
|
||||||
cur := cursor.New()
|
cur := cursor.New()
|
||||||
|
|
||||||
styles := DefaultStyles(true)
|
styles := DefaultDarkStyles()
|
||||||
|
|
||||||
m := Model{
|
m := Model{
|
||||||
CharLimit: defaultCharLimit,
|
CharLimit: defaultCharLimit,
|
||||||
@@ -348,6 +348,16 @@ func DefaultStyles(isDark bool) Styles {
|
|||||||
return s
|
return s
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// DefaultLightStyles returns the default styles for a light background.
|
||||||
|
func DefaultLightStyles() Styles {
|
||||||
|
return DefaultStyles(false)
|
||||||
|
}
|
||||||
|
|
||||||
|
// DefaultDarkStyles returns the default styles for a dark background.
|
||||||
|
func DefaultDarkStyles() Styles {
|
||||||
|
return DefaultStyles(true)
|
||||||
|
}
|
||||||
|
|
||||||
// SetValue sets the value of the text input.
|
// SetValue sets the value of the text input.
|
||||||
func (m *Model) SetValue(s string) {
|
func (m *Model) SetValue(s string) {
|
||||||
m.Reset()
|
m.Reset()
|
||||||
|
|||||||
Reference in New Issue
Block a user