panes

package
v0.9.7 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2024 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BacklogPane added in v0.8.0

type BacklogPane struct {
	ui.LeafPane
	// contains filtered or unexported fields
}

BacklogPane shows a tasks backlog from which tasks and prospective events can be selected and moved into concrete days, i.e., planned.

func NewBacklogPane added in v0.8.0

func NewBacklogPane(
	renderer ui.ConstrainedRenderer,
	dimensions func() (x, y, w, h int),
	stylesheet styling.Stylesheet,
	inputProcessor input.ModalInputProcessor,
	viewParams ui.TimeViewParams,
	getCurrentTask func() *model.Task,
	backlog *model.Backlog,
	categoryStyleProvider func(model.Category) (styling.DrawStyling, error),
	visible func() bool,
) *BacklogPane

NewBacklogPane constructs and returns a new BacklogPane.

func (*BacklogPane) Dimensions added in v0.8.0

func (p *BacklogPane) Dimensions() (x, y, w, h int)

Dimensions gives the dimensions (x-axis offset, y-axis offset, width, height) for this pane. GetPositionInfo returns information on a requested position in this pane.

func (*BacklogPane) Draw added in v0.8.0

func (p *BacklogPane) Draw()

Draw draws this pane.

func (*BacklogPane) GetPositionInfo added in v0.8.0

func (p *BacklogPane) GetPositionInfo(x, y int) ui.PositionInfo

GetPositionInfo returns information on a requested position in this pane.

func (*BacklogPane) GetTaskUIYBounds added in v0.8.0

func (p *BacklogPane) GetTaskUIYBounds(t *model.Task) (lb, ub int)

func (*BacklogPane) GetTaskVisibilityBounds added in v0.8.0

func (p *BacklogPane) GetTaskVisibilityBounds() (lb, ub int)

type BacklogPanePositionInfo added in v0.8.0

type BacklogPanePositionInfo struct {
}

BacklogPanePositionInfo conveys information on a position in a BacklogPane.

type ByAlphabeticOrder added in v0.7.7

type ByAlphabeticOrder []string

func (ByAlphabeticOrder) Len added in v0.7.7

func (a ByAlphabeticOrder) Len() int

func (ByAlphabeticOrder) Less added in v0.7.7

func (a ByAlphabeticOrder) Less(i, j int) bool

func (ByAlphabeticOrder) Swap added in v0.7.7

func (a ByAlphabeticOrder) Swap(i, j int)

type Composite

type Composite struct {
	ui.BasePane

	FocussedPane ui.Pane
	// contains filtered or unexported fields
}

Composite is a generic wrapper pane whithout any rendering logic of its own.

func NewWrapperPane

func NewWrapperPane(
	drawables []ui.Pane,
	focussables []ui.Pane,
	inputProcessor input.ModalInputProcessor,
) *Composite

NewWrapperPane constructs and returns a new WrapperPane.

func (*Composite) ApplyModalOverlay

func (p *Composite) ApplyModalOverlay(overlay input.SimpleInputProcessor) (index uint)

ApplyModalOverlay applies an overlay to this processor. It returns the processors index, by which in the future, all overlays down to and including this overlay can be removed

func (*Composite) CapturesInput

func (p *Composite) CapturesInput() bool

CapturesInput returns whether this processor "captures" input, i.E. whether it ought to take priority in processing over other processors.

func (*Composite) Dimensions

func (p *Composite) Dimensions() (x, y, w, h int)

Dimensions gives the dimensions (x-axis offset, y-axis offset, width, height) for this pane.

func (*Composite) Draw

func (p *Composite) Draw()

Draw draws this pane by drawing all its subpanes. Absent subpanes this draws nothing.

func (*Composite) EnsureFocusIsOnVisible added in v0.8.0

func (p *Composite) EnsureFocusIsOnVisible()

func (*Composite) FocusNext

func (p *Composite) FocusNext()

FocusNext focusses the next focussable in the composite.

