refactor(theme): Introduce semantic theme layer and clean NERV cruft from gui_2.py
This commit is contained in:
@@ -86,6 +86,21 @@ class _ScopePopup:
|
||||
imgui.end_popup()
|
||||
return False
|
||||
|
||||
def popup_modal(name: str, visible: bool = True, flags: int = 0): return _ScopePopupModal(name, visible, flags)
|
||||
class _ScopePopupModal:
|
||||
def __init__(self, name: str, visible: bool, flags: int):
|
||||
self._name = name
|
||||
self._visible = visible
|
||||
self._flags = flags
|
||||
self._active = False
|
||||
def __enter__(self):
|
||||
self._active, self._visible = imgui.begin_popup_modal(self._name, self._visible, self._flags)
|
||||
return self._active, self._visible
|
||||
def __exit__(self, *args):
|
||||
if self._active:
|
||||
imgui.end_popup()
|
||||
return False
|
||||
|
||||
def tooltip(): return _ScopeTooltip()
|
||||
class _ScopeTooltip:
|
||||
def __enter__(self):
|
||||
|
||||
Reference in New Issue
Block a user