summaryrefslogtreecommitdiffhomepage
path: root/editor/inspect.hpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2023-05-25 11:49:03 +0200
committerStanislaw Halik <sthalik@misaki.pl>2023-05-25 11:49:03 +0200
commit3562ee6ef75d3ff436d9fb38f8a4ea83329162ec (patch)
treeef40618fb3be8480abe522bc19011f4e9af1a553 /editor/inspect.hpp
parent08cafb27a68de54feb0945f46f20fcc48b113379 (diff)
editor/inspect: adjust label width dynamically
Diffstat (limited to 'editor/inspect.hpp')
-rw-r--r--editor/inspect.hpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/editor/inspect.hpp b/editor/inspect.hpp
index f7769fae..de572666 100644
--- a/editor/inspect.hpp
+++ b/editor/inspect.hpp
@@ -26,16 +26,19 @@ template<typename T> using field_repr_slider = field_repr_<T, field_repr, field_
template<typename T> using field_repr_drag = field_repr_<T, field_repr, field_repr::drag>;
template<typename T> using field_repr_cbx = field_repr_<T, field_repr, field_repr::cbx>;
-template<typename T> bool inspect_field(void* datum, const entities::erased_accessor& accessor,
- const ArrayView<const std::pair<StringView, size_t>>& list);
bool inspect_entity_subtype(entity& x);
+template<typename T> bool inspect_field(void* datum, const entities::erased_accessor& accessor,
+ const ArrayView<const std::pair<StringView, size_t>>& list,
+ size_t label_width);
+
template<typename T>
requires std::is_enum_v<T>
bool inspect_field(void* datum, const entities::erased_accessor& accessor,
- const ArrayView<const std::pair<StringView, size_t>>& list)
+ const ArrayView<const std::pair<StringView, size_t>>& list,
+ size_t label_width)
{
- return inspect_field<field_repr_cbx<std::underlying_type_t<T>>>(datum, accessor, list);
+ return inspect_field<field_repr_cbx<std::underlying_type_t<T>>>(datum, accessor, list, label_width);
}
} // namespace floormat::entities