targethour

package
v0.5.4 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package targethour is targetlist's sibling for rows that need a prominent leading badge — an hour, a day, anything view.Item.LeadTop/Main/Bottom carries — instead of a plain label. Same selection/⋮-menu mechanics as targetlist, copied rather than shared: the two rows diverge enough in markup (the three-line badge has no targetlist equivalent) that factoring a common base would cost more indirection than the ~80 duplicated lines save. Both satisfy crudview.ListView (see layout/crudview), so a host picks whichever row shape fits its data without crudview knowing which one it got.

Index

Constants

View Source
const (
	PartRow        = widget.Part("row")
	PartContent    = widget.Part("content")
	PartOptions    = widget.Part("options")
	PartBadge      = widget.Part("badge")
	PartLabel      = widget.Part("label")
	PartList       = widget.Part("list")
	PartLead       = widget.Part("lead")
	PartLeadStack  = widget.Part("lead-stack")
	PartLeadTop    = widget.Part("lead-top")
	PartLeadMain   = widget.Part("lead-main")
	PartLeadBottom = widget.Part("lead-bottom")

	PartButton     = widget.Part("button")
	PartIcon       = widget.Part("icon")
	PartItemDanger = widget.Part("item-danger")
	PartItemIcon   = widget.Part("item-icon")
	PartItemLabel  = widget.Part("item-label")
)
View Source
const NameTargetHour = widget.Name("targethour")

NameTargetHour is the widget identity.

Variables

This section is empty.

Functions

This section is empty.

Types

type Item

type Item = view.Item

Item is view.Item — see targetlist.Item's comment for why this is an alias, not a copy. TargetHour is the one row that actually reads LeadTop/Main/Bottom.

type TargetHour

type TargetHour struct {
	Element

	Selected *SignalString

	OnSelect func(it Item)
	OnDelete func(id string)
	// contains filtered or unexported fields
}

TargetHour is a selectable list of records with a per-row options menu and a prominent leading badge (LeadTop/Main/Bottom) instead of a plain label lead-in. Same field/method surface as targetlist.TargetList on purpose — see crudview.ListView.

func (*TargetHour) CloseMenus

func (t *TargetHour) CloseMenus()

CloseMenus — see targetlist.TargetList.CloseMenus for why a host needs this.

func (*TargetHour) Count

func (t *TargetHour) Count() int

func (*TargetHour) IconSvg

func (t *TargetHour) IconSvg() *sprite.Sprite

IconSvg registers the ⋮ (vertical dots) options glyph and the trash can (Eliminar) — identical paths to targetlist's own, under a th- prefix so the two sprites never collide once ssr fuses every IconSvg() into one.

func (*TargetHour) Init

func (t *TargetHour) Init(_ Ctx)

func (*TargetHour) Items

func (t *TargetHour) Items() []Item

func (*TargetHour) Render

func (t *TargetHour) Render() *Element

func (*TargetHour) RenderCSS

func (t *TargetHour) RenderCSS() *css.Stylesheet

RenderCSS defines the targethour visual contract using the style DSL.

func (*TargetHour) SetItems

func (t *TargetHour) SetItems(items []Item)

SetItems replaces the visible rows — see targetlist.TargetList.SetItems.

func (*TargetHour) WidgetKind

func (t *TargetHour) WidgetKind() widget.Kind

func (*TargetHour) WidgetName

func (t *TargetHour) WidgetName() widget.Name

Jump to

Keyboard shortcuts

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