mirror of
https://github.com/nerfstudio-project/nerfstudio.git
synced 2026-12-02 05:48:57 +08:00
Improve viewer element types (#1743)
This commit is contained in:
1 parent
db03d5792e
commit
2ddb2631b5
5 files changed
+76
-56
No files matched your search
@@ -180,15 +180,17 @@ class GuiSelectHandle(GuiHandle[TString], Generic[TString]):
|
||||
inferred where possible when handles are instantiated; for the most flexibility,
|
||||
we can declare handles as `GuiHandle[str]`.
|
||||
"""
|
||||
overwrite_value = False
|
||||
|
||||
# Make sure initial value is in options.
|
||||
self._impl.leva_conf["options"] = options
|
||||
if self._impl.leva_conf["value"] not in options:
|
||||
self._impl.leva_conf["value"] = options[0]
|
||||
overwrite_value = True
|
||||
|
||||
# Update options.
|
||||
self._impl.api._queue(
|
||||
GuiSetLevaConfMessage(self._impl.name, self._impl.leva_conf),
|
||||
)
|
||||
|
||||
if overwrite_value:
|
||||
# Make sure current value is in options.
|
||||
if self.get_value() not in options:
|
||||
self.set_value(options[0])
|
||||
Reference in new issue
Block a user