func (*Composite) FocusPrev

func (p *Composite) FocusPrev()

FocusPrev focusses the previous focussable in the composite.

func (*Composite) Focusses

func (p *Composite) Focusses() ui.PaneID

Focusses returns the ID of the pane focussed by this composite.

func (*Composite) GetHelp

func (p *Composite) GetHelp() input.Help

GetHelp returns the input help map for this processor.

func (*Composite) GetPositionInfo

func (p *Composite) GetPositionInfo(x, y int) ui.PositionInfo

GetPositionInfo returns information on a requested position in this pane.

func (*Composite) HasFocus

func (p *Composite) HasFocus() bool

HasFocus indicates, whether this composite pane has focus.

func (*Composite) PopModalOverlay

func (p *Composite) PopModalOverlay() error

PopModalOverlay removes the topmost overlay from this processor.

func (*Composite) PopModalOverlays

func (p *Composite) PopModalOverlays(index uint)

PopModalOverlays pops all overlays down to and including the one at the specified index.

func (*Composite) ProcessInput

func (p *Composite) ProcessInput(key input.Key) bool

ProcessInput attempts to process the provided input. Returns whether the provided input "applied", i.E. the processor performed an action based on the input. Defers to the panes' input processor or its focussed subpanes.

func (*Composite) SetParent

func (p *Composite) SetParent(parent ui.PaneQuerier)

SetParent sets the parent of this composite pane.

func (*Composite) Undraw

func (p *Composite) Undraw()

Undraw calls undraw on each drawable in the composite.

type CompositeEditorPane added in v0.8.0

type CompositeEditorPane struct {
	ui.LeafPane
	// contains filtered or unexported fields
}

CompositeEditorPane visualizes a composite editor.

func NewCompositeEditorPane added in v0.8.0

func NewCompositeEditorPane(
	renderer ui.ConstrainedRenderer,
	visible func() bool,
	inputProcessor input.ModalInputProcessor,
	stylesheet styling.Stylesheet,
	subEditors []ui.Pane,
	getFocussedIndex func() int,
	isInField func() bool,
	view views.CompositeEditorView,
) *CompositeEditorPane

NewCompositeEditorPane creates a new CompositeEditorPane.

func (*CompositeEditorPane) Draw added in v0.8.0

func (p *CompositeEditorPane) Draw()

Draw draws the editor popup.

func (*CompositeEditorPane) GetDebugInfo added in v0.9.7

func (p *CompositeEditorPane) GetDebugInfo() string

func (*CompositeEditorPane) GetHelp added in v0.8.0

func (p *CompositeEditorPane) GetHelp() input.Help

GetHelp returns the input help map for this composite pane.

func (*CompositeEditorPane) GetPositionInfo added in v0.8.0

func (p *CompositeEditorPane) GetPositionInfo(_, _ int) ui.PositionInfo

GetPositionInfo returns information on a requested position in this pane (nil, for now).

func (*CompositeEditorPane) ProcessInput added in v0.8.0

func (p *CompositeEditorPane) ProcessInput(key input.Key) bool

ProcessInput attempts to process the provided input. Returns whether the provided input "applied", i.E. the processor performed an action based on the input. Defers to the panes' input processor or its focussed subpanes.

func (*CompositeEditorPane) Undraw added in v0.8.0

func (p *CompositeEditorPane) Undraw()

Undraw ensures that the cursor is hidden.

type EventEditorPane added in v0.8.0

type EventEditorPane struct {
	ui.LeafPane
	// contains filtered or unexported fields
}

EventEditorPane visualizes the detailed editing of an event.

func NewEventEditorPane added in v0.8.0

func NewEventEditorPane(
	renderer ui.ConstrainedRenderer,
	cursorController ui.CursorLocationRequestHandler,
	dimensions func() (x, y, w, h int),
	stylesheet styling.Stylesheet,
	condition func() bool,
	name func() string,
	getMode func() input.TextEditMode,
	cursorPos func() int,
	inputProcessor input.ModalInputProcessor,
) *EventEditorPane

