-m
This commit is contained in:
parent
b9b8e3a5f1
commit
6c8a2526d9
40 changed files with 219 additions and 141 deletions
|
@ -1,6 +1,5 @@
|
|||
import tkinter as tk
|
||||
from tkinter import ttk
|
||||
from typing import Optional
|
||||
|
||||
from core.gui.themes import Styles
|
||||
|
||||
|
@ -19,10 +18,10 @@ class Tooltip(object):
|
|||
self.id = None
|
||||
self.tw = None
|
||||
|
||||
def on_enter(self, event: Optional[tk.Event] = None):
|
||||
def on_enter(self, event: tk.Event = None):
|
||||
self.schedule()
|
||||
|
||||
def on_leave(self, event: Optional[tk.Event] = None):
|
||||
def on_leave(self, event: tk.Event = None):
|
||||
self.unschedule()
|
||||
self.close(event)
|
||||
|
||||
|
@ -36,7 +35,7 @@ class Tooltip(object):
|
|||
if id_:
|
||||
self.widget.after_cancel(id_)
|
||||
|
||||
def enter(self, event: Optional[tk.Event] = None):
|
||||
def enter(self, event: tk.Event = None):
|
||||
x, y, cx, cy = self.widget.bbox("insert")
|
||||
x += self.widget.winfo_rootx()
|
||||
y += self.widget.winfo_rooty() + 32
|
||||
|
@ -51,6 +50,6 @@ class Tooltip(object):
|
|||
label = ttk.Label(frame, text=self.text, style=Styles.tooltip)
|
||||
label.grid()
|
||||
|
||||
def close(self, event: Optional[tk.Event] = None):
|
||||
def close(self, event: tk.Event = None):
|
||||
if self.tw:
|
||||
self.tw.destroy()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue