diff options
author | Dalai Felinto <dfelinto@gmail.com> | 2010-06-23 10:09:30 +0400 |
---|---|---|
committer | Dalai Felinto <dfelinto@gmail.com> | 2010-06-23 10:09:30 +0400 |
commit | 5215e410c6e39971b79b84c1fbd77f7dc8833fcc (patch) | |
tree | b0d08ced05b8adc8cdd21ddf8222d18b00e8a5df /source/blender/editors/space_logic | |
parent | ceac8d0fedaef9694cd2365659740f449e9ddd92 (diff) |
Logic UI: small change: make pin always visible (disable sometimes instead of hiding)
I still think we could use a more compact header for the non-expanded mode (ala 2.49). To be addressed later
Diffstat (limited to 'source/blender/editors/space_logic')
-rw-r--r-- | source/blender/editors/space_logic/logic_window.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/source/blender/editors/space_logic/logic_window.c b/source/blender/editors/space_logic/logic_window.c index 154851bd248..6142145ae1d 100644 --- a/source/blender/editors/space_logic/logic_window.c +++ b/source/blender/editors/space_logic/logic_window.c @@ -3174,7 +3174,7 @@ static int is_sensor_linked(uiBlock *block, bSensor *sens) static void draw_sensor_header(uiLayout *layout, PointerRNA *ptr, PointerRNA *logic_ptr) { - uiLayout *box, *row; + uiLayout *box, *row, *subrow; box= uiLayoutBox(layout); row= uiLayoutRow(box, 0); @@ -3183,9 +3183,10 @@ static void draw_sensor_header(uiLayout *layout, PointerRNA *ptr, PointerRNA *lo uiItemR(row, ptr, "type", 0, "", 0); uiItemR(row, ptr, "name", 0, "", 0); - // XXX in 2.49 we make the pin to dis/appear. In 2.50 may be better to simply enable/disable it - if (RNA_boolean_get(logic_ptr, "sensors_show_active_states") && (RNA_boolean_get(ptr, "expanded") || RNA_boolean_get(ptr, "pinned"))) - uiItemR(row, ptr, "pinned", UI_ITEM_R_NO_BG, "", 0); + subrow= uiLayoutRow(row, 0); + uiLayoutSetActive(subrow, (RNA_boolean_get(logic_ptr, "sensors_show_active_states") + && RNA_boolean_get(ptr, "expanded") || RNA_boolean_get(ptr, "pinned"))); + uiItemR(subrow, ptr, "pinned", UI_ITEM_R_NO_BG, "", 0); uiItemO(row, "", ICON_X, "LOGIC_OT_sensor_remove"); } @@ -3591,7 +3592,7 @@ void draw_brick_controller(uiLayout *layout, PointerRNA *ptr) /* Actuator code */ static void draw_actuator_header(uiLayout *layout, PointerRNA *ptr, PointerRNA *logic_ptr) { - uiLayout *box, *row; + uiLayout *box, *row, *subrow; box= uiLayoutBox(layout); row= uiLayoutRow(box, 0); @@ -3600,9 +3601,10 @@ static void draw_actuator_header(uiLayout *layout, PointerRNA *ptr, PointerRNA * uiItemR(row, ptr, "type", 0, "", 0); uiItemR(row, ptr, "name", 0, "", 0); - // XXX in 2.49 we make the pin to dis/appear. In 2.50 may be better to simply enable/disable it - if (RNA_boolean_get(logic_ptr, "actuators_show_active_states") && (RNA_boolean_get(ptr, "expanded") || RNA_boolean_get(ptr, "pinned"))) - uiItemR(row, ptr, "pinned", UI_ITEM_R_NO_BG, "", 0); + subrow= uiLayoutRow(row, 0); + uiLayoutSetActive(subrow, (RNA_boolean_get(logic_ptr, "actuators_show_active_states") + && RNA_boolean_get(ptr, "expanded") || RNA_boolean_get(ptr, "pinned"))); + uiItemR(subrow, ptr, "pinned", UI_ITEM_R_NO_BG, "", 0); uiItemO(row, "", ICON_X, "LOGIC_OT_actuator_remove"); } |