Cleanup: UI: Remove redundant namespace prefixes

A follow-up from recent UI refactors.

Pull Request: https://projects.blender.org/blender/blender/pulls/141920
This commit is contained in:
Guillermo Venegas
2025-07-21 15:08:12 +02:00
committed by Hans Goudey
parent 9404db8c7c
commit 230813f2ab
27 changed files with 150 additions and 159 deletions

View File

@@ -514,24 +514,24 @@ void region_layout(const bContext *C, ARegion *region)
return;
}
uiBlock *block = UI_block_begin(C, region, __func__, blender::ui::EmbossType::Emboss);
uiBlock *block = UI_block_begin(C, region, __func__, ui::EmbossType::Emboss);
const uiStyle *style = UI_style_get_dpi();
const int padding_y = main_region_padding_y();
const int padding_x = main_region_padding_x();
uiLayout &layout = blender::ui::block_layout(block,
blender::ui::LayoutDirection::Vertical,
blender::ui::LayoutType::Panel,
padding_x,
-padding_y,
region->winx - 2 * padding_x,
0,
0,
style);
uiLayout &layout = ui::block_layout(block,
ui::LayoutDirection::Vertical,
ui::LayoutType::Panel,
padding_x,
-padding_y,
region->winx - 2 * padding_x,
0,
0,
style);
build_asset_view(layout, active_shelf->settings.asset_library_reference, *active_shelf, *C);
int layout_height = blender::ui::block_layout_resolve(block).y;
int layout_height = ui::block_layout_resolve(block).y;
BLI_assert(layout_height <= 0);
UI_view2d_totRect_set(&region->v2d, region->winx - 1, layout_height - padding_y);
UI_view2d_curRect_validate(&region->v2d);
@@ -840,9 +840,9 @@ static void asset_shelf_header_draw(const bContext *C, Header *header)
list::storage_fetch(library_ref, C);
UI_block_emboss_set(block, blender::ui::EmbossType::None);
UI_block_emboss_set(block, ui::EmbossType::None);
layout->popover(C, "ASSETSHELF_PT_catalog_selector", "", ICON_COLLAPSEMENU);
UI_block_emboss_set(block, blender::ui::EmbossType::Emboss);
UI_block_emboss_set(block, ui::EmbossType::Emboss);
layout->separator();

View File

