starting to get decent compression
This commit is contained in:
+3
-9
@@ -914,15 +914,9 @@ class App:
|
|||||||
if self.show_windows.get("Project Settings", False):
|
if self.show_windows.get("Project Settings", False):
|
||||||
with imscope.window("Project Settings", self.show_windows["Project Settings"]) as (exp, opened):
|
with imscope.window("Project Settings", self.show_windows["Project Settings"]) as (exp, opened):
|
||||||
self.show_windows["Project Settings"] = bool(opened)
|
self.show_windows["Project Settings"] = bool(opened)
|
||||||
if exp:
|
if exp and imscope.tab_bar('context_hub_tabs'):
|
||||||
if imgui.begin_tab_bar('context_hub_tabs'):
|
if imscope.tab_item('Projects'): self._render_projects_panel()
|
||||||
if imgui.begin_tab_item('Projects')[0]:
|
if imscope.tab_item('Paths'): self._render_paths_panel()
|
||||||
self._render_projects_panel()
|
|
||||||
imgui.end_tab_item()
|
|
||||||
if imgui.begin_tab_item('Paths')[0]:
|
|
||||||
self._render_paths_panel()
|
|
||||||
imgui.end_tab_item()
|
|
||||||
imgui.end_tab_bar()
|
|
||||||
#endregion: Project Settings
|
#endregion: Project Settings
|
||||||
|
|
||||||
#region: Files & Media window
|
#region: Files & Media window
|
||||||
|
|||||||
@@ -114,3 +114,28 @@ class _ScopeId:
|
|||||||
def __exit__(self, *args):
|
def __exit__(self, *args):
|
||||||
imgui.pop_id()
|
imgui.pop_id()
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
def tab_bar(id_str: str, flags: int = 0): return _ScopeTabBar(id_str, flags)
|
||||||
|
class _ScopeTabBar:
|
||||||
|
def __init__(self, id_str: str, flags: int):
|
||||||
|
self._id = id_str
|
||||||
|
self._flags = flags
|
||||||
|
def __enter__(self):
|
||||||
|
return imgui.begin_tab_bar(self._id, self._flags)
|
||||||
|
def __exit__(self, *args):
|
||||||
|
imgui.end_tab_bar()
|
||||||
|
return False
|
||||||
|
|
||||||
|
def tab_item(label: str, flags: int = 0): return _ScopeTabItem(label, flags)
|
||||||
|
class _ScopeTabItem:
|
||||||
|
def __init__(self, label: str, flags: int):
|
||||||
|
self._label = label
|
||||||
|
self._flags = flags
|
||||||
|
self._open = None
|
||||||
|
def __enter__(self):
|
||||||
|
self._open = imgui.begin_tab_item(self._label, self._flags)
|
||||||
|
return self._open
|
||||||
|
def __exit__(self, *args):
|
||||||
|
if self._open[0]:
|
||||||
|
imgui.end_tab_item()
|
||||||
|
return False
|
||||||
|
|||||||
Reference in New Issue
Block a user