NAME

Term::Fabulous::ThemeEditor::SettingsList - The table of settings in the theme editor's form

DESCRIPTION

Part of Term::Fabulous::ThemeEditor; not meant to be used on its own. A tree of rows in sections, each row showing a swatch, the setting (indented, sections with a marker), its value and where the value comes from, under a row of titles. Only the rows near the viewport are widgets, inside a Term::Fabulous::Widget::VirtualList, so the list costs the same with every section open. The rows are painted in the colors of the theme's table family: the cursor in table.cursor (table.selected while the list does not have the focus), the row under the pointer in table.hover, sections in table.group.text on table.group.background, settings the theme does not set in table.muted. A text too long for its column ends in ~; the columns keep their places whatever the list shows.

Keys while the list has the focus: Up, Down, PageUp, PageDown, Home, End move the cursor; Right or + opens a section (on an open one, Right goes to its first row); Left or - closes a section, or goes to the section above a row; Enter or Space opens or closes a section and edits a setting. A click puts the cursor on a row, a click on a section's marker opens or closes it, a double click activates a row, the wheel scrolls.

CONSTRUCTOR

new

my $list = Term::Fabulous::ThemeEditor::SettingsList->new(
	id          => 'settings',
	on_activate => sub ($id) { ... },    # Enter or a double click on a setting
	on_cursor   => sub ($id) { ... },    # the cursor moved
);

METHODS

rows

Replaces all rows: hashes with id, setting, value, origin, swatch (glyphs), color (the swatch's color), set, and for a section section => 1 with its rows under children.

row, has_row, row_ids, parent_of, children_of, update_row, refresh

Reading the rows, changing one's texts, and showing the rows again after such changes (a search or a filter may take other rows then).

expand, collapse, toggle, expand_all, collapse_all, is_expanded

Opening and closing sections.

search, filter, filtered_row_ids

The search text (rows whose texts hold it, in any case, with their sections), named filters (code that gets a row), and the ids of the rows shown.

cursor, cursor_index

The row under the cursor; setting it opens the sections above the row and scrolls it into view, and dies for a row a search or a filter hides.

activate, click, hover

What Enter, a click and the pointer do to a row.

shown_count, shown_row, hover_index, value_columns

What the rows paint from.

SEE ALSO

Term::Fabulous::ThemeEditor, Term::Fabulous::ThemeEditor::Form, Term::Fabulous::Widget::VirtualList.