diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2024-04-08 17:05:16 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2024-04-08 19:40:10 +0200 |
commit | 064379bd0bd929f6b87c50f740e9a783b4d9e054 (patch) | |
tree | b717428ace85bde06fff19ac96b11d95787b538f /editor/inspect.cpp | |
parent | 4eefaf4e12199c071d2e6ee0d99b46d2e1d45557 (diff) |
a
Diffstat (limited to 'editor/inspect.cpp')
-rw-r--r-- | editor/inspect.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/editor/inspect.cpp b/editor/inspect.cpp index c4345bcf..470c5bd2 100644 --- a/editor/inspect.cpp +++ b/editor/inspect.cpp @@ -75,13 +75,15 @@ bool do_inspect_field(void* datum, const erased_accessor& accessor, field_repr r char buf[128]; bool should_disable = false; - switch (accessor.is_enabled(datum)) + const auto enabled = accessor.is_enabled(datum); + fm_assert(enabled < field_status::COUNT); + switch (enabled) { using enum field_status; + case COUNT: fm_assert(false); case hidden: return false; case readonly: should_disable = true; break; case enabled: should_disable = false; break; - default: fm_assert(false); } should_disable = should_disable || !accessor.can_write(); [[maybe_unused]] auto disabler = begin_disabled(should_disable); |