Skip to content
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

right-click menu placing #1447

Merged
merged 7 commits into from
Mar 11, 2024
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: 1 addition & 1 deletion porcupine/plugins/directory_tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ def _on_right_click(self, event: tkinter.Event[DirectoryTree], menu_key: bool) -
self._populate_contextmenu()
if self.contextmenu.index("end") is not None:
# Menu is not empty
self.contextmenu.tk_popup(menu_x, menu_y)
self.contextmenu.tk_popup(menu_x + 10, menu_y + 10)
return "break"


Expand Down
3 changes: 2 additions & 1 deletion porcupine/plugins/jump_to_definition.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,10 @@ def find_cursor_xy(textwidget: tkinter.Text) -> tuple[int, int]:

# Make coords relative to top left corner of screen, not text widget
left += textwidget.winfo_rootx()

top += textwidget.winfo_rooty()

return (left, top + height)
return (left + 10, top + height + 10)


def receive_jump(event: utils.EventWithData) -> None:
Expand Down
2 changes: 1 addition & 1 deletion porcupine/plugins/rightclick_menu.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def create_menu() -> tkinter.Menu:

def show_menu(event: tkinter.Event[tkinter.Misc]) -> None:
rm = create_menu()
rm.tk_popup(event.x_root, event.y_root)
rm.tk_popup(event.x_root + 10, event.y_root + 10)
rm.bind("<Unmap>", (lambda event: rm.after_idle(rm.destroy)), add=True)


Expand Down
2 changes: 1 addition & 1 deletion porcupine/plugins/tab_closing.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def show_menu(event: tkinter.Event[tabs.TabManager]) -> None:
label="Close other tabs", command=partial(close_clicked_tab, event, what2close="others")
)

menu.tk_popup(event.x_root, event.y_root)
menu.tk_popup(event.x_root + 10, event.y_root + 10)
menu.bind("<Unmap>", (lambda event: menu.after_idle(menu.destroy)), add=True)


Expand Down
Loading