Blender V4.3
interface_button_sections.cc File Reference
#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< rctibutton_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)
 

Detailed Description

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.

Function Documentation

◆ button_section_bounds_calc()

◆ ui_draw_button_sections_alignment_separator()

◆ ui_draw_button_sections_background()

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

◆ 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.

Note
This currently only works well for horizontal, header like regions.

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().

◆ UI_region_button_sections_is_inside_x()

bool UI_region_button_sections_is_inside_x ( const ARegion * region,
const int mval_x )