Skip to content

DIWNE::Style

Interface for DIWNE style variables. More...

#include "DIWNE/Core/Style/Style.h"

Inherited by DIWNE::StyleBase, DIWNE::StyleOverride

Public Types

Name
enum shortVar { GRID_COLOR = 0, GRID_DOTS_COLOR, NODE_BG, NODE_HEADER_BG, NODE_FG, NODE_HEADER_FG, NODE_ROUNDING, NODE_PADDING, MOUSE_DRAG_THRESHOLD, SELECTION_ROUNDING, SELECTED_BORDER_WIDTH, SELECTED_BORDER_COLOR, HOVER_BORDER_WIDTH, HOVER_BORDER_COLOR, LINK_COLOR, LINK_COLOR_SELECTED, LINK_UNPLUGGED_ALPHA, LINK_WIDTH, LINK_SELECTED_WIDTH, LINK_BORDER_WIDTH, LINK_BORDER_COLOR, PIN_SPACING, PIN_LABEL_SPACING, PIN_ENABLE_DRAG_LABEL, PIN_ENABLE_HOVER_BG, PIN_BG_SPACING, PIN_BG_COLOR, PIN_BG_ROUNDING, PIN_HOVER_COLOR_SHIFT, PIN_DRAG_ASSIST_RADIUS, PIN_SOCKET_OFFSET, PIN_SOCKET_BORDER_WIDTH, PIN_SOCKET_BORDER_COLOR, PIN_SOCKET_BORDER_ROUNDING, PIN_SOCKET_BG, PIN_SOCKET_THICKNESS, PIN_SOCKET_CONNECTED_GAP, PIN_SOCKET_ROUNDING, PIN_SOCKET_INNER_ROUNDING, PIN_SQUARE_OFFSET, PIN_SQUARE_BORDER_WIDTH, PIN_SQUARE_BORDER_COLOR, PIN_SQUARE_ROUNDING, PIN_SQUARE_HOVER_ENLARGE, PIN_CIRCLE_OFFSET, PIN_CIRCLE_BORDER_WIDTH, PIN_CIRCLE_BORDER_COLOR, PIN_DIM_ENABLED, PIN_DIM_ALPHA, SELECTION_RECT_FULL_COLOR, SELECTION_RECT_TOUCH_COLOR, SELECTION_RECT_ALPHA, DROP_ZONE_BG, DROP_INDICATOR_COLOR, DROP_ZONE_DROP_GAP, DROP_ZONE_MARGIN, STYLE_VAR_COUNT}<br>Style variables keys enum, they can be accessed by the get(key) method.

Public Functions

Name
virtual~Style() =default
virtual boolboolean(Style::Var key) const =0
virtual const ImVec4 &color(Style::Var key) const =0
virtual floatdecimal(Style::Var key) const =0
virtual intinteger(Style::Var key) const =0
virtual ImVec2size(Style::Var key) const =0

Detailed Description

cpp
class DIWNE::Style;
class DIWNE::Style;

Interface for DIWNE style variables.

Default style is defined in the StyleBase subclass, that is held by NodeEditor instances. Other DiwneObjects then hold a reference to a StyleOverride object that can override variables in the base style. The style variables can be accessed from every DiwneObject using its style() method, which returns this general interface, implemented by either StyleBase or StyleOverride.

Public Types Documentation

enum Var

EnumeratorValueDescription
GRID_COLOR0
GRID_DOTS_COLOR
NODE_BG
NODE_HEADER_BG
NODE_FG
NODE_HEADER_FG
NODE_ROUNDING
NODE_PADDING
MOUSE_DRAG_THRESHOLD
SELECTION_ROUNDING
SELECTED_BORDER_WIDTH
SELECTED_BORDER_COLOR
HOVER_BORDER_WIDTH
HOVER_BORDER_COLOR
LINK_COLOR
LINK_COLOR_SELECTED
LINK_UNPLUGGED_ALPHA
LINK_WIDTH
LINK_SELECTED_WIDTH
LINK_BORDER_WIDTH
LINK_BORDER_COLOR
PIN_SPACING
PIN_LABEL_SPACING
PIN_ENABLE_DRAG_LABEL
PIN_ENABLE_HOVER_BG
PIN_BG_SPACING
PIN_BG_COLOR
PIN_BG_ROUNDING
PIN_HOVER_COLOR_SHIFT
PIN_DRAG_ASSIST_RADIUS
PIN_SOCKET_OFFSET
PIN_SOCKET_BORDER_WIDTH
PIN_SOCKET_BORDER_COLOR
PIN_SOCKET_BORDER_ROUNDING
PIN_SOCKET_BG
PIN_SOCKET_THICKNESS
PIN_SOCKET_CONNECTED_GAP
PIN_SOCKET_ROUNDING
PIN_SOCKET_INNER_ROUNDING
PIN_SQUARE_OFFSET
PIN_SQUARE_BORDER_WIDTH
PIN_SQUARE_BORDER_COLOR
PIN_SQUARE_ROUNDING
PIN_SQUARE_HOVER_ENLARGE
PIN_CIRCLE_OFFSET
PIN_CIRCLE_BORDER_WIDTH
PIN_CIRCLE_BORDER_COLOR
PIN_DIM_ENABLED
PIN_DIM_ALPHA
SELECTION_RECT_FULL_COLOR
SELECTION_RECT_TOUCH_COLOR
SELECTION_RECT_ALPHA
DROP_ZONE_BG
DROP_INDICATOR_COLOR
DROP_ZONE_DROP_GAP
DROP_ZONE_MARGIN
STYLE_VAR_COUNT

Style variables keys enum, they can be accessed by the get(key) method.

The key is one of the enum values. Real style values are kept in a std::vector registry that is accessed by the key index

Public Functions Documentation

function ~Style

cpp
virtual ~Style() =default
virtual ~Style() =default

function boolean

cpp
virtual bool boolean(
    Style::Var key
) const =0
virtual bool boolean(
    Style::Var key
) const =0

Reimplemented by: DIWNE::StyleBase::boolean, DIWNE::StyleOverride::boolean

function color

cpp
virtual const ImVec4 & color(
    Style::Var key
) const =0
virtual const ImVec4 & color(
    Style::Var key
) const =0

Reimplemented by: DIWNE::StyleBase::color, DIWNE::StyleOverride::color

function decimal

cpp
virtual float decimal(
    Style::Var key
) const =0
virtual float decimal(
    Style::Var key
) const =0

Reimplemented by: DIWNE::StyleBase::decimal, DIWNE::StyleOverride::decimal

function integer

cpp
virtual int integer(
    Style::Var key
) const =0
virtual int integer(
    Style::Var key
) const =0

Reimplemented by: DIWNE::StyleBase::integer, DIWNE::StyleOverride::integer

function size

cpp
virtual ImVec2 size(
    Style::Var key
) const =0
virtual ImVec2 size(
    Style::Var key
) const =0

Reimplemented by: DIWNE::StyleBase::size, DIWNE::StyleOverride::size


Updated on 2025-05-31 at 12:55:31 +0000