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:
authorJacques Lucke <jacques@blender.org>2021-03-05 13:38:50 +0300
committerJacques Lucke <jacques@blender.org>2021-03-05 13:38:50 +0300
commita32bf199d41023bec0bdb9b8223d974e8ee36bea (patch)
tree2187e9067c3e3272f953b9c8519cbaaec1b6a7dd /source/blender/editors
parent77136bd7b3a24290354a4a5cebbb0ca2cd59d5bd (diff)
support drawing ints
Diffstat (limited to 'source/blender/editors')
-rw-r--r--source/blender/editors/space_spreadsheet/spreadsheet_from_python.cc19
1 files changed, 19 insertions, 0 deletions
diff --git a/source/blender/editors/space_spreadsheet/spreadsheet_from_python.cc b/source/blender/editors/space_spreadsheet/spreadsheet_from_python.cc
index d4d615ad108..c0dca445e63 100644
--- a/source/blender/editors/space_spreadsheet/spreadsheet_from_python.cc
+++ b/source/blender/editors/space_spreadsheet/spreadsheet_from_python.cc
@@ -117,6 +117,25 @@ class PythonSpreadsheetDrawer : public SpreadsheetDrawer {
0,
nullptr);
}
+ if (PyLong_Check(py_cell_content)) {
+ const int value = PyLong_AsLong(py_cell_content);
+ const std::string value_str = std::to_string(value);
+ uiDefIconTextBut(params.block,
+ UI_BTYPE_LABEL,
+ 0,
+ ICON_NONE,
+ value_str.c_str(),
+ params.xmin,
+ params.ymin,
+ params.width,
+ params.height,
+ nullptr,
+ 0,
+ 0,
+ 0,
+ 0,
+ nullptr);
+ }
}
};