Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHarley Acheson <harley.acheson@gmail.com>2020-07-18 17:49:25 +0300
committerHarley Acheson <harley.acheson@gmail.com>2020-07-18 17:49:25 +0300
commitc08d847488048e9d5233bfd14e363de574332846 (patch)
tree59cd059ab1d146db2cebd8051319009adfcd5ea4 /source/blender/makesrna/intern/rna_screen.c
parentfe49e4139cd3f78f126b60ea4240a0294eac9483 (diff)
UI: Status Bar Statistics and Other Options
Status Bar can show scene statistics, memory usage, version, etc set by context menu. Part two of T75672. Differential Revision: https://developer.blender.org/D7557 Reviewed by Julian Eisel
Diffstat (limited to 'source/blender/makesrna/intern/rna_screen.c')
-rw-r--r--source/blender/makesrna/intern/rna_screen.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/source/blender/makesrna/intern/rna_screen.c b/source/blender/makesrna/intern/rna_screen.c
index ea6421c8d11..2b65bf4922c 100644
--- a/source/blender/makesrna/intern/rna_screen.c
+++ b/source/blender/makesrna/intern/rna_screen.c
@@ -30,6 +30,8 @@
#include "DNA_screen_types.h"
#include "DNA_workspace_types.h"
+#include "ED_info.h"
+
const EnumPropertyItem rna_enum_region_type_items[] = {
{RGN_TYPE_WINDOW, "WINDOW", 0, "Window", ""},
{RGN_TYPE_HEADER, "HEADER", 0, "Header", ""},
@@ -286,6 +288,11 @@ static void rna_View2D_view_to_region(
}
}
+static const char *rna_Screen_statusbar_info_get(struct bScreen *screen, Main *bmain, bContext *C)
+{
+ return ED_info_statusbar_string(bmain, screen, C);
+}
+
#else
/* Area.spaces */
@@ -536,6 +543,9 @@ static void rna_def_screen(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
+ FunctionRNA *func;
+ PropertyRNA *parm;
+
srna = RNA_def_struct(brna, "Screen", "ID");
RNA_def_struct_sdna(srna, "Screen"); /* it is actually bScreen but for 2.5 the dna is patched! */
RNA_def_struct_ui_text(
@@ -570,11 +580,18 @@ static void rna_def_screen(BlenderRNA *brna)
RNA_def_property_boolean_funcs(prop, "rna_Screen_fullscreen_get", NULL);
RNA_def_property_ui_text(prop, "Maximize", "An area is maximized, filling this screen");
+ /* Status Bar. */
+
prop = RNA_def_property(srna, "show_statusbar", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SCREEN_COLLAPSE_STATUSBAR);
- RNA_def_property_ui_text(prop, "Show Status Bar", "Show status bar");
+ RNA_def_property_ui_text(prop, "Show Status Bar", "Show Status Bar");
RNA_def_property_update(prop, 0, "rna_Screen_bar_update");
+ func = RNA_def_function(srna, "statusbar_info", "rna_Screen_statusbar_info_get");
+ RNA_def_function_flag(func, FUNC_USE_MAIN | FUNC_USE_CONTEXT);
+ parm = RNA_def_string(func, "statusbar_info", NULL, 0, "Status Bar Info", "");
+ RNA_def_function_return(func, parm);
+
/* Define Anim Playback Areas */
prop = RNA_def_property(srna, "use_play_top_left_3d_editor", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "redraws_flag", TIME_REGION);