diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-05-14 13:17:43 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-05-14 13:21:27 +0300 |
commit | 9fecac32d9e9f3e6dd69f89fe4ceaddcecaf1277 (patch) | |
tree | 42f291a81e9f207b36071b1e968bc472aa9981de /source/blender/makesrna/intern/rna_space.c | |
parent | 4887b771f9ded1d2eb006e5e1df37595391e2760 (diff) |
Screen: replace show footer operator with property
This matches 'show header' internal logic.
Diffstat (limited to 'source/blender/makesrna/intern/rna_space.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_space.c | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c index 0eb5b52baf0..b425dce86f0 100644 --- a/source/blender/makesrna/intern/rna_space.c +++ b/source/blender/makesrna/intern/rna_space.c @@ -644,6 +644,20 @@ static void rna_Space_show_region_header_update(bContext *C, PointerRNA *ptr) rna_Space_bool_from_region_flag_update_by_type(C, ptr, RGN_TYPE_HEADER, RGN_FLAG_HIDDEN); } +/* Footer Region. */ +static bool rna_Space_show_region_footer_get(PointerRNA *ptr) +{ + return !rna_Space_bool_from_region_flag_get_by_type(ptr, RGN_TYPE_FOOTER, RGN_FLAG_HIDDEN); +} +static void rna_Space_show_region_footer_set(PointerRNA *ptr, bool value) +{ + rna_Space_bool_from_region_flag_set_by_type(ptr, RGN_TYPE_FOOTER, RGN_FLAG_HIDDEN, !value); +} +static void rna_Space_show_region_footer_update(bContext *C, PointerRNA *ptr) +{ + rna_Space_bool_from_region_flag_update_by_type(C, ptr, RGN_TYPE_FOOTER, RGN_FLAG_HIDDEN); +} + /* Tool Header Region. * * This depends on the 'RGN_TYPE_TOOL_HEADER' @@ -2460,6 +2474,10 @@ static void rna_def_space_generic_show_region_toggles(StructRNA *srna, int regio region_type_mask &= ~(1 << RGN_TYPE_HEADER); DEF_SHOW_REGION_PROPERTY(show_region_header, "Header", ""); } + if (region_type_mask & (1 << RGN_TYPE_FOOTER)) { + region_type_mask &= ~(1 << RGN_TYPE_FOOTER); + DEF_SHOW_REGION_PROPERTY(show_region_footer, "Footer", ""); + } if (region_type_mask & (1 << RGN_TYPE_TOOLS)) { region_type_mask &= ~(1 << RGN_TYPE_TOOLS); DEF_SHOW_REGION_PROPERTY(show_region_toolbar, "Toolbar", ""); @@ -4508,7 +4526,7 @@ static void rna_def_space_text(BlenderRNA *brna) RNA_def_struct_sdna(srna, "SpaceText"); RNA_def_struct_ui_text(srna, "Space Text Editor", "Text editor space data"); - rna_def_space_generic_show_region_toggles(srna, (1 << RGN_TYPE_UI)); + rna_def_space_generic_show_region_toggles(srna, (1 << RGN_TYPE_UI) | (1 << RGN_TYPE_FOOTER)); /* text */ prop = RNA_def_property(srna, "text", PROP_POINTER, PROP_NONE); |