feat(gui): Implement tabbed interface for discussion takes
This commit is contained in:
16
src/gui_2.py
16
src/gui_2.py
@@ -2309,14 +2309,16 @@ def hello():
|
||||
return
|
||||
if not self.is_viewing_prior_session and imgui.collapsing_header("Discussions", imgui.TreeNodeFlags_.default_open):
|
||||
names = self._get_discussion_names()
|
||||
if imgui.begin_combo("##disc_sel", self.active_discussion):
|
||||
if imgui.begin_tab_bar("discussion_takes_tabs"):
|
||||
for name in names:
|
||||
is_selected = (name == self.active_discussion)
|
||||
if imgui.selectable(name, is_selected)[0]:
|
||||
self._switch_discussion(name)
|
||||
if is_selected:
|
||||
imgui.set_item_default_focus()
|
||||
imgui.end_combo()
|
||||
# Only force selection if active_discussion changed externally
|
||||
flags = imgui.TabItemFlags_.set_selected if name == self.active_discussion else 0
|
||||
opened, _ = imgui.begin_tab_item(name, None, flags)
|
||||
if opened:
|
||||
if name != self.active_discussion:
|
||||
self._switch_discussion(name)
|
||||
imgui.end_tab_item()
|
||||
imgui.end_tab_bar()
|
||||
if self.active_track:
|
||||
imgui.same_line()
|
||||
changed, self._track_discussion_active = imgui.checkbox("Track Discussion", self._track_discussion_active)
|
||||
|
||||
Reference in New Issue
Block a user