NewEventEditorPane constructs and returns a new EventEditorPane.

func (*EventEditorPane) Dimensions added in v0.8.0

func (p *EventEditorPane) Dimensions() (x, y, w, h int)

Dimensions gives the dimensions (x-axis offset, y-axis offset, width, height) for this pane.

func (*EventEditorPane) Draw added in v0.8.0

func (p *EventEditorPane) Draw()

Draw draws the editor popup.

func (*EventEditorPane) GetPositionInfo added in v0.8.0

func (p *EventEditorPane) GetPositionInfo(x, y int) ui.PositionInfo

GetPositionInfo returns information on a requested position in this pane.

func (*EventEditorPane) Undraw added in v0.8.0

func (p *EventEditorPane) Undraw()

Undraw ensures that the cursor is hidden.

type EventsPane

type EventsPane struct {
	ui.LeafPane
	// contains filtered or unexported fields
}

An EventsPane displays a single days events. It can be configured to display events with more decorations and padding (e.g., when displaying a single day in the UI), or to be space efficient and hide some details (e.g., for showing events as part of multiple EventPanes in in the month view.

func NewEventsPane

func NewEventsPane(
	renderer ui.ConstrainedRenderer,
	dimensions func() (x, y, w, h int),
	stylesheet styling.Stylesheet,
	inputProcessor input.ModalInputProcessor,
	day func() *model.Day,
	styleForCategory func(model.Category) (styling.DrawStyling, error),
	viewParams ui.TimespanViewParams,
	cursor *ui.MouseCursorPos,
	pad int,
	drawTimestamps bool,
	drawNames bool,
	drawCat bool,
	isCurrentDay func() bool,
	getCurrentEvent func() *model.Event,
	mouseMode func() bool,
) *EventsPane

NewEventsPane constructs and returns a new EventsPane.

func (*EventsPane) Dimensions

func (p *EventsPane) Dimensions() (x, y, w, h int)

Dimensions gives the dimensions (x-axis offset, y-axis offset, width, height) for this pane. GetPositionInfo returns information on a requested position in this pane.

func (*EventsPane) Draw

func (p *EventsPane) Draw()

Draw draws this pane.

func (*EventsPane) GetPositionInfo

func (p *EventsPane) GetPositionInfo(x, y int) ui.PositionInfo

GetPositionInfo returns information on a requested position in this pane. Importantly, when there is an event at the position, it will inform of that in detail.

type HelpPane

type HelpPane struct {
	ui.LeafPane

	Content input.Help
}

HelpPane conditionally be hidden or display a set of keyboad shortcuts.

func NewHelpPane

func NewHelpPane(
	renderer ui.ConstrainedRenderer,
	dimensions func() (x, y, w, h int),
	stylesheet styling.Stylesheet,
	condition func() bool,
	inputProcessor input.ModalInputProcessor,
) *HelpPane

NewHelpPane constructs and returns a new HelpPane.

func (*HelpPane) Dimensions

func (p *HelpPane) Dimensions() (x, y, w, h int)

Dimensions gives the dimensions (x-axis offset, y-axis offset, width, height) for this pane. GetPositionInfo returns information on a requested position in this pane.

func (*HelpPane) Draw

func (p *HelpPane) Draw()

Draw draws the help popup.

func (*HelpPane) GetPositionInfo

func (p *HelpPane) GetPositionInfo(x, y int) ui.PositionInfo

GetPositionInfo returns information on a requested position in this pane.

type LogPane

type LogPane struct {
	ui.LeafPane
	// contains filtered or unexported fields
}

LogPane shows the log, with the most recent log entries at the top.

func NewLogPane

func NewLogPane(
	renderer ui.ConstrainedRenderer,
	dimensions func() (x, y, w, h int),
	stylesheet styling.Stylesheet,
	condition func() bool,
	titleString func() string,
	logReader potatolog.LogReader,
) *LogPane

NewLogPane constructs and returns a new LogPane.

func (*LogPane) Dimensions

func (p *LogPane) Dimensions() (x, y, w, h int)

Dimensions gives the dimensions (x-axis offset, y-axis offset, width, height) for this pane. GetPositionInfo returns information on a requested position in this pane.

func (*LogPane) Draw

func (p *LogPane) Draw()

Draw draws the time summary view over top of all previously drawn contents, if it is currently active.

func (*LogPane) GetPositionInfo

func (p *LogPane) GetPositionInfo(x, y int) ui.PositionInfo

GetPositionInfo returns information on a requested position in this pane.

type MaybePane

type MaybePane struct {
	// contains filtered or unexported fields
}

MaybePane wraps another pane with a condition and exposes its functionality, iff the condition holds. Otherwise its operations do or return nothing or, in some cases, panic!

One use-case for this type is allowing a fixed number (31) of panes for a month, the last few of which are only sometimes used.

func NewMaybePane

func NewMaybePane(
	condition func() bool,
	pane ui.Pane,
) *MaybePane

NewMaybePane constructs and returns a new MaybePane.

func (*MaybePane) ApplyModalOverlay

func (p *MaybePane) ApplyModalOverlay(overlay input.SimpleInputProcessor) uint

ApplyModalOverlay iff condition.

func (*MaybePane) CapturesInput

func (p *MaybePane) CapturesInput() bool

CapturesInput iff condition.

func (*MaybePane) Dimensions

func (p *MaybePane) Dimensions() (x, y, w, h int)

Dimensions gives the dimensions (x-axis offset, y-axis offset, width, height) for this pane.

func (*MaybePane) Draw

func (p *MaybePane) Draw()

Draw draws this pane.

func (*MaybePane) FocusNext

func (p *MaybePane) FocusNext()

FocusNext iff condition.

func (*MaybePane) FocusPrev

func (p *MaybePane) FocusPrev()

FocusPrev iff condition.

func (*MaybePane) Focusses

func (p *MaybePane) Focusses() ui.PaneID

Focusses iff condition.

func (*MaybePane) GetHelp

func (p *MaybePane) GetHelp() input.Help

GetHelp iff condition.

func (*MaybePane) GetPositionInfo

func (p *MaybePane) GetPositionInfo(x, y int) ui.PositionInfo

GetPositionInfo returns information on a requested position in the underlying pane, iff condition.

func (*MaybePane) HasFocus

func (p *MaybePane) HasFocus() bool

HasFocus iff condition.

func (*MaybePane) Identify

func (p *MaybePane) Identify() ui.PaneID

Identify by ID, iff condtion.

func (*MaybePane) IsVisible

func (p *MaybePane) IsVisible() bool

IsVisible iff condition.

func (*MaybePane) PopModalOverlay

func (p *MaybePane) PopModalOverlay() error

PopModalOverlay iff condition.

func (*MaybePane) PopModalOverlays

func (p *MaybePane) PopModalOverlays(index uint)

PopModalOverlays iff condition.

func (*MaybePane) ProcessInput

func (p *MaybePane) ProcessInput(k input.Key) bool

ProcessInput iff condition.

func (*MaybePane) SetParent

func (p *MaybePane) SetParent(parent ui.PaneQuerier)

SetParent iff condition.

func (*MaybePane) Undraw

func (p *MaybePane) Undraw()

Undraw iff condition.

type PerfPane

type PerfPane struct {
	ui.LeafPane
	// contains filtered or unexported fields
}

PerfPane is an ephemeral pane used for showing debug info during normal usage.

func NewPerfPane

func NewPerfPane(
	renderer ui.ConstrainedRenderer,
	dimensions func() (x, y, w, h int),
	condition func() bool,
	renderTime util.MetricsGetter,
	eventProcessingTime util.MetricsGetter,
) *PerfPane

NewPerfPane constructs and returns a new PerfPane.

func (*PerfPane) Dimensions

func (p *PerfPane) Dimensions() (x, y, w, h int)

Dimensions gives the dimensions (x-axis offset, y-axis offset, width, height) for this pane. GetPositionInfo returns information on a requested position in this pane.

func (*PerfPane) Draw

func (p *PerfPane) Draw()

Draw draws this pane.

func (*PerfPane) GetPositionInfo

func (p *PerfPane) GetPositionInfo(x, y int) ui.PositionInfo

GetPositionInfo returns information on a requested position in this pane.

func (*PerfPane) Undraw

func (p *PerfPane) Undraw()

EnsureHidden informs the pane that it is not being shown so that it can take potential actions to ensure that, e.g., hide the terminal cursor, if necessary.

type RootPane

type RootPane struct {
	ID ui.PaneID
	// contains filtered or unexported fields
}

RootPane acts as the root UI pane, wrapping all subpanes, managing the render cycle, invoking the subpanes' rendering, etc.

func NewRootPane

func NewRootPane(
	renderer ui.RenderOrchestratorControl,
	cursorWrangler *ui.CursorWrangler,
	dimensions func() (x, y, w, h int),
	dayViewMainPane *Composite,
	weekViewMainPane *Composite,
	monthViewMainPane *Composite,
	summary ui.Pane,
	log ui.Pane,
	help ui.Pane,
	performanceMetricsOverlay ui.Pane,
	inputProcessor input.ModalInputProcessor,
	focussedPane ui.Pane,
) *RootPane

NewRootPane constructs and returns a new RootPane.

func (*RootPane) ApplyModalOverlay

func (p *RootPane) ApplyModalOverlay(overlay input.SimpleInputProcessor) (index uint)

ApplyModalOverlay applies an overlay to this processor. It returns the processors index, by which in the future, all overlays down to and including this overlay can be removed

func (*RootPane) CapturesInput

func (p *RootPane) CapturesInput() bool

CapturesInput returns whether this processor "captures" input, i.E. whether it ought to take priority in processing over other processors.

func (*RootPane) DeferPreDraw added in v0.8.0

func (p *RootPane) DeferPreDraw(f func())

DeferPreDraw attaches a function to the pre-draw stack, which is executed

func (*RootPane) Dimensions

func (p *RootPane) Dimensions() (x, y, w, h int)

Dimensions gives the dimensions (x-axis offset, y-axis offset, width, height) for this pane.

func (*RootPane) Draw

func (p *RootPane) Draw()

Draw draws this pane.

func (*RootPane) FocusNext

func (p *RootPane) FocusNext()

func (*RootPane) FocusPrev

func (p *RootPane) FocusPrev()

func (*RootPane) Focusses

func (p *RootPane) Focusses() ui.PaneID

func (*RootPane) GetHelp

func (p *RootPane) GetHelp() input.Help

GetHelp returns the input help map for this processor.

func (*RootPane) GetPositionInfo

func (p *RootPane) GetPositionInfo(x, y int) ui.PositionInfo

GetPositionInfo returns information on a requested position in this pane.

func (*RootPane) GetView

func (p *RootPane) GetView() ui.ActiveView

func (*RootPane) HasFocus

func (p *RootPane) HasFocus() bool

func (*RootPane) Identify

func (p *RootPane) Identify() ui.PaneID

func (*RootPane) IsVisible

func (p *RootPane) IsVisible() bool

func (*RootPane) PopModalOverlay

func (p *RootPane) PopModalOverlay() error

PopModalOverlay removes the topmost overlay from this processor.

func (*RootPane) PopModalOverlays

func (p *RootPane) PopModalOverlays(index uint)

PopModalOverlays pops all overlays down to and including the one at the specified index.

func (*RootPane) PopSubpane added in v0.8.0

func (p *RootPane) PopSubpane()

PopSubpane pops the topmost subpane

func (*RootPane) ProcessInput

func (p *RootPane) ProcessInput(key input.Key) bool

ProcessInput attempts to process the provided input. Returns whether the provided input "applied", i.E. the processor performed an action based on the input. Defers to the panes' input processor or its focussed subpanes.

func (*RootPane) PushSubpane added in v0.8.0

func (p *RootPane) PushSubpane(pane ui.Pane)

PushSubpane allows adding a subpane over top of other subpanes.

func (*RootPane) SetParent

func (p *RootPane) SetParent(ui.PaneQuerier)

func (*RootPane) Undraw

func (p *RootPane) Undraw()

func (*RootPane) ViewDown

func (p *RootPane) ViewDown()

func (*RootPane) ViewUp

func (p *RootPane) ViewUp()

type StatusPane

type StatusPane struct {
	ui.LeafPane
	// contains filtered or unexported fields
}

StatusPane is a status bar that displays the current date, weekday, and - if in a multi-day view - the progress through those days.

func NewStatusPane

func NewStatusPane(
	renderer ui.ConstrainedRenderer,
	dimensions func() (x, y, w, h int),
	stylesheet styling.Stylesheet,
	currentDate *model.Date,
	dayWidth func() int,
	totalDaysInPeriod func() int,
	passedDaysInPeriod func() int,
	firstDayXOffset func() int,
	eventEditMode func() edit.EventEditMode,
) *StatusPane

NewStatusPane constructs and returns a new StatusPane.

func (*StatusPane) Draw

func (p *StatusPane) Draw()

Draw draws this pane.

func (*StatusPane) GetPositionInfo

func (p *StatusPane) GetPositionInfo(x, y int) ui.PositionInfo

GetPositionInfo returns information on a requested position in this pane.

type StringEditorPane added in v0.8.0

type StringEditorPane struct {
	ui.LeafPane
	// contains filtered or unexported fields
}

StringEditorPane visualizes the editing of a string (as seen by a StringEditorView).

func NewStringEditorPane added in v0.8.0

func NewStringEditorPane(
	renderer ui.ConstrainedRenderer,
	visible func() bool,
	inputProcessor input.ModalInputProcessor,
	view views.StringEditorView,
	stylesheet styling.Stylesheet,
	cursorController ui.CursorLocationRequestHandler,
) *StringEditorPane

NewStringEditorPane creates a new StringEditorPane.

func (*StringEditorPane) Draw added in v0.8.0

func (p *StringEditorPane) Draw()

Draw draws the editor popup.

func (*StringEditorPane) GetPositionInfo added in v0.8.0

func (p *StringEditorPane) GetPositionInfo(_, _ int) ui.PositionInfo

GetPositionInfo returns information on a requested position in this pane (nil, for now).

func (*StringEditorPane) ProcessInput added in v0.8.0

func (p *StringEditorPane) ProcessInput(k input.Key) bool

ProcessInput attempts to process the provided input.

func (*StringEditorPane) Undraw added in v0.8.0

func (p *StringEditorPane) Undraw()

Undraw ensures that the cursor is hidden.

type SummaryPane

type SummaryPane struct {
	ui.LeafPane
	// contains filtered or unexported fields
}

SummaryPane shows a summary of the set of days it is provided. It shows all events' times summed up (by Summarize, meaning without counting any time multiple times) and visualizes the results in simple bars.

func NewSummaryPane

func NewSummaryPane(
	renderer ui.ConstrainedRenderer,
	dimensions func() (x, y, w, h int),
	stylesheet styling.Stylesheet,
	condition func() bool,
	titleString func() string,
	days func() []*model.Day,
	categories *styling.CategoryStyling,
	inputProcessor input.ModalInputProcessor,
) *SummaryPane

NewSummaryPane constructs and returns a new SummaryPane.

func (*SummaryPane) Dimensions

func (p *SummaryPane) Dimensions() (x, y, w, h int)

Dimensions gives the dimensions (x-axis offset, y-axis offset, width, height) for this pane. GetPositionInfo returns information on a requested position in this pane.

func (*SummaryPane) Draw

func (p *SummaryPane) Draw()

Draw draws the time summary view over top of all previously drawn contents, if it is currently active.

func (*SummaryPane) EnsureHidden

func (p *SummaryPane) EnsureHidden()

EnsureHidden informs the pane that it is not being shown so that it can take potential actions to ensure that, e.g., hide the terminal cursor, if necessary.

func (*SummaryPane) GetPositionInfo

func (p *SummaryPane) GetPositionInfo(x, y int) ui.PositionInfo

GetPositionInfo returns information on a requested position in this pane.

type TimelinePane

type TimelinePane struct {
	ui.LeafPane
	// contains filtered or unexported fields
}

TimelinePane can show a timeline, optionally with various embellishments. If provided with a sun-time provider, it will display those suntimes in dark and light on the timeline. If allowed to get a current time, it will highlight the current time.

func NewTimelinePane

func NewTimelinePane(
	renderer ui.ConstrainedRenderer,
	dimensions func() (x, y, w, h int),
	stylesheet styling.Stylesheet,
	suntimes func() *model.SunTimes,
	currentTime func() *model.Timestamp,
	viewParams ui.TimespanViewParams,
) *TimelinePane

NewTimelinePane constructs and returns a new TimelinePane.

func (*TimelinePane) Draw

func (p *TimelinePane) Draw()

Draw draws this pane.

func (*TimelinePane) GetPositionInfo

func (p *TimelinePane) GetPositionInfo(x, y int) ui.PositionInfo

GetPositionInfo returns information on a requested position in this pane.

type ToolsPane

type ToolsPane struct {
	ui.LeafPane
	// contains filtered or unexported fields
}

ToolsPane shows tools for editing. Currently it only offers a selection of categories to select from.

func NewToolsPane

func NewToolsPane(
	renderer ui.ConstrainedRenderer,
	dimensions func() (x, y, w, h int),
	stylesheet styling.Stylesheet,
	inputProcessor input.ModalInputProcessor,
	currentCategory *model.Category,
	categories *styling.CategoryStyling,
	horizPadding int,
	vertPadding int,
	gap int,
	visible func() bool,
) *ToolsPane

NewToolsPane constructs and returns a new ToolsPane.

func (*ToolsPane) Dimensions

func (p *ToolsPane) Dimensions() (x, y, w, h int)

Dimensions gives the dimensions (x-axis offset, y-axis offset, width, height) for this pane. GetPositionInfo returns information on a requested position in this pane.

func (*ToolsPane) Draw

func (p *ToolsPane) Draw()

Draw draws this pane.

func (*ToolsPane) GetPositionInfo

func (p *ToolsPane) GetPositionInfo(x, y int) ui.PositionInfo

GetPositionInfo returns information on a requested position in this pane.

type WeatherPane

type WeatherPane struct {
	ui.LeafPane
	// contains filtered or unexported fields
}

WeatherPane shows a timeline of hourly weather information blocks at a timescale that can be in line with an similarly positioned TimelinePane.

func NewWeatherPane

func NewWeatherPane(
	renderer ui.ConstrainedRenderer,
	dimensions func() (x, y, w, h int),
	stylesheet styling.Stylesheet,
	currentDate *model.Date,
	weather *weather.Handler,
	viewParams ui.TimespanViewParams,
) *WeatherPane

NewWeatherPane constructs and returns a new WeatherPane.

func (*WeatherPane) Dimensions

func (p *WeatherPane) Dimensions() (x, y, w, h int)

Dimensions gives the dimensions (x-axis offset, y-axis offset, width, height) for this pane. GetPositionInfo returns information on a requested position in this pane.

func (*WeatherPane) Draw

func (p *WeatherPane) Draw()

Draw draws this pane.

func (*WeatherPane) GetPositionInfo

func (p *WeatherPane) GetPositionInfo(x, y int) ui.PositionInfo

GetPositionInfo returns information on a requested position in this pane.

Jump to

Keyboard shortcuts

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