[Bf-blender-cvs] [886d28f3426] temp-spreadsheet-editor: initial header drawing

Jacques Lucke noreply at git.blender.org
Mon Feb 22 13:12:49 CET 2021


Commit: 886d28f34268f1a5c306526435aebeb699b52368
Author: Jacques Lucke
Date:   Mon Feb 22 12:47:26 2021 +0100
Branches: temp-spreadsheet-editor
https://developer.blender.org/rB886d28f34268f1a5c306526435aebeb699b52368

initial header drawing

===================================================================

M	release/scripts/startup/bl_ui/__init__.py
A	release/scripts/startup/bl_ui/space_spreadsheet.py
M	source/blender/editors/space_spreadsheet/space_spreadsheet.cc
M	source/blender/makesrna/intern/rna_space.c

===================================================================

diff --git a/release/scripts/startup/bl_ui/__init__.py b/release/scripts/startup/bl_ui/__init__.py
index 7d3ecceca41..b3131e64df7 100644
--- a/release/scripts/startup/bl_ui/__init__.py
+++ b/release/scripts/startup/bl_ui/__init__.py
@@ -86,6 +86,7 @@ _modules = [
     "space_outliner",
     "space_properties",
     "space_sequencer",
+    "space_spreadsheet",
     "space_statusbar",
     "space_text",
     "space_time",
diff --git a/release/scripts/startup/bl_ui/space_spreadsheet.py b/release/scripts/startup/bl_ui/space_spreadsheet.py
new file mode 100644
index 00000000000..23bfa98a193
--- /dev/null
+++ b/release/scripts/startup/bl_ui/space_spreadsheet.py
@@ -0,0 +1,37 @@
+# ##### BEGIN GPL LICENSE BLOCK #####
+#
+#  This program is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU General Public License
+#  as published by the Free Software Foundation; either version 2
+#  of the License, or (at your option) any later version.
+#
+#  This program is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#  GNU General Public License for more details.
+#
+#  You should have received a copy of the GNU General Public License
+#  along with this program; if not, write to the Free Software Foundation,
+#  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+# ##### END GPL LICENSE BLOCK #####
+
+import bpy
+
+
+class SPREADSHEET_HT_header(bpy.types.Header):
+    bl_space_type = 'SPREADSHEET'
+
+    def draw(self, context):
+        layout = self.layout
+
+        layout.template_header()
+
+classes = (
+    SPREADSHEET_HT_header,
+)
+
+if __name__ == "__main__":  # only for live edit.
+    from bpy.utils import register_class
+    for cls in classes:
+        register_class(cls)
diff --git a/source/blender/editors/space_spreadsheet/space_spreadsheet.cc b/source/blender/editors/space_spreadsheet/space_spreadsheet.cc
index 6e96954e420..9c263734e59 100644
--- a/source/blender/editors/space_spreadsheet/space_spreadsheet.cc
+++ b/source/blender/editors/space_spreadsheet/space_spreadsheet.cc
@@ -124,6 +124,7 @@ void ED_spacetype_spreadsheet(void)
   art->regionid = RGN_TYPE_HEADER;
   art->prefsizey = HEADERY;
   art->keymapflag = 0;
+  art->keymapflag = ED_KEYMAP_UI | ED_KEYMAP_VIEW2D | ED_KEYMAP_HEADER;
 
   art->init = spreadsheet_header_region_init;
   art->draw = spreadsheet_header_region_draw;
diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c
index f07bac753a2..1c6fba9a14a 100644
--- a/source/blender/makesrna/intern/rna_space.c
+++ b/source/blender/makesrna/intern/rna_space.c
@@ -147,7 +147,7 @@ const EnumPropertyItem rna_enum_space_type_items[] = {
     {SPACE_FILE, "FILE_BROWSER", ICON_FILEBROWSER, "File Browser", "Browse for files and assets"},
     {SPACE_SPREADSHEET,
      "SPREADSHEET",
-     ICON_NONE,
+     ICON_MOD_WIREFRAME, /* TODO: Use correct icon. */
      "Spreadsheet",
      "Explore geometry data in a table"},
     {SPACE_USERPREF,



More information about the Bf-blender-cvs mailing list