chore: revert Files & Media to original working code
This commit is contained in:
+16
-29
@@ -760,8 +760,7 @@ class App:
|
||||
ts_str = datetime.datetime.fromtimestamp(ts).strftime("%H:%M:%S")
|
||||
|
||||
label = f"[{ts_str}] {desc}##{actual_idx}"
|
||||
_, selected = imgui.selectable(label, False)
|
||||
if selected:
|
||||
if imgui.selectable(label)[0]:
|
||||
self._handle_jump_to_history(actual_idx)
|
||||
imgui.end_child()
|
||||
imgui.end()
|
||||
@@ -873,13 +872,11 @@ class App:
|
||||
exp, opened = imgui.begin("Files & Media", self.show_windows["Files & Media"])
|
||||
self.show_windows["Files & Media"] = bool(opened)
|
||||
if exp:
|
||||
files_open = imgui.collapsing_header("Files", imgui.TreeNodeFlags_.default_open)
|
||||
if files_open:
|
||||
if imgui.collapsing_header("Files"):
|
||||
self._render_files_panel()
|
||||
shots_open = imgui.collapsing_header("Screenshots", imgui.TreeNodeFlags_.default_open)
|
||||
if shots_open:
|
||||
if imgui.collapsing_header("Screenshots"):
|
||||
self._render_screenshots_panel()
|
||||
imgui.end()
|
||||
imgui.end()
|
||||
if self.show_windows.get("AI Settings", False):
|
||||
exp, opened = imgui.begin("AI Settings", self.show_windows["AI Settings"])
|
||||
self.show_windows["AI Settings"] = bool(opened)
|
||||
@@ -1762,18 +1759,10 @@ class App:
|
||||
imgui.end_table()
|
||||
|
||||
rem_y = imgui.get_content_region_avail().y - 80
|
||||
if self._tool_list_open and self._bias_list_open:
|
||||
h1, h2 = rem_y * self._tool_split_v, rem_y - (rem_y * self._tool_split_v) - 10
|
||||
h1 = min(h1, max(200, rem_y * 0.3))
|
||||
h2 = min(h2, max(150, rem_y * 0.5))
|
||||
elif self._tool_list_open:
|
||||
h1 = min(rem_y, 400)
|
||||
h2 = 0
|
||||
elif self._bias_list_open:
|
||||
h1 = 0
|
||||
h2 = min(rem_y, 400)
|
||||
else:
|
||||
h1, h2 = 0, 0
|
||||
if self._tool_list_open and self._bias_list_open: h1, h2 = rem_y * self._tool_split_v, rem_y - (rem_y * self._tool_split_v) - 10
|
||||
elif self._tool_list_open: h1, h2 = rem_y, 0
|
||||
elif self._bias_list_open: h1, h2 = 0, rem_y
|
||||
else: h1, h2 = 0, 0
|
||||
|
||||
imgui.dummy(imgui.ImVec2(0, 4))
|
||||
opened_t = imgui.collapsing_header("Categories & Tools", imgui.TreeNodeFlags_.default_open)
|
||||
@@ -1800,11 +1789,11 @@ class App:
|
||||
if tool: curr_cat_tools.remove(tool)
|
||||
imgui.same_line();
|
||||
if imgui.radio_button(f"Auto##{cat_name}_{tool_name}", mode == "auto"):
|
||||
if not tool: tool = models.Tool(name=tool_name, approval="auto"); curr_cat_tools.append(tool)
|
||||
if not tool: tool = models.Tool(name=tool_name, approval="auto"); current_cat_tools.append(tool)
|
||||
else: tool.approval = "auto"
|
||||
imgui.same_line();
|
||||
if imgui.radio_button(f"Ask##{cat_name}_{tool_name}", mode == "ask"):
|
||||
if not tool: tool = models.Tool(name=tool_name, approval="ask"); curr_cat_tools.append(tool)
|
||||
if not tool: tool = models.Tool(name=tool_name, approval="ask"); current_cat_tools.append(tool)
|
||||
else: tool.approval = "ask"
|
||||
imgui.end_table()
|
||||
imgui.tree_pop()
|
||||
@@ -1857,9 +1846,9 @@ class App:
|
||||
imgui.end_table()
|
||||
imgui.tree_pop()
|
||||
imgui.end_child()
|
||||
if self._bias_cats_open:
|
||||
imgui.button("###bias_splitter", imgui.ImVec2(-1, 4))
|
||||
if imgui.is_item_active(): self._bias_split_v = max(0.1, min(0.9, self._bias_split_v + imgui.get_io().mouse_delta.y / rem_bias_y))
|
||||
if self._bias_cats_open:
|
||||
imgui.button("###bias_splitter", imgui.ImVec2(-1, 4))
|
||||
if imgui.is_item_active(): self._bias_split_v = max(0.1, min(0.9, self._bias_split_v + imgui.get_io().mouse_delta.y / rem_bias_y))
|
||||
|
||||
opened_bc = imgui.collapsing_header("Category Multipliers", imgui.TreeNodeFlags_.default_open)
|
||||
if opened_bc != self._bias_cats_open: self._bias_cats_open = opened_bc
|
||||
@@ -1963,8 +1952,6 @@ class App:
|
||||
elif self._persona_models_open: h1, h2 = rem_y, 0
|
||||
elif self._persona_prompt_open: h1, h2 = 0, rem_y
|
||||
else: h1, h2 = 0, 0
|
||||
h1 = min(h1, 300)
|
||||
h2 = min(h2, 300)
|
||||
|
||||
imgui.dummy(imgui.ImVec2(0, 4))
|
||||
opened_models = imgui.collapsing_header("Preferred Models", imgui.TreeNodeFlags_.default_open)
|
||||
@@ -2009,7 +1996,7 @@ class App:
|
||||
imgui.pop_id()
|
||||
for i in reversed(to_remove): self._editing_persona_preferred_models_list.pop(i)
|
||||
imgui.end_child()
|
||||
if self._persona_models_open and self._persona_prompt_open:
|
||||
if self._persona_prompt_open:
|
||||
imgui.button("###persona_splitter", imgui.ImVec2(-1, 4))
|
||||
if imgui.is_item_active(): self._persona_split_v = max(0.1, min(0.9, self._persona_split_v + imgui.get_io().mouse_delta.y / rem_y))
|
||||
|
||||
@@ -2933,7 +2920,7 @@ def hello():
|
||||
r.destroy()
|
||||
if d: self.ui_files_base_dir = d
|
||||
imgui.separator()
|
||||
imgui.begin_child("f_paths", imgui.ImVec2(0, min(len(self.files) * 30 + 50, 300)), True)
|
||||
imgui.begin_child("f_paths", imgui.ImVec2(0, -40), True)
|
||||
if imgui.begin_table("files_table", 4, imgui.TableFlags_.resizable | imgui.TableFlags_.borders):
|
||||
imgui.table_setup_column("Actions", imgui.TableColumnFlags_.width_fixed, 40)
|
||||
imgui.table_setup_column("File Path", imgui.TableColumnFlags_.width_stretch)
|
||||
@@ -3006,7 +2993,7 @@ def hello():
|
||||
r.destroy()
|
||||
if d: self.ui_shots_base_dir = d
|
||||
imgui.separator()
|
||||
imgui.begin_child("s_paths", imgui.ImVec2(0, min(len(self.screenshots) * 30 + 50, 300)), True)
|
||||
imgui.begin_child("s_paths", imgui.ImVec2(0, -40), True)
|
||||
for i, s in enumerate(self.screenshots):
|
||||
if imgui.button(f"x##s{i}"):
|
||||
self.screenshots.pop(i)
|
||||
|
||||
Reference in New Issue
Block a user