Skip to content

Commit

Permalink
remove -> close; shown/total in tree
Browse files Browse the repository at this point in the history
  • Loading branch information
aoterodelaroza committed Jan 19, 2024
1 parent d6ebf21 commit 3c6bc48
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/gui/[email protected]
Original file line number Diff line number Diff line change
Expand Up @@ -201,8 +201,8 @@ module subroutine draw_tree(w)
call igSameLine(0._c_float,-1._c_float)

! text filter
call igGetContentRegionAvail(sz)
width = max(sz%x - iw_calcwidth(12+5,1) - g%Style%WindowPadding%x,1._c_float)
call igGetContentRegionAvail(sz) ! Clear ... xxxx/xxxx shown
width = max(sz%x - iw_calcwidth(16+5,1) - g%Style%WindowPadding%x,1._c_float)
if (.not.c_associated(cfilter)) &
cfilter = ImGuiTextFilter_ImGuiTextFilter(c_loc(zeroc))
str = "##treefilter" // c_null_char
Expand All @@ -215,7 +215,6 @@ module subroutine draw_tree(w)
call ImGuiTextFilter_Clear(cfilter)
end if
call iw_tooltip("Clear the filter",ttshown)
call iw_text(" " // string(shown_after_filter) // " shown",sameline=.true.)

! process force options
if (allocated(w%forceremove)) then
Expand Down Expand Up @@ -297,6 +296,10 @@ module subroutine draw_tree(w)
end if
nshown = size(w%iord,1)

! final message in the header line
call iw_text(" " // string(shown_after_filter) // "/" // string(nshown) // " shown",&
sameline=.true.)

! set up the table, style and flags
sz%x = 3._c_float
sz%y = 1._c_float
Expand Down Expand Up @@ -1039,10 +1042,10 @@ subroutine write_maybe_selectable(isys,bclose,bexpand)
end if

! remove option (system)
strpop = "Remove" // c_null_char
strpop = "Close" // c_null_char
if (igMenuItem_Bool(c_loc(strpop),c_null_ptr,.false._c_bool,enabled)) &
w%forceremove = (/isys/)
call iw_tooltip("Remove this system",ttshown)
call iw_tooltip("Close this system",ttshown)

call igEndPopup()
end if
Expand All @@ -1051,7 +1054,7 @@ subroutine write_maybe_selectable(isys,bclose,bexpand)
if (igIsItemHovered_delayed(ImGuiHoveredFlags_None,tooltip_delay,ttshown)) then
if (igIsMouseHoveringRect(g%LastItemData%NavRect%min,g%LastItemData%NavRect%max,.false._c_bool)) then
if (bclose) then
strl = "Remove this system" // c_null_char
strl = "Close this system" // c_null_char
elseif (bexpand) then
strl = "Expand this system" // c_null_char
else
Expand Down

0 comments on commit 3c6bc48

Please sign in to comment.