TachyonUI 0.1.0
High-performance UI for building tools.
Loading...
Searching...
No Matches
tachyon::Panel Struct Reference

A unit of docked UI content: a title, an optional icon, and the callback that builds it. More...

#include <gui_controls/gui_docking_types.h>

Classes

struct  Internal
 Kept by the docking; not part of the API. More...

Public Attributes

tachyon::ID id = tachyon::ID::Invalid()
 key in DockingLayout::panels
std::string title
 tab label
tachyon::IconID icon = tachyon::IconID::Invalid
 tab icon
std::string panelType
 Optional kind tag that presets serialize to pick a factory on load.
std::function< void()> onPanelGUI
 Builds the panel's content (inside the panel's area); not called while hidden.
std::function< std::optional< uint64_t >()> cacheSignature
 Docked panels are cached by default (rebuilt on resize and input inside them).
std::function< void()> onEnable
 Called when the panel becomes visible (its leaf's selected tab).
std::function< void()> onDisable
 Called when the panel is hidden.
struct tachyon::Panel::Internal internal
 not part of the API
tachyon::int2 scrollOffset { 0, 0 }
 Scroll position, kept here so a hidden tab keeps it (ScrollManagement prunes handles of elements not in the tree).

Detailed Description

A unit of docked UI content: a title, an optional icon, and the callback that builds it.

Member Data Documentation

◆ id

◆ title

std::string tachyon::Panel::title

tab label

◆ icon

tachyon::IconID tachyon::Panel::icon = tachyon::IconID::Invalid

tab icon

◆ panelType

std::string tachyon::Panel::panelType

Optional kind tag that presets serialize to pick a factory on load.

Empty for one-off panels.

◆ onPanelGUI

std::function<void()> tachyon::Panel::onPanelGUI

Builds the panel's content (inside the panel's area); not called while hidden.

◆ cacheSignature

std::function<std::optional<uint64_t>()> tachyon::Panel::cacheSignature

Docked panels are cached by default (rebuilt on resize and input inside them).

  • return a value -> also rebuild whenever it changes (data the cache can't observe);
  • return nullopt -> don't cache this frame (e.g. a live profiler).

◆ onEnable

std::function<void()> tachyon::Panel::onEnable

Called when the panel becomes visible (its leaf's selected tab).

◆ onDisable

std::function<void()> tachyon::Panel::onDisable

Called when the panel is hidden.

Hidden panels get no onPanelGUI and should release lazily created resources.

◆ internal

struct tachyon::Panel::Internal tachyon::Panel::internal

not part of the API

◆ scrollOffset

tachyon::int2 tachyon::Panel::scrollOffset { 0, 0 }

Scroll position, kept here so a hidden tab keeps it (ScrollManagement prunes handles of elements not in the tree).


The documentation for this struct was generated from the following file: