Skip to content

Fix imgui popup menus #695

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jan 26, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions fastplotlib/ui/_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,8 +248,6 @@ def __init__(self, figure: Figure, *args, **kwargs):
self._figure = figure
self._fa_icons = self._figure._fa_icons

self._event_filter_names = set()

self.is_open = False

def open(self, pos: tuple[int, int], *args, **kwargs):
Expand Down
2 changes: 1 addition & 1 deletion fastplotlib/ui/right_click_menus/_colormap_picker.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ def update(self):
* imgui.get_font().font_size
) - 2

if imgui.menu_item("Reset vmin-vmax", None, False)[0]:
if imgui.menu_item("Reset vmin-vmax", "", False)[0]:
self._lut_tool.image_graphic.reset_vmin_vmax()

# add all the cmap options
Expand Down
16 changes: 9 additions & 7 deletions fastplotlib/ui/right_click_menus/_standard_menu.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,14 +82,14 @@ def update(self):
imgui.separator()

# autoscale, center, maintain aspect
if imgui.menu_item(f"Autoscale", None, False)[0]:
if imgui.menu_item(f"Autoscale", "", False)[0]:
self.get_subplot().auto_scale()

if imgui.menu_item(f"Center", None, False)[0]:
if imgui.menu_item(f"Center", "", False)[0]:
self.get_subplot().center_scene()

_, maintain_aspect = imgui.menu_item(
"Maintain Aspect", None, self.get_subplot().camera.maintain_aspect
"Maintain Aspect", "", self.get_subplot().camera.maintain_aspect
)
self.get_subplot().camera.maintain_aspect = maintain_aspect

Expand All @@ -98,7 +98,9 @@ def update(self):
# toggles to flip axes cameras
for axis in ["x", "y", "z"]:
scale = getattr(self.get_subplot().camera.local, f"scale_{axis}")
changed, flip = imgui.menu_item(f"Flip {axis} axis", None, scale < 0)
changed, flip = imgui.menu_item(
f"Flip {axis} axis", "", bool(scale < 0)
)

if changed:
flip_axis(self.get_subplot(), axis, flip)
Expand All @@ -109,7 +111,7 @@ def update(self):
for plane in ["xy", "xz", "yz"]:
grid = getattr(self.get_subplot().axes.grids, plane)
visible = grid.visible
changed, new_visible = imgui.menu_item(f"Grid {plane}", None, visible)
changed, new_visible = imgui.menu_item(f"Grid {plane}", "", visible)

if changed:
grid.visible = new_visible
Expand Down Expand Up @@ -140,7 +142,7 @@ def update(self):
# controller options
if imgui.begin_menu("Controller"):
_, enabled = imgui.menu_item(
"Enabled", None, self.get_subplot().controller.enabled
"Enabled", "", self.get_subplot().controller.enabled
)

self.get_subplot().controller.enabled = enabled
Expand All @@ -163,7 +165,7 @@ def update(self):

clicked, _ = imgui.menu_item(
label=name,
shortcut=None,
shortcut="",
p_selected=current_type is controller_type_iter,
)

Expand Down
Loading
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy