[Bf-blender-cvs] [726585cb376] modifier-panels-ui: Only draw modifier name when panels are wide
Hans Goudey
noreply at git.blender.org
Wed Apr 22 20:27:31 CEST 2020
Commit: 726585cb376c835a651273708ca6b4285948dabe
Author: Hans Goudey
Date: Wed Apr 22 13:27:25 2020 -0500
Branches: modifier-panels-ui
https://developer.blender.org/rB726585cb376c835a651273708ca6b4285948dabe
Only draw modifier name when panels are wide
===================================================================
M source/blender/modifiers/intern/MOD_ui_common.c
===================================================================
diff --git a/source/blender/modifiers/intern/MOD_ui_common.c b/source/blender/modifiers/intern/MOD_ui_common.c
index 92edf0ec681..36be5198cbb 100644
--- a/source/blender/modifiers/intern/MOD_ui_common.c
+++ b/source/blender/modifiers/intern/MOD_ui_common.c
@@ -241,6 +241,7 @@ static void modifier_panel_header(const bContext *C, Panel *panel)
Scene *scene = CTX_data_scene(C);
Object *ob = CTX_data_active_object(C);
int index = panel->runtime.list_index;
+ bool narrow_panel = (panel->sizex < UI_UNIT_X * 8 && panel->sizex != 0);
/* Modifier Icon. */
row = uiLayoutRow(layout, false);
@@ -250,7 +251,9 @@ static void modifier_panel_header(const bContext *C, Panel *panel)
uiItemL(row, "", RNA_struct_ui_icon(ptr.type));
/* Modifier Name. */
- uiItemR(layout, &ptr, "name", 0, "", ICON_NONE);
+ if (!narrow_panel) {
+ uiItemR(layout, &ptr, "name", 0, "", ICON_NONE);
+ }
/* Switch context buttons. */
if (modifier_is_simulation(md) == 1) {
@@ -283,7 +286,6 @@ static void modifier_panel_header(const bContext *C, Panel *panel)
/* Collision and Surface are always enabled, hide buttons. */
if (((md->type != eModifierType_Collision) || !(ob->pd && ob->pd->deflect)) &&
(md->type != eModifierType_Surface)) {
-
if (mti->flags & eModifierTypeFlag_SupportsEditmode) {
sub = uiLayoutRow(row, true);
uiLayoutSetActive(sub, (md->mode & eModifierMode_Realtime));
More information about the Bf-blender-cvs
mailing list