settings

package
v0.0.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 23, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package settings implements the settings overlay panel for grut. It displays a navigable list of configurable options (preview position, theme, double-click actions) and emits messages when the user changes a value.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Panel

type Panel struct {
	panels.BasePanel
	// contains filtered or unexported fields
}

Panel is the settings overlay. It implements panels.Panel.

func New

func New(currentPos layout.PreviewPosition, currentTheme string, themeNames []string, actionsCfg config.ActionsConfig) *Panel

New creates a new settings overlay panel.

func (*Panel) Init

func (p *Panel) Init(_ context.Context) tea.Cmd

--------------------------------------------------------------------------- panels.Panel interface --------------------------------------------------------------------------- Init implements panels.Panel.

func (*Panel) KeyBindings

func (p *Panel) KeyBindings() []panels.KeyBinding

KeyBindings implements panels.Panel.

func (*Panel) Update

func (p *Panel) Update(msg tea.Msg) (panels.Panel, tea.Cmd)

Update implements panels.Panel.

func (*Panel) View

func (p *Panel) View(width, height int) string

View implements panels.Panel. It renders the settings menu within the given dimensions.

type ResetActionPromptsMsg

type ResetActionPromptsMsg struct{}

ResetActionPromptsMsg is emitted when the user resets all action confirmations.

type SetDoubleClickActionMsg

type SetDoubleClickActionMsg struct {
	ItemType string
	Action   string
}

SetDoubleClickActionMsg is emitted when the user changes a double-click action.

type SetPreviewPositionMsg

type SetPreviewPositionMsg struct {
	Position layout.PreviewPosition
}

SetPreviewPositionMsg is emitted when the user selects a preview position. The root model handles this by calling engine.SetPreviewPosition.

type SetRightClickActionMsg

type SetRightClickActionMsg struct {
	ItemType string
	Action   string
}

SetRightClickActionMsg is emitted when the user changes a right-click action.

type SetThemeMsg

type SetThemeMsg struct {
	Name string
}

SetThemeMsg is emitted when the user selects a theme. The root model handles this by loading and applying the new theme.

type ToggleSettingsMsg

type ToggleSettingsMsg struct{}

ToggleSettingsMsg requests showing or hiding the settings overlay.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL