|
Blender V4.3
|
#include "BLI_math_vector_types.hh"#include "BLI_span.hh"#include "BLI_vector.hh"#include "DNA_screen_types.h"#include "GPU_immediate.hh"#include "interface_intern.hh"Go to the source code of this file.
Functions | |
| static Vector< rcti > | button_section_bounds_calc (const ARegion *region, const bool add_padding) |
| static void | ui_draw_button_sections_background (const ARegion *region, const Span< rcti > section_bounds, const ThemeColorID colorid, const uiButtonSectionsAlign align, const float corner_radius) |
| static void | ui_draw_button_sections_alignment_separator (const ARegion *region, const Span< rcti > section_bounds, const ThemeColorID colorid, const uiButtonSectionsAlign align, const float corner_radius) |
| void | UI_region_button_sections_draw (const ARegion *region, const int colorid, const uiButtonSectionsAlign align) |
| bool | UI_region_button_sections_is_inside_x (const ARegion *region, const int mval_x) |
Calculating and drawing of bounding boxes for "button sections". That is, each group of buttons separated by a separator spacer button.
Definition in file interface_button_sections.cc.
|
static |
Calculate a bounding box for each section. Sections will be merged if they are closer than UI_BUTTON_SECTION_MERGE_DISTANCE.
If a section is closer than UI_BUTTON_SECTION_MERGE_DISTANCE to a region edge, it will be extended to the edge.
Definition at line 33 of file interface_button_sections.cc.
References blender::Vector< T, InlineBufferCapacity, Allocator >::append(), BLI_rcti_do_minmax_rcti(), BLI_rcti_init_minmax(), BLI_rcti_pad(), uiStyle::buttonspacex, ceil(), CLAMP_MAX, CLAMP_MIN, HEADER_PADDING_Y, blender::Vector< T, InlineBufferCapacity, Allocator >::is_empty(), blender::Vector< T, InlineBufferCapacity, Allocator >::last(), LISTBASE_FOREACH, RGN_DRAWING, UI_BTYPE_SEPR_SPACER, ui_but_to_pixelrect(), UI_BUTTON_SECTION_MERGE_DISTANCE, UI_SCALE_FAC, UI_style_get_dpi(), rcti::xmax, and rcti::xmin.
Referenced by UI_region_button_sections_draw(), and UI_region_button_sections_is_inside_x().
|
static |
Definition at line 164 of file interface_button_sections.cc.
References BLI_assert_unreachable, Bottom, GPU_blend(), GPU_BLEND_ALPHA, GPU_BLEND_NONE, GPU_COMP_I32, GPU_FETCH_INT_TO_FLOAT, GPU_SHADER_3D_UNIFORM_COLOR, GPU_vertformat_attr_add(), immBindBuiltinProgram(), immRecti(), immUnbindProgram(), immUniformColor4fv(), immVertexFormat(), pos, Top, UI_BUTTON_SECTION_SEPERATOR_LINE_WITH, UI_CNR_BOTTOM_LEFT, UI_CNR_BOTTOM_RIGHT, UI_CNR_TOP_LEFT, UI_CNR_TOP_RIGHT, UI_draw_roundbox_corner_set(), ui_draw_rounded_corners_inverted(), UI_GetThemeColor4fv(), and rcti::xmin.
Referenced by UI_region_button_sections_draw().
|
static |
Definition at line 119 of file interface_button_sections.cc.
References BLI_rctf_rcti_copy(), Bottom, None, Top, UI_BUTTON_SECTION_SEPERATOR_LINE_WITH, UI_CNR_ALL, UI_CNR_BOTTOM_LEFT, UI_CNR_BOTTOM_RIGHT, UI_CNR_TOP_LEFT, UI_CNR_TOP_RIGHT, UI_draw_roundbox_4fv(), UI_draw_roundbox_corner_set(), UI_GetThemeColor4fv(), rctf::ymax, and rctf::ymin.
Referenced by UI_region_button_sections_draw().
| void UI_region_button_sections_draw | ( | const ARegion * | region, |
| int | colorid, | ||
| uiButtonSectionsAlign | align ) |
Draw a background with rounded corners behind each visual group of buttons. The visual groups are separated by spacer buttons (uiItemSpacer()). Button groups that are closer than UI_BUTTON_SECTION_MERGE_DISTANCE will be merged into one visual section. If the group is closer than that to a region edge, it will also be extended to that, and the rounded corners will be removed on that edge.
Definition at line 215 of file interface_button_sections.cc.
References BLI_rctf_size_x(), BLI_rcti_size_x(), button_section_bounds_calc(), None, ui_draw_button_sections_alignment_separator(), ui_draw_button_sections_background(), and UI_SCALE_FAC.
Referenced by ED_region_header_draw_with_button_sections().
Definition at line 237 of file interface_button_sections.cc.
References BLI_rcti_isect_x(), and button_section_bounds_calc().
Referenced by area_actionzone_refresh_xy().