[Bf-blender-cvs] [07e11e5af2c] soc-2020-outliner: Cleanup: rename left column to mode column
Nathan Craddock
noreply at git.blender.org
Tue Jun 30 05:37:35 CEST 2020
Commit: 07e11e5af2c0734e369f1fdefa08de3a96d456c1
Author: Nathan Craddock
Date: Mon Jun 29 20:43:34 2020 -0600
Branches: soc-2020-outliner
https://developer.blender.org/rB07e11e5af2c0734e369f1fdefa08de3a96d456c1
Cleanup: rename left column to mode column
===================================================================
M release/scripts/startup/bl_ui/space_outliner.py
M source/blender/editors/space_outliner/outliner_draw.c
M source/blender/editors/space_outliner/outliner_select.c
M source/blender/editors/space_outliner/space_outliner.c
M source/blender/makesdna/DNA_space_types.h
M source/blender/makesrna/intern/rna_space.c
===================================================================
diff --git a/release/scripts/startup/bl_ui/space_outliner.py b/release/scripts/startup/bl_ui/space_outliner.py
index 6815c584d95..e01c470f74c 100644
--- a/release/scripts/startup/bl_ui/space_outliner.py
+++ b/release/scripts/startup/bl_ui/space_outliner.py
@@ -368,7 +368,7 @@ class OUTLINER_PT_filter(Panel):
layout.separator()
row = layout.row(align=True)
- row.prop(space, "show_left_column", text="Show Left Column")
+ row.prop(space, "show_mode_column", text="Show Mode Column")
layout.separator()
col = layout.column(align=True)
diff --git a/source/blender/editors/space_outliner/outliner_draw.c b/source/blender/editors/space_outliner/outliner_draw.c
index f26694cc0f7..b1f9ebcbe28 100644
--- a/source/blender/editors/space_outliner/outliner_draw.c
+++ b/source/blender/editors/space_outliner/outliner_draw.c
@@ -1954,7 +1954,7 @@ static void outliner_mode_toggle_fn(bContext *C, void *tselem_poin, void *UNUSED
}
/* Draw icons for setting activation when in object mode */
-static void outliner_draw_left_column_activation(const bContext *C,
+static void outliner_draw_mode_column_activation(const bContext *C,
uiBlock *block,
TreeViewContext *UNUSED(tvc),
TreeElement *te,
@@ -2072,11 +2072,11 @@ static int outliner_get_mode_icon(const int mode)
}
/* Draw icons for adding and removing objects from the current interation mode */
-static void outliner_draw_left_column_mode_toggle(uiBlock *block,
- TreeViewContext *tvc,
- TreeElement *te,
- TreeStoreElem *tselem,
- const bool lock_object_modes)
+static void outliner_draw_mode_column_toggle(uiBlock *block,
+ TreeViewContext *tvc,
+ TreeElement *te,
+ TreeStoreElem *tselem,
+ const bool lock_object_modes)
{
uiBut *but;
const int active_mode = tvc->obact->mode;
@@ -2136,7 +2136,7 @@ static void outliner_draw_left_column_mode_toggle(uiBlock *block,
}
}
-static void outliner_draw_left_column(
+static void outliner_draw_mode_column(
const bContext *C, uiBlock *block, TreeViewContext *tvc, SpaceOutliner *soops, ListBase *tree)
{
TreeStoreElem *tselem;
@@ -2146,15 +2146,15 @@ static void outliner_draw_left_column(
tselem = TREESTORE(te);
if (tvc->obact && tvc->obact->mode != OB_MODE_OBJECT) {
- outliner_draw_left_column_mode_toggle(block, tvc, te, tselem, lock_object_modes);
+ outliner_draw_mode_column_toggle(block, tvc, te, tselem, lock_object_modes);
}
/* TODO (Nathan): Should the active icons always draw, or be hidden in non-object modes? */
else {
- outliner_draw_left_column_activation(C, block, tvc, te, tselem);
+ outliner_draw_mode_column_activation(C, block, tvc, te, tselem);
}
if (TSELEM_OPEN(tselem, soops)) {
- outliner_draw_left_column(C, block, tvc, soops, &te->subtree);
+ outliner_draw_mode_column(C, block, tvc, soops, &te->subtree);
}
}
}
@@ -3793,16 +3793,16 @@ static void outliner_draw_tree(bContext *C,
ARegion *region,
SpaceOutliner *soops,
const float restrict_column_width,
- const bool use_left_column,
+ const bool use_mode_column,
TreeElement **te_edit)
{
const uiFontStyle *fstyle = UI_FSTYLE_WIDGET;
int starty, startx;
/* Move the tree a unit left in view layer mode */
- short left_column_offset = use_left_column ? UI_UNIT_X : 0;
+ short mode_column_offset = use_mode_column ? UI_UNIT_X : 0;
if (soops->outlinevis == SO_VIEW_LAYER) {
- left_column_offset -= UI_UNIT_X;
+ mode_column_offset -= UI_UNIT_X;
}
GPU_blend_set_func_separate(
@@ -3832,12 +3832,12 @@ static void outliner_draw_tree(bContext *C,
// gray hierarchy lines
starty = (int)region->v2d.tot.ymax - UI_UNIT_Y / 2 - OL_Y_OFFSET;
- startx = left_column_offset + UI_UNIT_X / 2 - (U.pixelsize + 1) / 2;
+ startx = mode_column_offset + UI_UNIT_X / 2 - (U.pixelsize + 1) / 2;
outliner_draw_hierarchy_lines(soops, &soops->tree, startx, &starty);
// items themselves
starty = (int)region->v2d.tot.ymax - UI_UNIT_Y - OL_Y_OFFSET;
- startx = left_column_offset;
+ startx = mode_column_offset;
LISTBASE_FOREACH (TreeElement *, te, &soops->tree) {
outliner_draw_tree_element(C,
block,
@@ -3961,7 +3961,7 @@ void draw_outliner(const bContext *C)
UI_view2d_view_ortho(v2d);
/* Only show mode toggle and activation column in View Layers and Scenes view */
- const bool use_left_column = (soops->flag & SO_LEFT_COLUMN) &&
+ const bool use_mode_column = (soops->flag & SO_MODE_COLUMN) &&
(ELEM(soops->outlinevis, SO_VIEW_LAYER, SO_SCENES));
/* draw outliner stuff (background, hierarchy lines and names) */
@@ -3969,7 +3969,7 @@ void draw_outliner(const bContext *C)
outliner_back(region);
block = UI_block_begin(C, region, __func__, UI_EMBOSS);
outliner_draw_tree(
- (bContext *)C, block, &tvc, region, soops, restrict_column_width, use_left_column, &te_edit);
+ (bContext *)C, block, &tvc, region, soops, restrict_column_width, use_mode_column, &te_edit);
/* Compute outliner dimensions after it has been drawn. */
int tree_width, tree_height;
@@ -4000,8 +4000,8 @@ void draw_outliner(const bContext *C)
}
/* Draw mode toggle and activation icons */
- if (use_left_column) {
- outliner_draw_left_column(C, block, &tvc, soops, &soops->tree);
+ if (use_mode_column) {
+ outliner_draw_mode_column(C, block, &tvc, soops, &soops->tree);
}
UI_block_emboss_set(block, UI_EMBOSS);
diff --git a/source/blender/editors/space_outliner/outliner_select.c b/source/blender/editors/space_outliner/outliner_select.c
index 987d69756be..198f4bb1fed 100644
--- a/source/blender/editors/space_outliner/outliner_select.c
+++ b/source/blender/editors/space_outliner/outliner_select.c
@@ -1329,7 +1329,6 @@ void outliner_set_active_data(bContext *C,
/* ================================================ */
-
/**
* Action when clicking to activate an item (typically under the mouse cursor),
* but don't do any cursor intersection checks.
@@ -1557,7 +1556,7 @@ static int outliner_item_do_activate_from_cursor(bContext *C,
if (outliner_is_co_within_restrict_columns(soops, region, view_mval[0])) {
return OPERATOR_CANCELLED;
}
- else if (soops->flag & SO_LEFT_COLUMN && view_mval[0] < UI_UNIT_X) {
+ else if (soops->flag & SO_MODE_COLUMN && view_mval[0] < UI_UNIT_X) {
return OPERATOR_CANCELLED;
}
@@ -1822,9 +1821,7 @@ static TreeElement *outliner_find_next_element(SpaceOutliner *soops, TreeElement
return te;
}
-static TreeElement *outliner_walk_left(SpaceOutliner *soops,
- TreeElement *te,
- bool toggle_all)
+static TreeElement *outliner_walk_left(SpaceOutliner *soops, TreeElement *te, bool toggle_all)
{
TreeStoreElem *tselem = TREESTORE(te);
@@ -1839,9 +1836,7 @@ static TreeElement *outliner_walk_left(SpaceOutliner *soops,
return te;
}
-static TreeElement *outliner_walk_right(SpaceOutliner *soops,
- TreeElement *te,
- bool toggle_all)
+static TreeElement *outliner_walk_right(SpaceOutliner *soops, TreeElement *te, bool toggle_all)
{
TreeStoreElem *tselem = TREESTORE(te);
diff --git a/source/blender/editors/space_outliner/space_outliner.c b/source/blender/editors/space_outliner/space_outliner.c
index 930019aa5f6..7ffe5cdfa73 100644
--- a/source/blender/editors/space_outliner/space_outliner.c
+++ b/source/blender/editors/space_outliner/space_outliner.c
@@ -305,7 +305,7 @@ static SpaceLink *outliner_new(const ScrArea *UNUSED(area), const Scene *UNUSED(
soutliner->show_restrict_flags = SO_RESTRICT_ENABLE | SO_RESTRICT_HIDE;
soutliner->outlinevis = SO_VIEW_LAYER;
soutliner->sync_select_dirty |= WM_OUTLINER_SYNC_SELECT_FROM_ALL;
- soutliner->flag = SO_SYNC_SELECT | SO_LEFT_COLUMN;
+ soutliner->flag = SO_SYNC_SELECT | SO_MODE_COLUMN;
/* header */
region = MEM_callocN(sizeof(ARegion), "header for outliner");
diff --git a/source/blender/makesdna/DNA_space_types.h b/source/blender/makesdna/DNA_space_types.h
index 4e6de179d69..5f044104073 100644
--- a/source/blender/makesdna/DNA_space_types.h
+++ b/source/blender/makesdna/DNA_space_types.h
@@ -285,7 +285,7 @@ typedef enum eSpaceOutliner_Flag {
/* SO_HIDE_KEYINGSETINFO = (1 << 3), */ /* UNUSED */
SO_SKIP_SORT_ALPHA = (1 << 4),
SO_SYNC_SELECT = (1 << 5),
- SO_LEFT_COLUMN = (1 << 6),
+ SO_MODE_COLUMN = (1 << 6),
} eSpaceOutliner_Flag;
/* SpaceOutliner.filter */
diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c
index 8f349b962b3..729c07947d5 100644
--- a/source/blender/makesrna/intern/rna_space.c
+++ b/source/blender/makesrna/intern/rna_space.c
@@ -3094,10 +3094,10 @@ static void rna_def_space_outliner(BlenderRNA *brna)
prop, "Sync Outliner Selection", "Sync outliner selection with other editors");
RNA_def_property_update(prop, NC_SPACE | ND_SPACE_OUTLINER, NULL);
- prop = RNA_def_property(srna, "show_left_column", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "flag", SO_LEFT_COLUMN);
+ prop = RNA_def_property(srna, "show_mode_column", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", SO_MODE_COLUMN);
RNA_def_property_ui_text(
- prop, "Show Left Column", "Show the left column for mode toggle and activation");
+ prop, "Show Mode Column", "Show the mode column for mode toggle and
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list