mirror of
https://github.com/anotherhadi/ilovetui.git
synced 2026-08-21 12:05:49 +02:00
5f99fa7521
Signed-off-by: Hadi <112569860+anotherhadi@users.noreply.github.com>
27 lines
915 B
Go
27 lines
915 B
Go
package bubbles
|
|
|
|
import (
|
|
"charm.land/bubbles/v2/filepicker"
|
|
|
|
"github.com/anotherhadi/ilovetui/style"
|
|
)
|
|
|
|
// NewFilePicker returns a filepicker.Model styled with the active theme.
|
|
func NewFilePicker() filepicker.Model {
|
|
f := filepicker.New()
|
|
s := filepicker.DefaultStyles()
|
|
s.Cursor = s.Cursor.Foreground(style.S.Primary)
|
|
s.DisabledCursor = s.DisabledCursor.Foreground(style.S.Subtle)
|
|
s.Symlink = s.Symlink.Foreground(style.S.Warning)
|
|
s.Directory = s.Directory.Foreground(style.S.Primary)
|
|
s.File = s.File.Foreground(style.S.Text)
|
|
s.DisabledFile = s.DisabledFile.Foreground(style.S.Subtle)
|
|
s.Permission = s.Permission.Foreground(style.S.Muted)
|
|
s.Selected = s.Selected.Foreground(style.S.Primary)
|
|
s.DisabledSelected = s.DisabledSelected.Foreground(style.S.Subtle)
|
|
s.FileSize = s.FileSize.Foreground(style.S.Muted)
|
|
s.EmptyDirectory = s.EmptyDirectory.Foreground(style.S.Subtle)
|
|
f.Styles = s
|
|
return f
|
|
}
|