|
Blender V5.0
|
#include "BLI_listbase.h"#include "BLI_math_vector_types.hh"#include "BLI_rect.h"#include "BLI_span.hh"#include "BLI_vector.hh"#include "BKE_screen.hh"#include "DNA_screen_types.h"#include "GPU_immediate.hh"#include "GPU_state.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.
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 38 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, ARegion::runtime, SeprSpacer, ui_but_to_pixelrect(), UI_BUTTON_SECTION_MERGE_DISTANCE, UI_SCALE_FAC, UI_style_get_dpi(), ARegion::winx, ARegion::winy, rcti::xmax, and rcti::xmin.
Referenced by UI_region_button_sections_draw(), and UI_region_button_sections_is_inside_x().
|
static |
Definition at line 169 of file interface_button_sections.cc.
References BLI_assert_unreachable, Bottom, GPU_blend(), GPU_BLEND_ALPHA, GPU_BLEND_NONE, GPU_SHADER_3D_UNIFORM_COLOR, GPU_vertformat_attr_add(), immBindBuiltinProgram(), immRectf(), 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(), ARegion::winx, and ARegion::winy.
Referenced by UI_region_button_sections_draw().
|
static |
Definition at line 124 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(), ARegion::winx, 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 (uiLayout::separator_spacer()). 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 220 of file interface_button_sections.cc.
References BLI_rctf_size_x(), BLI_rcti_size_x(), button_section_bounds_calc(), View2D::cur, View2D::mask, None, ui_draw_button_sections_alignment_separator(), ui_draw_button_sections_background(), UI_SCALE_FAC, and ARegion::v2d.
Referenced by ED_region_header_draw_with_button_sections().
| bool UI_region_button_sections_is_inside_x | ( | const ARegion * | region, |
| const int | mval_x ) |
Definition at line 242 of file interface_button_sections.cc.
References BLI_rcti_isect_x(), and button_section_bounds_calc().
Referenced by area_actionzone_refresh_xy().