|
psychic-ui 0.0.0
|
#include <Div.hpp>
Classes | |
| struct | Exit |
| struct | LayoutSlide |
| struct | SlideWalk |
Public Member Functions | |
| Div (const Div &)=delete | |
| Div & | operator= (const Div &)=delete |
| Div (Div &&)=delete | |
| Div & | operator= (Div &&)=delete |
| std::string | toString () const |
| virtual Window * | window () |
| virtual const Window * | window () const |
| Div * | parent () |
| const Div * | parent () const |
| int | depth () const |
| unsigned int | childCount () const |
| const std::vector< std::shared_ptr< Div > > & | children () const |
| template<class T, class... Args> requires (std::derived_from<T, Div> && std::constructible_from<T, Args...>) | |
| T & | add (Args &&... args) |
| template<class T> requires std::derived_from<T, Div> | |
| T & | add (unsigned int index, std::shared_ptr< T > child) |
| template<class T> requires std::derived_from<T, Div> | |
| T & | add (std::shared_ptr< T > child) |
| void | remove (unsigned int index) |
| void | remove (const std::shared_ptr< Div > &child) |
| void | remove (const Div &child) |
| void | removeAll () |
| const Div * | at (unsigned int index) const |
| Div * | at (unsigned int index) |
| int | childIndex (const std::shared_ptr< Div > &child) const |
| int | childIndex (const Div *child) const |
| template<class Self> | |
| Self & | transition (this Self &self, Property property, const Timing &timing) |
| template<class Self> | |
| Self & | transition (this Self &self, std::initializer_list< Property > properties, const Timing &timing) |
| template<class Self> | |
| Self & | row (this Self &self) |
| template<class Self> | |
| Self & | column (this Self &self) |
| template<class Self> | |
| Self & | size (this Self &self, Length width, Length height) |
| template<class Self> | |
| Self & | style (this Self &self, const Style &style) |
| const Style & | style () const |
| const Style & | computedStyle () const |
| Style | targetStyle () const |
| bool | transitioning () const |
| bool | transitioning (Property property) const |
| void | animate (float from, float to, const Timing &timing, std::function< void(float)> update) |
| template<class Self> | |
| Self & | startingClass (this Self &self, detail::StringArg className) |
| const std::string & | startingClass () const |
| bool | starting () const |
| void | exit (const std::string &className, std::function< void()> done) |
| bool | exiting () const |
| void | cancelExit () |
| bool | subtreeTransitioning () const |
| float | layoutOffsetX () const |
| float | layoutOffsetY () const |
| bool | layoutSliding () const |
| bool | visible () const |
| bool | enabled () const |
| template<class Self> | |
| Self & | enabled (this Self &self, detail::BoolArg enabled) |
| virtual bool | active () const |
| bool | focusEnabled () const |
| template<class Self> | |
| Self & | focusEnabled (this Self &self, detail::BoolArg focusEnabled) |
| bool | hasFocus () const |
| virtual bool | takesEscape () const |
| void | setFocused (bool focused) |
| const std::string & | tooltip () const |
| template<class Self> | |
| Self & | tooltip (this Self &self, const std::string &text) |
| const std::vector< std::shared_ptr< MenuItem > > & | contextMenu () const |
| template<class Self> | |
| Self & | contextMenu (this Self &self, std::vector< std::shared_ptr< MenuItem > > items) |
| void | localToGlobal (int &gx, int &gy, int x=0, int y=0) const |
| void | globalToLocal (int &lx, int &ly, int x=0, int y=0) const |
| int | x () const |
| int | y () const |
| int | getWidth () const |
| int | getHeight () const |
| int | boundsLeft () const |
| int | boundsTop () const |
| int | boundsRight () const |
| int | boundsBottom () const |
| int | contentWidth () const |
| int | contentHeight () const |
| int | scrollX () const |
| template<class Self> | |
| Self & | scrollX (this Self &self, int scrollX) |
| int | scrollY () const |
| template<class Self> | |
| Self & | scrollY (this Self &self, int scrollY) |
| void | scroll (double scrollX, double scrollY) |
| bool | scrollBy (int deltaX, int deltaY) |
| void | scrollIntoView (const SkRect &rect) |
| StyleManager * | styleManager () const |
| void | setStyleManager (std::shared_ptr< StyleManager > styleManager) |
| void | updateStyle () |
| void | updateStyleRecursive () |
| void | updateDirtyStyles () |
| bool | styleDirty () const |
| const std::vector< std::string > & | tags () const |
| const std::string & | internalId () const |
| const std::string & | id () const |
| template<class Self> | |
| Self & | id (this Self &self, std::string id) |
| const std::unordered_set< std::string > & | classNames () const |
| template<class Self> | |
| Self & | classNames (this Self &self, const std::unordered_set< std::string > &classNames) |
| template<class Self> | |
| Self & | addClassName (this Self &self, std::string className) |
| template<class Self> | |
| Self & | removeClassName (this Self &self, std::string className) |
| virtual const PropertyMask & | inheritedProperties () const |
| bool | mouseChildren () const |
| template<class Self> | |
| Self & | mouseChildren (this Self &self, detail::BoolArg mouseChildren) |
| bool | mouseEnabled () const |
| template<class Self> | |
| Self & | mouseEnabled (this Self &self, detail::BoolArg mouseEnabled) |
| bool | mouseOver () const |
| void | setMouseOver (bool over) |
| bool | getMouseDown () const |
| void | setMouseDown (bool down) |
| bool | contains (float x, float y) const |
| bool | boundsContains (float x, float y) const |
| virtual MouseEventStatus | handleMouseMove (const MouseEvent &event, bool handled) |
| virtual bool | handleMouseExit (const MouseEvent &event) |
| virtual MouseEventStatus | handleMouseButtonChange (const MouseEvent &event) |
| virtual MouseEventStatus | handleMousePress (const MouseEvent &event) |
| virtual MouseEventStatus | handleMouseRelease (const MouseEvent &event) |
| virtual MouseEventStatus | handleClick (const MouseEvent &event) |
| virtual MouseEventStatus | handleDoubleClick (const MouseEvent &event) |
| virtual MouseEventStatus | handleMouseScroll (const MouseEvent &event) |
| virtual MouseEventStatus | handleContextMenuRequest (const MouseEvent &event) |
| MouseEvent | mouseEventAtCenter () |
| MouseEvent | localMouseEvent (const MouseEvent &event) const |
| Public Member Functions inherited from psychic_ui::Observer | |
| Observer (const Observer &)=delete | |
| Observer & | operator= (const Observer &)=delete |
| Observer (Observer &&)=delete | |
| Observer & | operator= (Observer &&)=delete |
Public Attributes | |
| Signal< int, int > | scrolled {} |
| Signal< int, int > | resized {} |
| bool | dashed {false} |
| Signal< MouseEvent > | mouseButtonChanged {} |
| Signal< MouseEvent > | mousePressed {} |
| Signal< MouseEvent > | mouseReleased {} |
| Signal< MouseEvent > | mouseReleasedOutside {} |
| Signal< MouseEvent > | mouseMoved {} |
| Signal< MouseEvent > | mouseEntered {} |
| Signal< MouseEvent > | mouseExited {} |
| Signal< MouseEvent > | mouseScrolled {} |
| Signal< MouseEvent > | clicked {} |
| Signal< MouseEvent > | doubleClicked {} |
| Signal< MouseEvent > | contextMenuRequested {} |
| Signal< Key, Mod > | keyPressed {} |
| Signal< Key, Mod > | keyRepeated {} |
| Signal< Key, Mod > | keyReleased {} |
| Signal< icu::UnicodeString > | typed {} |
| Signal | focused {} |
| Signal | blurred {} |
Static Public Attributes | |
| static bool | debugLayout {false} |
Protected Member Functions | |
| void | updateContextMenu (std::vector< std::shared_ptr< MenuItem > > items) |
| void | setParent (Div *parent) |
| virtual void | added () |
| virtual void | removed () |
| virtual void | childAdded (Div &child) |
| virtual void | childRemoved (Div &child) |
| template<class T> requires std::derived_from<T, Div> | |
| T * | trackChild (std::vector< std::shared_ptr< T > > &list, Div &child) const |
| virtual void | addedToRender () |
| virtual void | removedFromRender () |
| std::vector< std::shared_ptr< Div > > | childrenTopmostFirst () const |
| void | invalidateEndChildrenStyle () |
| void | insertChild (unsigned int index, std::shared_ptr< Div > child) |
| void | updateEnabled (bool enabled) |
| void | updateId (std::string id) |
| void | updateClassNames (const std::unordered_set< std::string > &classNames) |
| void | updateClassName (std::string className, bool present) |
| void | scrollTo (int scrollX, int scrollY) |
| virtual void | enabledChanged () |
| template<class Self> | |
| Self & | tag (this Self &self, std::string tag) |
| void | addTag (std::string tag) |
| void | updateLayoutSlides (const SlideWalk &walk) |
| void | updateSlidingClass () |
| void | releaseStartingClass () |
| void | finishExit () |
| void | updateTransitions (Style &computed) |
| bool | advanceTransitions (std::chrono::nanoseconds now) |
| void | finishTransitions () |
| void | cancelTransitions () |
| void | transitionsChanged (const PropertyMask &changed) |
| void | invalidateStyle () |
| void | updateRuntimeStyles () |
| virtual void | createStyles () |
| virtual void | styleUpdated () |
| void | setMeasurable () |
| void | updateLayout (const PropertyMask &changed) |
| virtual void | layoutUpdated () |
| void | invalidate () |
| bool | isValid () const |
| virtual Size | measure (Constraint width, Constraint height) |
| virtual void | render (SkCanvas *canvas) |
| void | clip (SkCanvas *canvas) |
| virtual void | draw (SkCanvas *canvas) |
| void | drawShadow (SkCanvas *canvas) |
| void | drawDotGrid (SkCanvas *canvas) |
| void | drawOutline (SkCanvas *canvas) |
| Protected Member Functions inherited from psychic_ui::Observer | |
| template<class... T, class F> | |
| std::shared_ptr< Slot< T... > > | subscribeTo (Signal< T... > &signal, F &&callback) |
Static Protected Member Functions | |
| template<class T> requires std::derived_from<T, Div> | |
| static T * | untrackChild (std::vector< std::shared_ptr< T > > &list, const Div &child) |
Protected Attributes | |
| std::string | _tooltip {} |
| std::vector< std::shared_ptr< MenuItem > > | _contextMenu {} |
| ScopedSlot | _contextMenuSlot {} |
| bool | _enabled {true} |
| bool | _visible {true} |
| int | _x {0} |
| int | _y {0} |
| int | _width {0} |
| int | _height {0} |
| int | _boundsLeft {0} |
| int | _boundsTop {0} |
| int | _boundsRight {0} |
| int | _boundsBottom {0} |
| bool | _focusEnabled {false} |
| bool | _focused {false} |
| int | _depth {0} |
| Div * | _parent {nullptr} |
| std::vector< std::shared_ptr< Div > > | _children {} |
| std::vector< std::string > | _tags {} |
| std::string | _internalId {} |
| std::string | _id {} |
| std::unordered_set< std::string > | _classNames {} |
| std::shared_ptr< StyleManager > | _styleManager {nullptr} |
| Style | _defaultStyle |
| Style | _inlineStyle |
| Style | _computedStyle {} |
| bool | _layoutInitialized {false} |
| bool | _styleDirty {true} |
| bool | _descendantStyleDirty {false} |
| Window * | _styledIn {nullptr} |
| std::size_t | _styledGeneration {0} |
| std::shared_ptr< detail::StyleTransitions > | _transitions {} |
| std::vector< std::shared_ptr< Animation > > | _animations {} |
| std::string | _startingClass {} |
| bool | _startingApplied {false} |
| std::unique_ptr< Exit > | _exit {} |
| std::unique_ptr< LayoutSlide > | _layoutSlide {} |
| YGNode * | _yogaNode {nullptr} |
| SkRect | _rect {} |
| SkRect | _marginRect {} |
| float | _marginLeft {0.0f} |
| float | _marginRight {0.0f} |
| float | _marginTop {0.0f} |
| float | _marginBottom {0.0f} |
| SkRect | _paddedRect {} |
| SkRRect | _roundRect {} |
| SkRect | _boundsRect {} |
| float | _paintOutset {0.0f} |
| bool | _ignoreInternalLayoutContraints {false} |
| bool | layoutReady {false} |
| bool | _drawBackground {false} |
| bool | _drawBorder {false} |
| bool | _drawComplexBorders {false} |
| bool | _drawRoundRect {false} |
| bool | _drawComplexRoundRect {false} |
| float | _radiusTopLeft {0.0f} |
| float | _radiusTopRight {0.0f} |
| float | _radiusBottomLeft {0.0f} |
| float | _radiusBottomRight {0.0f} |
| std::array< SkVector, 4 > | _radii {} |
| float | _borderLeft {0.0f} |
| float | _borderRight {0.0f} |
| float | _borderTop {0.0f} |
| float | _borderBottom {0.0f} |
| int | _scrollX {0} |
| int | _scrollY {0} |
| bool | _mouseEnabled {true} |
| bool | _mouseChildren {true} |
| bool | _mouseOver {false} |
| bool | _mouseDown {false} |
| Protected Attributes inherited from psychic_ui::Observer | |
| std::vector< ScopedSlot > | slots {} |
Static Protected Attributes | |
| static int | idCounter = 0 |
Friends | |
| class | StyleManager |
| class | Window |
| class | detail::StyleTransitions |
The Div class is the main object used to display content in Psychic UI. It has a similar role as a div in html: its purpose is to offer a rectangular container than can be used in a layout and styled using a stylesheet.
|
delete |
Just as a safety for now, delete the copy constructor because I don't see a reason why we would need it.
|
inline |
Construct a child of type T and add it last. The parent owns the child:
auto &row = add<Div>().row().gap(12);
row.add<Button>("Save").onClick([this] { save(); });
|
inline |
Add an existing child last (moved there if it is one already)
|
inline |
Add an existing child at index (in document order), at most childCount(): std::out_of_range past it, std::invalid_argument for no child. A child that has a parent leaves it first (this one too: the index is then among the other children), as the DOM moves a node.
|
protectedvirtual |
Reimplemented in psychic_ui::TreeNode.
|
protected |
Put the transitions' values at now in the computed style
| void psychic_ui::Div::animate | ( | float | from, |
| float | to, | ||
| const Timing & | timing, | ||
| std::function< void(float)> | update ) |
Move a number from from to to with a timing, calling update with each value (in Window::updateAnimations, once per frame, the last time with to). Fire and forget: it ends with this div, or when it gets there. At once when the div isn't in a window or the window reduces motion.
div.animate(0.0f, 1.0f, Timing{150ms, Ease::Out}, [this](float t) { _reveal = t; });
| Div * psychic_ui::Div::at | ( | unsigned int | index | ) |
Get the child at index, in document order (0 is the first child, drawn at the back)
| index | Index of the child to retrieve, < childCount() (std::out_of_range otherwise) |
| const Div * psychic_ui::Div::at | ( | unsigned int | index | ) | const |
Get the child at index, in document order (0 is the first child, drawn at the back)
| index | Index of the child to retrieve, < childCount() (std::out_of_range otherwise) |
| void psychic_ui::Div::cancelExit | ( | ) |
Stay after all: lose the exit's class (its transitions head back) and give the mouse back; done won't run
|
protected |
Drop the transitions, leaving the computed style where they were (removed from the window)
|
protectedvirtual |
A child joined this div, by any path (add, or moved here from another parent): it is in the children, its parent is this one and its added() ran, before its first style. For a div that keeps a typed list of some of its children (the overlay's popups, the toast stack's toasts), so that the children owe it nothing.
Reimplemented in psychic_ui::Overlay, and psychic_ui::ToastStack.
| unsigned int psychic_ui::Div::childCount | ( | ) | const |
Get the Div's number of children
| int psychic_ui::Div::childIndex | ( | const Div * | child | ) | const |
Get the index of a child by pointer, in document order
| child | Pointer to a child |
| int psychic_ui::Div::childIndex | ( | const std::shared_ptr< Div > & | child | ) | const |
Get the index of a child by shared pointer, in document order
| child | Shared pointer to a child |
|
protectedvirtual |
A child left this div, by any path (remove, removeAll, added to another parent): it is out of the children and its removed() ran, before the focus it had moves (its parent() still answers this one until the call returns). The counterpart of childAdded.
Reimplemented in psychic_ui::Overlay, and psychic_ui::ToastStack.
| const std::vector< std::shared_ptr< Div > > & psychic_ui::Div::children | ( | ) | const |
The children, in document order. Don't add or remove children while iterating over it.
|
protected |
Copy of the children, topmost (last) first, for dispatching mouse events. A copy so that handlers can add or remove children while we iterate.
|
inline |
Replace the class names, matched by .class selectors (case insensitive)
|
inline |
Lay the children out in a column, shortcut for direction(Direction::Column)
| const Style & psychic_ui::Div::computedStyle | ( | ) | const |
The computed style: what the stylesheets, the parent and the inline and default styles give this div, as of the last style pass, with its running transitions' values: what it paints with and pushes to Yoga. While a property transitions it holds the blend, updated every frame (and styleUpdated runs again); targetStyle() has where it goes.
|
inline |
The menu the div opens where a context menu is asked for on it (contextMenuRequested: a right press, a touch long press, the Menu key or Shift+F10 while it or a descendant has the focus), unless a descendant opens its own; empty for none. From the keyboard, the menu starts at its first item.
|
inlineprotectedvirtual |
Create runtime styles This is called by updateRuntimeStyles and has to be overridden by div's that want to add rules to the stylesheet. It will be called during the app's lifetime when adding to render list or if a stylesheet is loaded.
| int psychic_ui::Div::depth | ( | ) | const |
|
protectedvirtual |
Reimplemented in psychic_ui::CheckBoxSkinBase, and psychic_ui::Shape.
|
protected |
The shadow* and outline* styles, around the border box: every div paints them, whatever its draw
|
inline |
Enable or disable the div (:disabled in stylesheets). Subclasses react in enabledChanged().
|
inlineprotectedvirtual |
Called when enabled(bool) changes the enabled state
Reimplemented in psychic_ui::NumberStepper, and psychic_ui::TextFieldBase.
| void psychic_ui::Div::exit | ( | const std::string & | className, |
| std::function< void()> | done ) |
Leave with transitions: give it className, whose rules say where its transitions go (a popup's exiting), take the mouse from it and its descendants, and call done (which removes it) once neither it nor a descendant transitions any more, after the style pass that follows (Window::updateStylesAndLayout). At once when it isn't in a window, was never painted (starting()) or the window reduces motion. A no-op while it exits. Leaving the window ends it without calling done.
|
inline |
Whether it is leaving (exit)
|
protected |
The exit is over (nothing of it transitions): undo it and call done
|
inline |
Whether the div can take the focus (:focus in stylesheets)
|
virtual |
Reimplemented in psychic_ui::Window.
|
virtual |
Reimplemented in psychic_ui::Window.
|
virtual |
Reimplemented in psychic_ui::NumberStepper.
|
inline |
Set the id, matched by #id selectors (case insensitive)
|
virtual |
The properties this div takes from its parent's computed style when no rule sets them
Reimplemented in psychic_ui::internal::SkinBase.
|
protected |
Insert a child in both the children and the Yoga node, then parent it (which styles it)
|
protected |
Invalidate the style of the first and last children, whose :first-child/:last-child state changes when children are added or removed
|
protected |
Invalidate the style
| float psychic_ui::Div::layoutOffsetX | ( | ) | const |
Where it is painted from where its layout puts it, as it slides there: a layout transition, its parent's layoutTransition (FLIP). After a layout that moved it in the window, scrolling aside, it is painted from where it was (from where it was painted, when it was sliding already) and the offset goes to 0 with that timing; Yoga runs once. Composed with its translateX/translateY, painting only (hit testing finds it at its layout place). Nothing slides on its first layout in that container (an added child appears in place, and so does one shown again), on a window resize, with new rules (a theme, a density, a skin set) or with reduced motion. Its size doesn't animate.
| bool psychic_ui::Div::layoutSliding | ( | ) | const |
Whether it slides to its layout place (layoutOffsetX/Y aren't 0). It has the sliding class meanwhile (styled before the paint that starts it; its rules should only paint, a row's opaque background), and is painted after its siblings that don't slide.
|
protectedvirtual |
Callback for when layout was updated
Reimplemented in psychic_ui::Text, and psychic_ui::TextFieldBase.
| MouseEvent psychic_ui::Div::localMouseEvent | ( | const MouseEvent & | event | ) | const |
The event moved from the parent's content coordinates into this div's
|
protectedvirtual |
The size of a measurable div's content (see setMeasurable), within what the layout offers in each dimension. Must be pure: the layout caches it and calls it with various constraints.
Reimplemented in psychic_ui::Icon, and psychic_ui::Text.
|
inline |
Whether the children get mouse events (this div still does)
|
inline |
Whether this div gets mouse events; they pass through it when not (see mouseChildren for its children)
| MouseEvent psychic_ui::Div::mouseEventAtCenter | ( | ) |
An event at this div's center, for what the keyboard does in place of the mouse (a click by Enter, a context menu by the Menu key): no button (set the one it stands for), clickCount 0, the window's input mode as source
|
delete |
Just as a safety for now, delete the copy constructor because I don't see a reason why we would need it.
| Div * psychic_ui::Div::parent | ( | ) |
If the div is included in a parent, returns a pointer to that parent
| const Div * psychic_ui::Div::parent | ( | ) | const |
If the div is included in a parent, returns a const pointer to that parent
|
protected |
Lose the starting class (the window lets it go): its next style transitions from it
| void psychic_ui::Div::remove | ( | const std::shared_ptr< Div > & | child | ) |
Remove a child, does nothing if it isn't one (nullptr included)
| void psychic_ui::Div::remove | ( | unsigned int | index | ) |
Remove a child by index
| index | Index of the child to remove, < childCount() (std::out_of_range otherwise) |
| void psychic_ui::Div::removeAll | ( | ) |
Remove all children
|
inline |
Lay the children out in a row, shortcut for direction(Direction::Row)
| bool psychic_ui::Div::scrollBy | ( | int | deltaX, |
| int | deltaY ) |
Scroll by a number of window units, within the content (touch panning)
| void psychic_ui::Div::scrollIntoView | ( | const SkRect & | rect | ) |
Scroll the nearest scrolling ancestor (overflow: scroll) vertically, just enough for a rectangle of this div to show; to its start when only what is above the rectangle there would be left out (a border, a header, a padding)
| rect | In this div's coordinates (from its top-left corner, plus its scroll offset, as localToGlobal) |
| void psychic_ui::Div::setFocused | ( | bool | focused | ) |
Used by the window, which manages the focus path
|
protected |
Sets the component as measurable Registers the measure callback
|
protected |
Set the parent of that div Used internally when adding/removing a child to/from a parent
| Div* | parent |
| void psychic_ui::Div::setStyleManager | ( | std::shared_ptr< StyleManager > | styleManager | ) |
Set the local style manager override
|
inline |
Shortcut for width(width).height(height)
| bool psychic_ui::Div::starting | ( | ) | const |
Whether it, or an ancestor, still has its starting class
|
inline |
A class it has for its first style in a window only (its first style after it is added), lost before its first paint, so that its transitions start from what that class's rules give it, as CSS's @starting-style: a popup's entering. Its descendants' first styles see it too. Until the window lets it go (Window::updateStylesAndLayout, after the layout and the popups' placement) nothing of it or its descendants transitions: it was never painted. Nothing starts that way with reduced motion.
| const Style & psychic_ui::Div::style | ( | ) | const |
The inline style, as set through the setters above
|
inline |
Overlay a whole style onto the inline style, for reusing a set of values:
const Style card = Style{}.padding(12).borderRadius(4).backgroundColor(rgb(0x202020));
add<Div>().style(card).grow(1);
| bool psychic_ui::Div::styleDirty | ( | ) | const |
Whether this node or one of its descendants needs its style computed
| StyleManager * psychic_ui::Div::styleManager | ( | ) | const |
Get the current style manager In order of importance, the local override, the parent's (until window) or the singleton
|
protectedvirtual |
Callback for when styles were updated
Reimplemented in psychic_ui::Component< T, Base >, psychic_ui::Component< AvatarSkin >, psychic_ui::Component< ButtonSkin >, psychic_ui::Component< CheckBoxSkin >, psychic_ui::Component< ColorSwatchesSkin >, psychic_ui::Component< MenuButtonSkin >, psychic_ui::Component< NumberStepperSkin, TextFieldBase >, psychic_ui::Component< RangeSkin >, psychic_ui::Component< ScrollBarSkin >, psychic_ui::Component< SearchFieldSkin, TextFieldBase >, psychic_ui::Component< SegmentedControlSkin >, psychic_ui::Component< SkinT, TextFieldBase >, psychic_ui::Component< SwitchSkin >, psychic_ui::Component< TextAreaSkin, TextFieldBase >, psychic_ui::Component< TextInputSkin, TextFieldBase >, psychic_ui::Icon, psychic_ui::PivotalAvatarSkin, psychic_ui::RangeSkinBase, psychic_ui::ScrollBarSkinBase, and psychic_ui::Text.
| bool psychic_ui::Div::subtreeTransitioning | ( | ) | const |
Whether it or a descendant transitions
|
inlineprotected |
Add a tag to the chain read by tags(): each class in the hierarchy adds its own, so selectors can match any of them. Obviously this should be static and/or use Reflection but in order to progress in other parts of the library it will stay local for the time being, until a better technique is implemented.
|
inlinevirtual |
Whether it has a use for Escape now, while it is on the focus path: then Escape goes to the keys' path instead of closing the topmost popup first (a search field with text clears it, a number stepper being edited reverts). None by default.
Reimplemented in psychic_ui::NumberStepper, and psychic_ui::SearchField.
| Style psychic_ui::Div::targetStyle | ( | ) | const |
The computed style with every running transition at its end: what computedStyle() will be once they are done. A copy.
|
inline |
A short text the window shows in a tooltip above the div (below when there's no room) after the mouse rests on it, or after a touch long press that opens nothing else; "" for none
| std::string psychic_ui::Div::toString | ( | ) | const |
Get a string representing this Div for debug purposes
|
inlineprotected |
From childAdded: put the child in list, the children that are a T in document order, if it is one
|
inline |
Add to the inline transition: these properties blend to their new values with this timing (see Transition)
div.transition(Property::backgroundColor, Timing{100ms});
| bool psychic_ui::Div::transitioning | ( | ) | const |
Whether a property of the computed style is blending to a new value
|
protected |
The transitions changed these computed values: push them to Yoga, run styleUpdated, restyle the children that inherit them
|
inlinestaticprotected |
From childRemoved: take the child out of list
| void psychic_ui::Div::updateDirtyStyles | ( | ) |
Compute style only where it was invalidated: nodes whose style is dirty and their descendants, reached through the _descendantStyleDirty flags, visible or not (hidden nodes still take part in layout). One pass: styles invalidated by a styleUpdated callback during the pass may be left dirty, check styleDirty() and run it again (Window::updateStylesAndLayout does).
|
protected |
Push the computed style's layout properties to the Yoga node, only those in changed. Paint-only properties never reach Yoga, so changing them doesn't dirty the layout. The layoutUpdated() method will be called after Yoga has computed the new layout
|
protected |
After a layout (Window::updateStylesAndLayout), down the tree: start, retarget or drop the layout slides
|
protected |
Update the runtime style rules
|
protected |
The sliding class while layoutSliding()
| void psychic_ui::Div::updateStyle | ( | ) |
Compute style for this component and push it to its Yoga node
| void psychic_ui::Div::updateStyleRecursive | ( | ) |
Compute style for this component and all its descendants, visible or not
|
protected |
Start, retarget or drop transitions for a new computed style, and put their current values in it
| bool psychic_ui::Div::visible | ( | ) | const |
Whether the div is painted and hit, from its computed visible style. Hidden divs are still laid out.
|
virtual |
If the div is included in a window, returns a pointer to that window
Reimplemented in psychic_ui::Window.
|
protected |
animate's, until they end
|
protected |
Bounds rect
|
protected |
Children in document order (same as Yoga): first is at the back, last is on top
|
protected |
Pseudo CSS class names
|
protected |
Computed Style Computed style values, use this to obtain the final style to be applied
|
protected |
Default Style Use this instead of the inline style when a component needs a specific default for it to work correctly For example, text components should not grow/shrink as they are inline, but yoga doesn't let us do that.
|
protected |
A descendant has a dirty style, so the style pass has to go through this node
|
protected |
Id
|
protected |
Ignore internal layout constraints (padding, border) Used by component to forward those to its skin
|
protected |
Inline Style Use the inline styles to set values that will override any stylesheet
|
protected |
Whether the computed style was pushed to the Yoga node once: until then every layout property is
|
protected |
Component's margin rect
|
protected |
Enables the mouse events for this div's children Events will still affect the current div See mouseEnabled for ignoring events on this div
|
protected |
Enable the mouse events for this div. Events will passthrough if disabled See mouseChildren for ignoring the children
|
protected |
Component's padded rect
|
protected |
How far the shadow and the outline paint outside the border box, for culling and the opacity layer
|
protected |
Component's rect
|
protected |
Round rect
|
protected |
startingClass, and whether it has it now (from its first style in a window until the window lets it go)
|
protected |
The window, and the style manager's rules generation, the style was last computed in: transitions only start from a style computed in the same window with the same rules, so neither a div's first style in a window nor a theme switch transitions
|
protected |
Dirty style flag
|
protected |
Style Manager Override
|
protected |
Chain of tags from the inheritance chain
|
protected |
The running style transitions, which the window ticks (made with the first one)
|
protected |
Yoga Node
| Signal<MouseEvent> psychic_ui::Div::contextMenuRequested {} |
Asks for a context menu here: a right button press (a touch long press is one), or the Menu key or Shift+F10 on the focused div (its center, clickCount 0). Goes to the deepest div with a subscriber.
|
staticprotected |
Internal Id