Skip to content

Commit

Permalink
Tooltips go off-screen Akuli#1224
Browse files Browse the repository at this point in the history
 consolidate code
  • Loading branch information
lawson89 committed Oct 13, 2023
1 parent f7757fc commit c8b3c57
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions porcupine/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,11 +174,9 @@ def show(self) -> None:
# colors at all or both foreground and background. Otherwise
# the label will have light text on a light background or
# dark text on a dark background on some systems.
label = tkinter.Label(tipwindow, text=self.text, border=3, fg="black", bg="white")
label.pack()
tkinter.Label(tipwindow, text=self.text, border=3, fg="black", bg="white").pack()
tipwindow.update()
tw_width = tipwindow.winfo_width()
tipwindow.geometry(f"+{self.mousex - tw_width}+{self.mousey - 30}")
tipwindow.geometry(f"+{self.mousex - tipwindow.winfo_width()}+{self.mousey - 30}")


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

0 comments on commit c8b3c57

Please sign in to comment.