@@ -140,7 +140,7 @@ class AssetCatalogSelectorTree : public ui::AbstractTreeView {
AssetCatalogSelectorTree &tree = dynamic_cast<AssetCatalogSelectorTree &>(get_tree_view());
uiBlock *block = row.block();
row.emboss_set(blender::ui::EmbossType::Emboss);
row.emboss_set(ui::EmbossType::Emboss);
uiLayout *subrow = &row.row(false);
subrow->active_set(catalog_path_enabled_);

View File

@@ -55,11 +55,11 @@ void context_path_add_generic(Vector<ContextPathItem> &path,
void template_breadcrumbs(uiLayout &layout, Span<ContextPathItem> context_path)
{
uiLayout *row = &layout.row(true);
layout.alignment_set(blender::ui::LayoutAlign::Left);
layout.alignment_set(LayoutAlign::Left);
for (const int i : context_path.index_range()) {
uiLayout *sub_row = &row->row(true);
sub_row->alignment_set(blender::ui::LayoutAlign::Left);
sub_row->alignment_set(LayoutAlign::Left);
if (i > 0) {
sub_row->label("", ICON_RIGHTARROW_THIN);

View File

@@ -5448,7 +5448,7 @@ uiLayout &block_layout(uiBlock *block,
layout->active_ = true;
layout->enabled_ = true;
layout->context_ = nullptr;
layout->emboss_ = blender::ui::EmbossType::Undefined;
layout->emboss_ = EmbossType::Undefined;
if (ELEM(type, LayoutType::Menu, LayoutType::PieMenu)) {
layout->space_ = 0;

View File

@@ -110,7 +110,7 @@ class NodeSocketViewItem : public BasicTreeViewItem {
uiLayout *input_socket_layout = &row.row(true);
if (socket_.flag & NODE_INTERFACE_SOCKET_INPUT) {
/* XXX Socket template only draws in embossed layouts (Julian). */
input_socket_layout->emboss_set(blender::ui::EmbossType::Emboss);
input_socket_layout->emboss_set(EmbossType::Emboss);
/* Context is not used by the template function. */
uiTemplateNodeSocket(input_socket_layout, /*C*/ nullptr, socket_.socket_color());
}
@@ -124,7 +124,7 @@ class NodeSocketViewItem : public BasicTreeViewItem {
uiLayout *output_socket_layout = &row.row(true);
if (socket_.flag & NODE_INTERFACE_SOCKET_OUTPUT) {
/* XXX Socket template only draws in embossed layouts (Julian). */
output_socket_layout->emboss_set(blender::ui::EmbossType::Emboss);
output_socket_layout->emboss_set(EmbossType::Emboss);
/* Context is not used by the template function. */
uiTemplateNodeSocket(output_socket_layout, /*C*/ nullptr, socket_.socket_color());
}
@@ -198,7 +198,7 @@ class NodePanelViewItem : public BasicTreeViewItem {
if (toggle_ != nullptr) {
uiLayout *toggle_layout = &row.row(true);
/* XXX Socket template only draws in embossed layouts (Julian). */
toggle_layout->emboss_set(blender::ui::EmbossType::Emboss);
toggle_layout->emboss_set(EmbossType::Emboss);
/* Context is not used by the template function. */
uiTemplateNodeSocket(toggle_layout, /*C*/ nullptr, toggle_->socket_color());
}

View File

@@ -496,7 +496,7 @@ void PreviewGridItem::build_grid_tile_button(uiLayout &layout,
icon_id,
/* NOLINTNEXTLINE: bugprone-suspicious-enum-usage */
UI_HAS_ICON | UI_BUT_ICON_PREVIEW);
but->emboss = blender::ui::EmbossType::None;
but->emboss = EmbossType::None;
}
void PreviewGridItem::build_grid_tile(const bContext & /*C*/, uiLayout &layout) const

View File

@@ -532,11 +532,11 @@ void AbstractTreeViewItem::add_collapse_chevron(uiBlock &block) const
void AbstractTreeViewItem::add_rename_button(uiLayout &row)
{
uiBlock *block = row.block();
blender::ui::EmbossType previous_emboss = UI_block_emboss_get(block);
EmbossType previous_emboss = UI_block_emboss_get(block);
row.row(false);
/* Enable emboss for the text button. */
UI_block_emboss_set(block, blender::ui::EmbossType::Emboss);
UI_block_emboss_set(block, EmbossType::Emboss);
AbstractViewItem::add_rename_button(*block);
@@ -887,7 +887,7 @@ void TreeViewLayoutBuilder::build_row(AbstractTreeViewItem &item) const
return;
}
blender::ui::EmbossType previous_emboss = UI_block_emboss_get(&block_);
EmbossType previous_emboss = UI_block_emboss_get(&block_);
uiLayout *overlap = &prev_layout.overlap();
@@ -897,12 +897,12 @@ void TreeViewLayoutBuilder::build_row(AbstractTreeViewItem &item) const
uiLayout *row = &overlap->row(false);
/* Enable emboss for mouse hover highlight. */
row->emboss_set(blender::ui::EmbossType::Emboss);
row->emboss_set(EmbossType::Emboss);
/* Every item gets one! Other buttons can be overlapped on top. */
item.add_treerow_button(block_);
/* After adding tree-row button (would disable hover highlighting). */
UI_block_emboss_set(&block_, blender::ui::EmbossType::NoneOrStatus);
UI_block_emboss_set(&block_, EmbossType::NoneOrStatus);
/* Add little margin to align actual contents vertically. */
uiLayout *content_col = &overlap->column(true);

View File

@@ -1048,9 +1048,9 @@ static void node_file_output_socket_draw(bContext *C,
RNA_property_enum_name(
C, &imfptr, imtype_prop, RNA_property_enum_get(&imfptr, imtype_prop), &imtype_name);
block = row->block();
UI_block_emboss_set(block, blender::ui::EmbossType::Pulldown);
UI_block_emboss_set(block, ui::EmbossType::Pulldown);
row->label(imtype_name, ICON_NONE);
UI_block_emboss_set(block, blender::ui::EmbossType::None);
UI_block_emboss_set(block, ui::EmbossType::None);
}
}
@@ -1097,7 +1097,7 @@ static void draw_node_socket_name_editable(uiLayout *layout,
{
if (sock->runtime->declaration) {
if (sock->runtime->declaration->socket_name_rna) {
layout->emboss_set(blender::ui::EmbossType::None);
layout->emboss_set(ui::EmbossType::None);
layout->prop((&sock->runtime->declaration->socket_name_rna->owner),
sock->runtime->declaration->socket_name_rna->property_name,
UI_ITEM_NONE,
@@ -1166,7 +1166,7 @@ static void std_node_socket_draw(
if (has_gizmo) {
if (sock->in_out == SOCK_OUT && node->is_group_input()) {
uiLayout *row = &layout->row(false);
row->alignment_set(blender::ui::LayoutAlign::Right);
row->alignment_set(ui::LayoutAlign::Right);
node_socket_button_label(C, row, ptr, node_ptr, text);
row->label("", ICON_GIZMO);
return;

View File

@@ -429,7 +429,7 @@ static uiBlock *create_search_popup_block(bContext *C, ARegion *region, void *ar
{
LinkDragSearchStorage &storage = *(LinkDragSearchStorage *)arg_op;
uiBlock *block = UI_block_begin(C, region, "_popup", blender::ui::EmbossType::Emboss);
uiBlock *block = UI_block_begin(C, region, "_popup", ui::EmbossType::Emboss);
UI_block_flag_enable(block, UI_BLOCK_LOOP | UI_BLOCK_MOVEMOUSE_QUIT | UI_BLOCK_SEARCH_MENU);
UI_block_theme_style_set(block, UI_BLOCK_THEME_STYLE_POPUP);

View File

@@ -357,7 +357,7 @@ static Array<uiBlock *> node_uiblocks_init(const bContext &C, const Span<bNode *
const bNode &node = *nodes[i];
std::string block_name = "node_" + std::string(node.name);
uiBlock *block = UI_block_begin(
&C, scene, window, region, std::move(block_name), blender::ui::EmbossType::Emboss);
&C, scene, window, region, std::move(block_name), ui::EmbossType::Emboss);
blocks[node.index()] = block;
/* This cancels events for background nodes. */
UI_block_flag_enable(block, UI_BLOCK_CLIP_EVENTS);
@@ -418,15 +418,15 @@ static bool node_update_basis_buttons(const bContext &C,
dy -= NODE_DYS / 4;
uiLayout &layout = blender::ui::block_layout(&block,
blender::ui::LayoutDirection::Vertical,
blender::ui::LayoutType::Panel,
loc.x + NODE_DYS,
dy,
NODE_WIDTH(node) - NODE_DY,
0,
0,
UI_style_get_dpi());
uiLayout &layout = ui::block_layout(&block,
ui::LayoutDirection::Vertical,
ui::LayoutType::Panel,
loc.x + NODE_DYS,
dy,
NODE_WIDTH(node) - NODE_DY,
0,
0,
UI_style_get_dpi());
if (node.is_muted()) {
layout.active_set(false);
@@ -437,7 +437,7 @@ static bool node_update_basis_buttons(const bContext &C,
draw_buttons(&layout, (bContext *)&C, &nodeptr);
UI_block_align_end(&block);
const int buty = blender::ui::block_layout_resolve(&block).y;
const int buty = ui::block_layout_resolve(&block).y;
dy = buty - NODE_DYS / 4;
return true;
@@ -500,15 +500,15 @@ static bool node_update_basis_socket(const bContext &C,
0.0f;
locy -= multi_input_socket_offset * 0.5f;
uiLayout &layout = blender::ui::block_layout(&block,
blender::ui::LayoutDirection::Vertical,
blender::ui::LayoutType::Panel,
locx + NODE_DYS,
locy,
NODE_WIDTH(node) - NODE_DY,
NODE_DY,
0,
UI_style_get_dpi());
uiLayout &layout = ui::block_layout(&block,
ui::LayoutDirection::Vertical,
ui::LayoutType::Panel,
locx + NODE_DYS,
locy,
NODE_WIDTH(node) - NODE_DY,
NODE_DY,
0,
UI_style_get_dpi());
if (node.is_muted()) {
layout.active_set(false);
@@ -523,7 +523,7 @@ static bool node_update_basis_socket(const bContext &C,
PointerRNA sockptr = RNA_pointer_create_discrete(&ntree.id, &RNA_NodeSocket, input_socket);
row->context_ptr_set("socket", &sockptr);
row->alignment_set(blender::ui::LayoutAlign::Expand);
row->alignment_set(ui::LayoutAlign::Expand);
input_socket->typeinfo->draw(
(bContext *)&C, row, &sockptr, &nodeptr, node_socket_get_label(input_socket, panel_label));
@@ -534,7 +534,7 @@ static bool node_update_basis_socket(const bContext &C,
row->context_ptr_set("socket", &sockptr);
/* Align output buttons to the right. */
row->alignment_set(blender::ui::LayoutAlign::Right);
row->alignment_set(ui::LayoutAlign::Right);
output_socket->typeinfo->draw((bContext *)&C,
row,
@@ -557,7 +557,7 @@ static bool node_update_basis_socket(const bContext &C,
UI_block_align_end(&block);
int buty = blender::ui::block_layout_resolve(&block).y;
int buty = ui::block_layout_resolve(&block).y;
/* Ensure minimum socket height in case layout is empty. */
buty = min_ii(buty, topy - NODE_DY);
locy = buty - multi_input_socket_offset * 0.5;
@@ -1133,15 +1133,15 @@ static void node_update_basis_from_declaration(
const nodes::LayoutDeclaration &decl = *item.decl;
/* Round the node origin because text contents are always pixel-aligned. */
const float2 loc = math::round(node_to_view(node.location));
uiLayout &layout = blender::ui::block_layout(&block,
blender::ui::LayoutDirection::Vertical,
blender::ui::LayoutType::Panel,
loc.x + NODE_DYS,
locy,
NODE_WIDTH(node) - NODE_DY,
0,
0,
UI_style_get_dpi());
uiLayout &layout = ui::block_layout(&block,
ui::LayoutDirection::Vertical,
ui::LayoutType::Panel,
loc.x + NODE_DYS,
locy,
NODE_WIDTH(node) - NODE_DY,
0,
0,
UI_style_get_dpi());
if (node.is_muted()) {
layout.active_set(false);
}
@@ -1149,20 +1149,20 @@ static void node_update_basis_from_declaration(
layout.context_ptr_set("node", &node_ptr);
decl.draw(&layout, const_cast<bContext *>(&C), &node_ptr);
UI_block_align_end(&block);
locy = blender::ui::block_layout_resolve(&block).y;
locy = ui::block_layout_resolve(&block).y;
}
else if constexpr (std::is_same_v<ItemT, flat_item::Separator>) {
uiLayout &layout = blender::ui::block_layout(&block,
blender::ui::LayoutDirection::Vertical,
blender::ui::LayoutType::Panel,
locx + NODE_DYS,
locy,
NODE_WIDTH(node) - NODE_DY,
NODE_DY,
0,
UI_style_get_dpi());
uiLayout &layout = ui::block_layout(&block,
ui::LayoutDirection::Vertical,
ui::LayoutType::Panel,
locx + NODE_DYS,
locy,
NODE_WIDTH(node) - NODE_DY,
NODE_DY,
0,
UI_style_get_dpi());
layout.separator(1.0, LayoutSeparatorType::Line);
blender::ui::block_layout_resolve(&block);
ui::block_layout_resolve(&block);
}
else if constexpr (std::is_same_v<ItemT, flat_item::PanelHeader>) {
const nodes::PanelDeclaration &node_decl = *item.decl;
@@ -1866,7 +1866,7 @@ static void node_draw_panels(bNodeTree &ntree, const bNode &node, uiBlock &block
draw_bounds.xmax,
*panel_runtime.header_center_y - NODE_DYS,
*panel_runtime.header_center_y + NODE_DYS};
UI_block_emboss_set(&block, blender::ui::EmbossType::None);
UI_block_emboss_set(&block, ui::EmbossType::None);
/* Invisible button covering the entire header for collapsing/expanding. */
const int header_but_margin = NODE_MARGIN_X / 3;
@@ -1908,7 +1908,7 @@ static void node_draw_panels(bNodeTree &ntree, const bNode &node, uiBlock &block
"");
offsetx += but_size + but_padding;
UI_block_emboss_set(&block, blender::ui::EmbossType::Emboss);
UI_block_emboss_set(&block, ui::EmbossType::Emboss);
/* Panel toggle. */
if (input_socket && !input_socket->is_logically_linked()) {
@@ -2008,7 +2008,7 @@ static void node_add_unsupported_compositor_operation_error_message_button(const
float &icon_offset)
{
icon_offset -= NODE_HEADER_ICON_SIZE;
UI_block_emboss_set(&block, blender::ui::EmbossType::None);
UI_block_emboss_set(&block, ui::EmbossType::None);
uiDefIconBut(&block,
ButType::But,
0,
@@ -2021,7 +2021,7 @@ static void node_add_unsupported_compositor_operation_error_message_button(const
0,
0,
TIP_(node.typeinfo->compositor_unsupported_message));
UI_block_emboss_set(&block, blender::ui::EmbossType::Emboss);
UI_block_emboss_set(&block, ui::EmbossType::Emboss);
}
static void node_add_error_message_button(const TreeDrawContext &tree_draw_ctx,
@@ -2061,7 +2061,7 @@ static void node_add_error_message_button(const TreeDrawContext &tree_draw_ctx,
const nodes::NodeWarningType display_type = node_error_highest_priority(warnings);
icon_offset -= NODE_HEADER_ICON_SIZE;
UI_block_emboss_set(&block, blender::ui::EmbossType::None);
UI_block_emboss_set(&block, ui::EmbossType::None);
uiBut *but = uiDefIconBut(&block,
ButType::But,
0,
@@ -2078,7 +2078,7 @@ static void node_add_error_message_button(const TreeDrawContext &tree_draw_ctx,
but, [warnings = Array<geo_log::NodeWarning>(warnings)](const uiBut * /*but*/) {
return node_errors_tooltip_fn(warnings);
});
UI_block_emboss_set(&block, blender::ui::EmbossType::Emboss);
UI_block_emboss_set(&block, ui::EmbossType::Emboss);
}
static std::optional<std::chrono::nanoseconds> geo_node_get_execution_time(
@@ -2466,7 +2466,7 @@ static void node_draw_extra_info_row(const bNode &node,
const float but_icon_width = NODE_HEADER_ICON_SIZE * 0.8f;
const float but_icon_right = but_icon_left + but_icon_width;
UI_block_emboss_set(&block, blender::ui::EmbossType::None);
UI_block_emboss_set(&block, ui::EmbossType::None);
uiBut *but_icon = uiDefIconBut(&block,
ButType::But,
0,
@@ -2485,7 +2485,7 @@ static void node_draw_extra_info_row(const bNode &node,
extra_info_row.tooltip_fn_arg,
extra_info_row.tooltip_fn_free_arg);
}
UI_block_emboss_set(&block, blender::ui::EmbossType::Emboss);
UI_block_emboss_set(&block, ui::EmbossType::Emboss);
const float but_text_left = but_icon_right + 6.0f * UI_SCALE_FAC;
const float but_text_right = rect.xmax;
@@ -2813,7 +2813,7 @@ static void node_draw_basis(const bContext &C,
* don't check for NODE_GROUP_CUSTOM here. */
if (node.type_legacy == NODE_GROUP) {
iconofs -= iconbutw;
UI_block_emboss_set(&block, blender::ui::EmbossType::None);
UI_block_emboss_set(&block, ui::EmbossType::None);
uiBut *but = uiDefIconBut(&block,
ButType::ButToggle,
0,
@@ -2833,13 +2833,13 @@ static void node_draw_basis(const bContext &C,
if (node.id) {
UI_but_icon_indicator_number_set(but, ID_REAL_USERS(node.id));
}
UI_block_emboss_set(&block, blender::ui::EmbossType::Emboss);
UI_block_emboss_set(&block, ui::EmbossType::Emboss);
}
/* Preview. */
if (node_is_previewable(snode, ntree, node)) {
const bool is_active = node.flag & NODE_PREVIEW;
iconofs -= iconbutw;
UI_block_emboss_set(&block, blender::ui::EmbossType::None);
UI_block_emboss_set(&block, ui::EmbossType::None);
uiBut *but = uiDefIconBut(&block,
ButType::ButToggle,
0,
@@ -2856,13 +2856,13 @@ static void node_draw_basis(const bContext &C,
node_toggle_button_cb,
POINTER_FROM_INT(node.identifier),
(void *)"NODE_OT_preview_toggle");
UI_block_emboss_set(&block, blender::ui::EmbossType::Emboss);
UI_block_emboss_set(&block, ui::EmbossType::Emboss);
}
if (ELEM(node.type_legacy, NODE_CUSTOM, NODE_CUSTOM_GROUP) &&
node.typeinfo->ui_icon != ICON_NONE)
{
iconofs -= iconbutw;
UI_block_emboss_set(&block, blender::ui::EmbossType::None);
UI_block_emboss_set(&block, ui::EmbossType::None);
uiDefIconBut(&block,
ButType::But,
0,
@@ -2875,12 +2875,12 @@ static void node_draw_basis(const bContext &C,
0,
0,
"");
UI_block_emboss_set(&block, blender::ui::EmbossType::Emboss);
UI_block_emboss_set(&block, ui::EmbossType::Emboss);
}
if (node.type_legacy == GEO_NODE_VIEWER) {
const bool is_active = &node == tree_draw_ctx.active_geometry_nodes_viewer;
iconofs -= iconbutw;
UI_block_emboss_set(&block, blender::ui::EmbossType::None);
UI_block_emboss_set(&block, ui::EmbossType::None);
uiBut *but = uiDefIconBut(&block,
ButType::But,
0,
@@ -2912,14 +2912,14 @@ static void node_draw_basis(const bContext &C,
0,
0,
"");
UI_block_emboss_set(&block, blender::ui::EmbossType::Emboss);
UI_block_emboss_set(&block, ui::EmbossType::Emboss);
}
/* Viewer node shortcuts. */
if (node.is_type("CompositorNodeViewer")) {
short shortcut_icon = get_viewer_shortcut_icon(node);
iconofs -= iconbutw;
const bool is_active = node.flag & NODE_DO_OUTPUT;
UI_block_emboss_set(&block, blender::ui::EmbossType::None);
UI_block_emboss_set(&block, ui::EmbossType::None);
uiBut *but = uiDefIconBut(&block,
ButType::But,
0,
@@ -2950,7 +2950,7 @@ static void node_draw_basis(const bContext &C,
0,
0,
"");
UI_block_emboss_set(&block, blender::ui::EmbossType::Emboss);
UI_block_emboss_set(&block, ui::EmbossType::Emboss);
}
node_add_error_message_button(tree_draw_ctx, node, block, rct, iconofs);
@@ -2966,7 +2966,7 @@ static void node_draw_basis(const bContext &C,
/* Collapse/expand icon. */
{
const int but_size = U.widget_unit * 0.8f;
UI_block_emboss_set(&block, blender::ui::EmbossType::None);
UI_block_emboss_set(&block, ui::EmbossType::None);
uiBut *but = uiDefIconBut(&block,
ButType::ButToggle,
@@ -2985,7 +2985,7 @@ static void node_draw_basis(const bContext &C,
node_toggle_button_cb,
POINTER_FROM_INT(node.identifier),
(void *)"NODE_OT_hide_toggle");
UI_block_emboss_set(&block, blender::ui::EmbossType::Emboss);
UI_block_emboss_set(&block, ui::EmbossType::Emboss);
}
const std::string showname = bke::node_label(ntree, node);
@@ -3207,7 +3207,7 @@ static void node_draw_collapsed(const bContext &C,
/* Collapse/expand icon. */
{
const int but_size = U.widget_unit * 1.0f;
UI_block_emboss_set(&block, blender::ui::EmbossType::None);
UI_block_emboss_set(&block, ui::EmbossType::None);
uiBut *but = uiDefIconBut(&block,
ButType::ButToggle,
@@ -3226,7 +3226,7 @@ static void node_draw_collapsed(const bContext &C,
node_toggle_button_cb,
POINTER_FROM_INT(node.identifier),
(void *)"NODE_OT_hide_toggle");
UI_block_emboss_set(&block, blender::ui::EmbossType::Emboss);
UI_block_emboss_set(&block, ui::EmbossType::Emboss);
}
const std::string showname = bke::node_label(ntree, node);
@@ -4425,8 +4425,7 @@ static uiBlock &invalid_links_uiblock_init(const bContext &C)
Scene *scene = CTX_data_scene(&C);
wmWindow *window = CTX_wm_window(&C);
ARegion *region = CTX_wm_region(&C);
return *UI_block_begin(
&C, scene, window, region, "invalid_links", blender::ui::EmbossType::None);
return *UI_block_begin(&C, scene, window, region, "invalid_links", ui::EmbossType::None);
}
#define USE_DRAW_TOT_UPDATE
@@ -4513,21 +4512,14 @@ static void draw_tree_path(const bContext &C, ARegion &region)
const int y = region.winy - UI_UNIT_Y * 0.6f;
const int width = BLI_rcti_size_x(rect) - 2 * padding_x;
uiBlock *block = UI_block_begin(&C, &region, __func__, blender::ui::EmbossType::None);
uiLayout &layout = blender::ui::block_layout(block,
blender::ui::LayoutDirection::Vertical,
blender::ui::LayoutType::Panel,
x,
y,
width,
1,
0,
style);
uiBlock *block = UI_block_begin(&C, &region, __func__, ui::EmbossType::None);
uiLayout &layout = ui::block_layout(
block, ui::LayoutDirection::Vertical, ui::LayoutType::Panel, x, y, width, 1, 0, style);
const Vector<ui::ContextPathItem> context_path = ed::space_node::context_path_for_space_node(C);
ui::template_breadcrumbs(layout, context_path);
blender::ui::block_layout_resolve(block);
ui::block_layout_resolve(block);
UI_block_end(&C, block);
UI_block_draw(&C, block);

View File

@@ -1374,7 +1374,7 @@ static uiBlock *node_find_menu(bContext *C, ARegion *region, void *arg_optype)
uiBut *but;
wmOperatorType *optype = (wmOperatorType *)arg_optype;
block = UI_block_begin(C, region, "_popup", blender::ui::EmbossType::Emboss);
block = UI_block_begin(C, region, "_popup", ui::EmbossType::Emboss);
UI_block_flag_enable(block, UI_BLOCK_LOOP | UI_BLOCK_MOVEMOUSE_QUIT | UI_BLOCK_SEARCH_MENU);
UI_block_theme_style_set(block, UI_BLOCK_THEME_STYLE_POPUP);

View File

@@ -862,7 +862,7 @@ static void ui_node_draw_input(uiLayout &layout,
uiLayout *sub = &split_wrapper.label_column->row(true);
if (depth > 0) {
UI_block_emboss_set(block, blender::ui::EmbossType::None);
UI_block_emboss_set(block, ui::EmbossType::None);
if (lnode && (lnode->inputs.first ||
(lnode->typeinfo->draw_buttons && lnode->type_legacy != NODE_GROUP)))
@@ -871,11 +871,11 @@ static void ui_node_draw_input(uiLayout &layout,
sub->prop(&inputptr, "show_expanded", UI_ITEM_R_ICON_ONLY, "", icon);
}
UI_block_emboss_set(block, blender::ui::EmbossType::Emboss);
UI_block_emboss_set(block, ui::EmbossType::Emboss);
}
sub = &sub->row(true);
sub->alignment_set(blender::ui::LayoutAlign::Right);
sub->alignment_set(ui::LayoutAlign::Right);
sub->label(node_socket_get_label(&input, panel_label), ICON_NONE);
}

View File

@@ -2296,7 +2296,7 @@ static void outliner_draw_mode_column_toggle(uiBlock *block,
"Change the object in the current mode\n"
" \u2022 Ctrl to add to the current mode");
}
UI_block_emboss_set(block, blender::ui::EmbossType::NoneOrStatus);
UI_block_emboss_set(block, ui::EmbossType::NoneOrStatus);
uiBut *but = uiDefIconBut(block,
ButType::IconToggle,
0,
@@ -2384,7 +2384,7 @@ static void outliner_draw_warning_tree_element(uiBlock *block,
UI_UNIT_X :
0;
UI_block_emboss_set(block, blender::ui::EmbossType::NoneOrStatus);
UI_block_emboss_set(block, ui::EmbossType::NoneOrStatus);
uiBut *but = uiDefIconBut(block,
ButType::IconToggle,
0,
@@ -4053,7 +4053,7 @@ void draw_outliner(const bContext *C, bool do_rebuild)
/* Draw outliner stuff (background, hierarchy lines and names). */
const float right_column_width = outliner_right_columns_width(space_outliner);
outliner_back(region);
block = UI_block_begin(C, region, __func__, blender::ui::EmbossType::Emboss);
block = UI_block_begin(C, region, __func__, ui::EmbossType::Emboss);
outliner_draw_tree(block,
tvc,
region,
@@ -4068,7 +4068,7 @@ void draw_outliner(const bContext *C, bool do_rebuild)
outliner_tree_dimensions(space_outliner, &tree_width, &tree_height);
/* Default to no emboss for outliner UI. */
UI_block_emboss_set(block, blender::ui::EmbossType::NoneOrStatus);
UI_block_emboss_set(block, ui::EmbossType::NoneOrStatus);
if (space_outliner->outlinevis == SO_DATA_API) {
int buttons_start_x = outliner_data_api_buttons_start_x(tree_width);
@@ -4076,9 +4076,9 @@ void draw_outliner(const bContext *C, bool do_rebuild)
outliner_draw_separator(region, buttons_start_x);
outliner_draw_separator(region, buttons_start_x + OL_RNA_COL_SIZEX);
UI_block_emboss_set(block, blender::ui::EmbossType::Emboss);
UI_block_emboss_set(block, ui::EmbossType::Emboss);
outliner_draw_rnabuts(block, region, space_outliner, buttons_start_x);
UI_block_emboss_set(block, blender::ui::EmbossType::NoneOrStatus);
UI_block_emboss_set(block, ui::EmbossType::NoneOrStatus);
}
else if (ELEM(space_outliner->outlinevis, SO_ID_ORPHANS, SO_LIBRARIES)) {
outliner_draw_userbuts(block, region, space_outliner);
@@ -4087,10 +4087,10 @@ void draw_outliner(const bContext *C, bool do_rebuild)
const int x = region->v2d.cur.xmax - right_column_width;
outliner_draw_separator(region, x);
if (space_outliner->lib_override_view_mode == SO_LIB_OVERRIDE_VIEW_PROPERTIES) {
UI_block_emboss_set(block, blender::ui::EmbossType::Emboss);
UI_block_emboss_set(block, ui::EmbossType::Emboss);
UI_block_flag_enable(block, UI_BLOCK_NO_DRAW_OVERRIDDEN_STATE);
outliner_draw_overrides_rna_buts(block, region, space_outliner, &space_outliner->tree, x);
UI_block_emboss_set(block, blender::ui::EmbossType::NoneOrStatus);
UI_block_emboss_set(block, ui::EmbossType::NoneOrStatus);
}
else if (space_outliner->lib_override_view_mode == SO_LIB_OVERRIDE_VIEW_HIERARCHIES) {
outliner_draw_overrides_restrictbuts(
@@ -4120,7 +4120,7 @@ void draw_outliner(const bContext *C, bool do_rebuild)
outliner_draw_warning_column(block, space_outliner, use_mode_column);
}
UI_block_emboss_set(block, blender::ui::EmbossType::Emboss);
UI_block_emboss_set(block, ui::EmbossType::Emboss);
/* Draw edit buttons if necessary. */
if (te_edit) {

View File

@@ -850,7 +850,7 @@ static uiBlock *merged_element_search_menu(bContext *C, ARegion *region, void *d
/* Clear search on each menu creation */
*search = '\0';
block = UI_block_begin(C, region, __func__, blender::ui::EmbossType::Emboss);
block = UI_block_begin(C, region, __func__, ui::EmbossType::Emboss);
UI_block_flag_enable(block, UI_BLOCK_LOOP | UI_BLOCK_MOVEMOUSE_QUIT | UI_BLOCK_SEARCH_MENU);
UI_block_theme_style_set(block, UI_BLOCK_THEME_STYLE_POPUP);

View File

@@ -110,7 +110,7 @@ static float draw_channel_widget_mute(const SeqChannelDrawContext *context,
&context->scene->id, &RNA_SequenceTimelineChannel, channel);
PropertyRNA *hide_prop = RNA_struct_type_find_property(&RNA_SequenceTimelineChannel, "mute");
UI_block_emboss_set(block, blender::ui::EmbossType::None);
UI_block_emboss_set(block, ui::EmbossType::None);
uiBut *but = uiDefIconButR_prop(block,
ButType::Toggle,
1,
@@ -149,7 +149,7 @@ static float draw_channel_widget_lock(const SeqChannelDrawContext *context,
&context->scene->id, &RNA_SequenceTimelineChannel, channel);
PropertyRNA *hide_prop = RNA_struct_type_find_property(&RNA_SequenceTimelineChannel, "lock");
UI_block_emboss_set(block, blender::ui::EmbossType::None);
UI_block_emboss_set(block, ui::EmbossType::None);
uiBut *but = uiDefIconButR_prop(block,
ButType::Toggle,
1,
@@ -226,7 +226,7 @@ static void draw_channel_labels(const SeqChannelDrawContext *context,
&context->scene->id, &RNA_SequenceTimelineChannel, channel);
PropertyRNA *prop = RNA_struct_name_property(ptr.type);
UI_block_emboss_set(block, blender::ui::EmbossType::Emboss);
UI_block_emboss_set(block, ui::EmbossType::Emboss);
uiBut *but = uiDefButR(block,
ButType::Text,
1,
@@ -241,7 +241,7 @@ static void draw_channel_labels(const SeqChannelDrawContext *context,
0,
0,
std::nullopt);
UI_block_emboss_set(block, blender::ui::EmbossType::None);
UI_block_emboss_set(block, ui::EmbossType::None);
if (UI_but_active_only(context->C, context->region, block, but) == false) {
sseq->runtime->rename_channel_index = 0;
@@ -271,8 +271,7 @@ static void draw_channel_headers(const SeqChannelDrawContext *context)
GPU_matrix_push();
wmOrtho2_pixelspace(context->region->winx / context->scale,
context->region->winy / context->scale);
uiBlock *block = UI_block_begin(
context->C, context->region, __func__, blender::ui::EmbossType::Emboss);
uiBlock *block = UI_block_begin(context->C, context->region, __func__, ui::EmbossType::Emboss);
int channel_range[2];
displayed_channel_range_get(context, channel_range);

View File

@@ -648,21 +648,21 @@ static void spreadsheet_footer_region_draw(const bContext *C, ARegion *region)
UI_ThemeClearColor(TH_BACK);
uiBlock *block = UI_block_begin(C, region, __func__, blender::ui::EmbossType::Emboss);
uiBlock *block = UI_block_begin(C, region, __func__, ui::EmbossType::Emboss);
const uiStyle *style = UI_style_get_dpi();
uiLayout &layout = blender::ui::block_layout(block,
blender::ui::LayoutDirection::Horizontal,
blender::ui::LayoutType::Header,
UI_HEADER_OFFSET,
region->winy - (region->winy - UI_UNIT_Y) / 2.0f,
region->winx,
1,
0,
style);
uiLayout &layout = ui::block_layout(block,
ui::LayoutDirection::Horizontal,
ui::LayoutType::Header,
UI_HEADER_OFFSET,
region->winy - (region->winy - UI_UNIT_Y) / 2.0f,
region->winx,
1,
0,
style);
layout.separator_spacer();
layout.alignment_set(blender::ui::LayoutAlign::Right);
layout.alignment_set(ui::LayoutAlign::Right);
layout.label(stats_str, ICON_NONE);
blender::ui::block_layout_resolve(block);
ui::block_layout_resolve(block);
UI_block_align_end(block);
UI_block_end(C, block);
UI_block_draw(C, block);

View File

@@ -145,7 +145,7 @@ static void draw_left_column_content(const int scroll_offset_y,
GPU_scissor(0, 0, drawer.left_column_width, region->winy - drawer.top_row_height);
uiBlock *left_column_block = UI_block_begin(C, region, __func__, blender::ui::EmbossType::None);
uiBlock *left_column_block = UI_block_begin(C, region, __func__, ui::EmbossType::None);
int first_row, max_visible_rows;
get_visible_rows(drawer, region, scroll_offset_y, &first_row, &max_visible_rows);
for (const int row_index : IndexRange(first_row, max_visible_rows)) {
@@ -181,7 +181,7 @@ static void draw_top_row_content(const bContext *C,
region->winx - drawer.left_column_width,
drawer.top_row_height);
uiBlock *first_row_block = UI_block_begin(C, region, __func__, blender::ui::EmbossType::None);
uiBlock *first_row_block = UI_block_begin(C, region, __func__, ui::EmbossType::None);
int left_x = drawer.left_column_width - scroll_offset_x;
for (const int column_index : IndexRange(drawer.tot_columns)) {
@@ -219,7 +219,7 @@ static void draw_cell_contents(const bContext *C,
region->winx - drawer.left_column_width,
region->winy - drawer.top_row_height);
uiBlock *cells_block = UI_block_begin(C, region, __func__, blender::ui::EmbossType::None);
uiBlock *cells_block = UI_block_begin(C, region, __func__, ui::EmbossType::None);
int first_row, max_visible_rows;
get_visible_rows(drawer, region, scroll_offset_y, &first_row, &max_visible_rows);

View File

@@ -150,7 +150,7 @@ static void spreadsheet_filter_panel_draw_header(const bContext *C, Panel *panel
}
uiLayout *row = &layout->row(true);
row->emboss_set(blender::ui::EmbossType::None);
row->emboss_set(ui::EmbossType::None);
row->prop(filter_ptr, "enabled", UI_ITEM_R_ICON_ONLY, "", ICON_NONE);
if (column_name.is_empty()) {
@@ -171,7 +171,7 @@ static void spreadsheet_filter_panel_draw_header(const bContext *C, Panel *panel
}
row = &layout->row(true);
row->emboss_set(blender::ui::EmbossType::None);
row->emboss_set(ui::EmbossType::None);
const int current_index = BLI_findindex(&sspreadsheet->row_filters, filter);
PointerRNA op_ptr = row->op("SPREADSHEET_OT_remove_row_filter_rule", "", ICON_X);
RNA_int_set(&op_ptr, "index", current_index);

View File

@@ -27,7 +27,7 @@ static void cmp_node_rgb_declare(NodeDeclarationBuilder &b)
b.add_output<decl::Color>("RGBA")
.default_value({0.5f, 0.5f, 0.5f, 1.0f})
.custom_draw([](CustomSocketDrawParams &params) {
params.layout.alignment_set(blender::ui::LayoutAlign::Expand);
params.layout.alignment_set(ui::LayoutAlign::Expand);
uiLayout &col = params.layout.column(false);
uiTemplateColorPicker(
&col, &params.socket_ptr, "default_value", true, false, false, false);

View File

@@ -15,7 +15,7 @@ namespace blender::nodes::node_fn_input_color_cc {
static void node_declare(NodeDeclarationBuilder &b)
{
b.add_output<decl::Color>("Color").custom_draw([](CustomSocketDrawParams &params) {
params.layout.alignment_set(blender::ui::LayoutAlign::Expand);
params.layout.alignment_set(ui::LayoutAlign::Expand);
uiLayout &col = params.layout.column(false);
uiTemplateColorPicker(&col, &params.node_ptr, "value", true, false, false, true);
col.prop(&params.node_ptr, "value", UI_ITEM_R_SPLIT_EMPTY_NAME, "", ICON_NONE);

View File

@@ -22,7 +22,7 @@ static void node_declare(NodeDeclarationBuilder &b)
{
b.is_function_node();
b.add_output<decl::String>("String").custom_draw([](CustomSocketDrawParams &params) {
params.layout.alignment_set(blender::ui::LayoutAlign::Expand);
params.layout.alignment_set(ui::LayoutAlign::Expand);
PropertyRNA *prop = RNA_struct_find_property(&params.node_ptr, "string");
params.layout.prop(
&params.node_ptr, prop, -1, 0, UI_ITEM_NONE, "", ICON_NONE, IFACE_("String"));

View File

@@ -14,7 +14,7 @@ namespace blender::nodes::node_geo_image_cc {
static void node_declare(NodeDeclarationBuilder &b)
{
b.add_output<decl::Image>("Image").custom_draw([](CustomSocketDrawParams &params) {
params.layout.alignment_set(blender::ui::LayoutAlign::Expand);
params.layout.alignment_set(ui::LayoutAlign::Expand);
uiTemplateID(&params.layout,
&params.C,
&params.node_ptr,

View File

@@ -12,7 +12,7 @@ namespace blender::nodes::node_geo_input_collection_cc {
static void node_declare(NodeDeclarationBuilder &b)
{
b.add_output<decl::Collection>("Collection").custom_draw([](CustomSocketDrawParams &params) {
params.layout.alignment_set(blender::ui::LayoutAlign::Expand);
params.layout.alignment_set(ui::LayoutAlign::Expand);
params.layout.prop(&params.node_ptr, "collection", UI_ITEM_NONE, "", ICON_NONE);
});
}

View File

@@ -12,7 +12,7 @@ namespace blender::nodes::node_geo_input_material_cc {
static void node_declare(NodeDeclarationBuilder &b)
{
b.add_output<decl::Material>("Material").custom_draw([](CustomSocketDrawParams &params) {
params.layout.alignment_set(blender::ui::LayoutAlign::Expand);
params.layout.alignment_set(ui::LayoutAlign::Expand);
params.layout.prop(&params.node_ptr, "material", UI_ITEM_NONE, "", ICON_NONE);
});
}

View File

@@ -12,7 +12,7 @@ namespace blender::nodes::node_geo_input_object_cc {
static void node_declare(NodeDeclarationBuilder &b)
{
b.add_output<decl::Object>("Object").custom_draw([](CustomSocketDrawParams &params) {
params.layout.alignment_set(blender::ui::LayoutAlign::Expand);
params.layout.alignment_set(ui::LayoutAlign::Expand);
params.layout.prop(&params.node_ptr, "object", UI_ITEM_NONE, "", ICON_NONE);
});
}

View File

@@ -230,7 +230,7 @@ static void add_layer_name_search_button(DrawGroupInputsContext &ctx,
uiLayout *split = &layout->split(0.4f, false);
uiLayout *name_row = &split->row(false);
name_row->alignment_set(blender::ui::LayoutAlign::Right);
name_row->alignment_set(ui::LayoutAlign::Right);
name_row->label(socket.name ? IFACE_(socket.name) : "", ICON_NONE);
uiLayout *prop_row = &split->row(true);
@@ -418,7 +418,7 @@ static void add_attribute_search_or_value_buttons(
uiLayout *split = &layout->split(0.4f, false);
uiLayout *name_row = &split->row(false);
name_row->alignment_set(blender::ui::LayoutAlign::Right);
name_row->alignment_set(ui::LayoutAlign::Right);
uiLayout *prop_row = nullptr;
@@ -437,7 +437,7 @@ static void add_attribute_search_or_value_buttons(
if (type == SOCK_BOOLEAN) {
prop_row->use_property_split_set(false);
prop_row->alignment_set(blender::ui::LayoutAlign::Expand);
prop_row->alignment_set(ui::LayoutAlign::Expand);
}
if (attribute_name) {
@@ -799,7 +799,7 @@ static void draw_property_for_output_socket(DrawGroupInputsContext &ctx,
uiLayout *split = &layout->split(0.4f, false);
uiLayout *name_row = &split->row(false);
name_row->alignment_set(blender::ui::LayoutAlign::Right);
name_row->alignment_set(ui::LayoutAlign::Right);
name_row->label(socket.name ? socket.name : "", ICON_NONE);
uiLayout *row = &split->row(true);
@@ -889,7 +889,7 @@ static void draw_named_attributes_panel(uiLayout *layout, NodesModifierData &nmd
}
uiLayout *row = &split->row(false);
row->alignment_set(blender::ui::LayoutAlign::Right);
row->alignment_set(ui::LayoutAlign::Right);
row->active_set(false);
row->label(ss.str(), ICON_NONE);

View File

@@ -19,7 +19,7 @@ static void node_declare(NodeDeclarationBuilder &b)
b.add_output<decl::Color>("Color")
.default_value({0.5f, 0.5f, 0.5f, 1.0f})
.custom_draw([](CustomSocketDrawParams &params) {
params.layout.alignment_set(blender::ui::LayoutAlign::Expand);
params.layout.alignment_set(ui::LayoutAlign::Expand);
uiLayout &col = params.layout.column(false);
uiTemplateColorPicker(
&col, &params.socket_ptr, "default_value", true, false, false, false);