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

Feature/tooltips offscreen #1412

Merged
merged 5 commits into from
Oct 14, 2023
Merged
Changes from 2 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
3 changes: 2 additions & 1 deletion porcupine/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,6 @@ def show(self) -> None:
if self.got_mouse:
self.destroy_tipwindow()
tipwindow = type(self).tipwindow = tkinter.Toplevel()
tipwindow.geometry(f"+{self.mousex + 10}+{self.mousey - 10}")
tipwindow.bind("<Motion>", self.destroy_tipwindow, add=True)
tipwindow.overrideredirect(True)

Expand All @@ -176,6 +175,8 @@ def show(self) -> None:
# the label will have light text on a light background or
# dark text on a dark background on some systems.
tkinter.Label(tipwindow, text=self.text, border=3, fg="black", bg="white").pack()
tipwindow.update()
rdbende marked this conversation as resolved.
Show resolved Hide resolved
tipwindow.geometry(f"+{self.mousex - tipwindow.winfo_width()}+{self.mousey - 30}")


def set_tooltip(widget: tkinter.Widget, text: str) -> None:
Expand Down
Loading