Documentation
¶
Index ¶
- Constants
- func AssertUnhollow(hollower interface{ ... })
- type Children
- func (c *Children) ForceIcons()
- func (c *Children) Init()
- func (c *Children) IsHollow() bool
- func (c *Children) LoadAll()
- func (c *Children) ParentBreadcrumb() traverse.Breadcrumber
- func (c *Children) Reset()
- func (c *Children) SetExpand(expand bool)
- func (c *Children) SetServers(servers []cchat.Server)
- func (c *Children) SetServersUnsafe(servers []cchat.Server)
- func (c *Children) UpdateServer(update cchat.ServerUpdate)
- func (c *Children) UpdateServerUnsafe(update cchat.ServerUpdate)
- type Controller
- type ParentController
- type ServerRow
- func (r *ServerRow) Breadcrumb() string
- func (r *ServerRow) GetActive() bool
- func (r *ServerRow) GetRevealChild() bool
- func (r *ServerRow) HasIcon() bool
- func (r *ServerRow) ID() cchat.ID
- func (r *ServerRow) Init()
- func (r *ServerRow) IsActiveServerMessage() bool
- func (r *ServerRow) IsHollow() bool
- func (r *ServerRow) Name() rich.LabelStateStorer
- func (r *ServerRow) ParentBreadcrumb() traverse.Breadcrumber
- func (r *ServerRow) Reset()
- func (r *ServerRow) SetDone()
- func (r *ServerRow) SetFailed(err error, retry func())
- func (r *ServerRow) SetHollowServerList(list cchat.Lister, ctrl Controller)
- func (r *ServerRow) SetLoading()
- func (r *ServerRow) SetRevealChild(reveal bool)
- func (r *ServerRow) SetSelected(selected bool)
- func (r *ServerRow) SetShowLabel(showLabel bool)
- func (r *ServerRow) SetUnread(unread, mentioned bool)
- func (r *ServerRow) SetUnreadUnsafe(unread, mentioned bool)
- func (r *ServerRow) UseEmptyIcon()
Constants ¶
const ChildrenMargin = 0 // refer to style.css
Variables ¶
This section is empty.
Functions ¶
func AssertUnhollow ¶
func AssertUnhollow(hollower interface{ IsHollow() bool })
Types ¶
type Children ¶
type Children struct { gtk.Box Controller Rows []*ServerRow Parent traverse.Breadcrumber // Unreadable state for children rows to use. The parent row that has this // Children will bind a handler to this. traverse.Unreadable // contains filtered or unexported fields }
Children is a children server with a reference to the parent. By default, a children will contain hollow rows. They are rows that do not yet have any widgets. This changes as soon as Row's Load is called.
func NewChildren ¶
func NewChildren(p traverse.Breadcrumber, ctrl Controller) *Children
NewChildren creates a hollow children then immediately unhollows it.
func NewHollowChildren ¶
func NewHollowChildren(p traverse.Breadcrumber, ctrl Controller) *Children
NewHollowChildren creates a hollow children, which is a children without any widgets.
func (*Children) ForceIcons ¶
func (c *Children) ForceIcons()
ForceIcons forces all of the children's row to show icons.
func (*Children) Init ¶
func (c *Children) Init()
Init ensures that the children container is not hollow. It does nothing after the first call. It does not actually populate the list with widgets. This is done for lazy loading. To load everything, call LoadAll after this.
Nothing but ServerRow should call this method.
func (*Children) LoadAll ¶
func (c *Children) LoadAll()
LoadAll forces all children rows to be unhollowed (initialized). It does NOT check if the children container itself is hollow.
func (*Children) ParentBreadcrumb ¶
func (c *Children) ParentBreadcrumb() traverse.Breadcrumber
func (*Children) Reset ¶
func (c *Children) Reset()
Reset ensures that the children container is no longer hollow, then reset all states.
func (*Children) SetExpand ¶
SetExpand sets whether or not to expand the margin and show the labels.
func (*Children) SetServers ¶
SetServers is reserved for cchat.ServersContainer.
func (*Children) SetServersUnsafe ¶
func (*Children) UpdateServer ¶
func (c *Children) UpdateServer(update cchat.ServerUpdate)
func (*Children) UpdateServerUnsafe ¶
func (c *Children) UpdateServerUnsafe(update cchat.ServerUpdate)
type Controller ¶
type Controller interface { ClearMessenger() MessengerSelected(*ServerRow) // SelectColumnatedLister is called when the user clicks a server lister // with its with Columnate method returning true. If lister is nil, then the // impl should clear it. SelectColumnatedLister(*ServerRow, cchat.Lister) }
type ParentController ¶
type ParentController interface { Controller ForceIcons() }
ParentController controls ServerRow's container, which is the Children struct.
type ServerRow ¶
type ServerRow struct { *gtk.Box Button *button.ToggleButton ActionsMenu *actions.Menu Server cchat.Server UnreadIndicator cchat.UnreadIndicator // contains filtered or unexported fields }
func NewHollowServer ¶
func NewHollowServer(p traverse.Breadcrumber, sv cchat.Server, ctrl ParentController) *ServerRow
NewHollowServer creates a new hollow ServerRow. It will automatically create hollow children containers and rows for the given server.
func (*ServerRow) Breadcrumb ¶
func (*ServerRow) GetRevealChild ¶
GetRevealChild returns whether or not the server list is expanded, or always false if there is no server list.
func (*ServerRow) Init ¶
func (r *ServerRow) Init()
Init brings the row out of the hollow state. It loads the children (if any), but this process does not make more widgets.
func (*ServerRow) IsActiveServerMessage ¶
IsActiveServerMessage returns true if the row is currently selected AND it is a message row.
func (*ServerRow) Name ¶
func (r *ServerRow) Name() rich.LabelStateStorer
Name returns the name state.
func (*ServerRow) ParentBreadcrumb ¶
func (r *ServerRow) ParentBreadcrumb() traverse.Breadcrumber
func (*ServerRow) Reset ¶
func (r *ServerRow) Reset()
Reset clears off all children servers. It's a no-op if there are none.
func (*ServerRow) SetDone ¶
func (r *ServerRow) SetDone()
SetDone is shared between the parent struct and the children list. This is because both will use the same SetFailed.
func (*ServerRow) SetFailed ¶
SetFailed is shared between the parent struct and the children list. This is because both of those errors share the same appearance, just different callbacks.
func (*ServerRow) SetHollowServerList ¶
func (r *ServerRow) SetHollowServerList(list cchat.Lister, ctrl Controller)
SetHollowServerList sets the row to a hollow server list (children) and recursively create
func (*ServerRow) SetLoading ¶
func (r *ServerRow) SetLoading()
SetLoading is called by the parent struct.
func (*ServerRow) SetRevealChild ¶
SetRevealChild reveals the list of servers. It does nothing if there are no servers, meaning if Row does not represent a ServerList.
func (*ServerRow) SetSelected ¶
SetSelected is used for highlighting the current message server.
func (*ServerRow) SetShowLabel ¶
SetShowLabel sets whether or not to show the button's (and its children's, if any)'s icons.
func (*ServerRow) SetUnreadUnsafe ¶
func (*ServerRow) UseEmptyIcon ¶
func (r *ServerRow) UseEmptyIcon()
UseEmptyIcon forces the row to show a placeholder icon.
Directories
¶
Path | Synopsis |
---|---|
Package traverse implements an extensible interface that allows children widgets to announce state changes to their parent container.
|
Package traverse implements an extensible interface that allows children widgets to announce state changes to their parent container. |