From 60fdcb2d206c161b9a2bf3a0e5d952a331070dbc Mon Sep 17 00:00:00 2001 From: Guillermo Venegas Date: Wed, 7 May 2025 22:51:26 +0200 Subject: [PATCH] Cleanup: UI: Follow Using `this->` code style in recent uiLayout refactors This changes removes `this->` when accessing data member with trailing underscore and adds `this->` to member methods. Pull Request: https://projects.blender.org/blender/blender/pulls/138564 --- .../editors/interface/interface_layout.cc | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/source/blender/editors/interface/interface_layout.cc b/source/blender/editors/interface/interface_layout.cc index 942a855401c..9adf5c0943f 100644 --- a/source/blender/editors/interface/interface_layout.cc +++ b/source/blender/editors/interface/interface_layout.cc @@ -4955,9 +4955,9 @@ uiLayout &uiLayout::row(bool align) ui_litem_init_from_parent(litem, this, align); litem->type_ = uiItemType::LayoutRow; - litem->space_ = (align) ? 0 : this->root_->style->buttonspacex; + litem->space_ = (align) ? 0 : root_->style->buttonspacex; - UI_block_layout_set_current(this->root_->block, litem); + UI_block_layout_set_current(root_->block, litem); return *litem; } @@ -5014,7 +5014,7 @@ PanelLayout uiLayout::panel_prop_with_bool_header(const bContext *C, const StringRefNull bool_prop_name, const std::optional label) { - PanelLayout panel_layout = panel_prop(C, open_prop_owner, open_prop_name); + PanelLayout panel_layout = this->panel_prop(C, open_prop_owner, open_prop_name); uiLayout *panel_header = panel_layout.header; panel_header->flag_ &= ~(uiItemInternalFlag::PropSep | uiItemInternalFlag::PropDecorate | @@ -5029,7 +5029,7 @@ uiLayout *uiLayout::panel_prop(const bContext *C, const StringRefNull open_prop_name, const StringRef label) { - PanelLayout panel_layout = panel_prop(C, open_prop_owner, open_prop_name); + PanelLayout panel_layout = this->panel_prop(C, open_prop_owner, open_prop_name); uiItemL(panel_layout.header, label, ICON_NONE); return panel_layout.body; @@ -5044,7 +5044,7 @@ PanelLayout uiLayout::panel(const bContext *C, const StringRef idname, const boo root_panel, idname, default_closed); PointerRNA state_ptr = RNA_pointer_create_discrete(nullptr, &RNA_LayoutPanelState, state); - return panel_prop(C, &state_ptr, "is_open"); + return this->panel_prop(C, &state_ptr, "is_open"); } uiLayout *uiLayout::panel(const bContext *C, @@ -5052,7 +5052,7 @@ uiLayout *uiLayout::panel(const bContext *C, const bool default_closed, const StringRef label) { - PanelLayout panel_layout = panel(C, idname, default_closed); + PanelLayout panel_layout = this->panel(C, idname, default_closed); uiItemL(panel_layout.header, label, ICON_NONE); return panel_layout.body; @@ -5069,7 +5069,7 @@ bool uiLayoutEndsWithPanelHeader(const uiLayout &layout) uiLayout &uiLayout::row(bool align, const StringRef heading) { - uiLayout &litem = row(align); + uiLayout &litem = this->row(align); ui_layout_heading_set(&litem, heading); return litem; } @@ -5080,16 +5080,16 @@ uiLayout &uiLayout::column(bool align) ui_litem_init_from_parent(litem, this, align); litem->type_ = uiItemType::LayoutColumn; - litem->space_ = (align) ? 0 : this->root_->style->buttonspacey; + litem->space_ = (align) ? 0 : root_->style->buttonspacey; - UI_block_layout_set_current(this->root_->block, litem); + UI_block_layout_set_current(root_->block, litem); return *litem; } uiLayout &uiLayout::column(bool align, const StringRef heading) { - uiLayout &litem = column(align); + uiLayout &litem = this->column(align); ui_layout_heading_set(&litem, heading); return litem; } @@ -5100,10 +5100,10 @@ uiLayout &uiLayout::column_flow(int number, bool align) ui_litem_init_from_parent(flow, this, align); flow->type_ = uiItemType::LayoutColumnFlow; - flow->space_ = (flow->align_) ? 0 : this->root_->style->columnspace; + flow->space_ = (flow->align_) ? 0 : root_->style->columnspace; flow->number = number; - UI_block_layout_set_current(this->root_->block, flow); + UI_block_layout_set_current(root_->block, flow); return *flow; } @@ -5115,13 +5115,13 @@ uiLayout &uiLayout::grid_flow( flow->type_ = uiItemType::LayoutGridFlow; ui_litem_init_from_parent(flow, this, align); - flow->space_ = (flow->align_) ? 0 : this->root_->style->columnspace; + flow->space_ = (flow->align_) ? 0 : root_->style->columnspace; flow->row_major = row_major; flow->columns_len = columns_len; flow->even_columns = even_columns; flow->even_rows = even_rows; - UI_block_layout_set_current(this->root_->block, flow); + UI_block_layout_set_current(root_->block, flow); return *flow; }