Better UI, edit tags
All checks were successful
Gitea/kapitanbooru-uploader/pipeline/head This commit looks good
All checks were successful
Gitea/kapitanbooru-uploader/pipeline/head This commit looks good
This commit is contained in:
@@ -179,20 +179,24 @@ class TagManager(tk.Frame):
|
||||
based on custom logic.
|
||||
"""
|
||||
|
||||
def __init__(self, master, settings: Settings, tags_repo: TagsRepo, *args, **kwargs):
|
||||
def __init__(
|
||||
self, master, settings: Settings, tags_repo: TagsRepo, *args, **kwargs
|
||||
):
|
||||
super().__init__(master, *args, **kwargs)
|
||||
self.tags_repo = tags_repo
|
||||
self.settings = settings
|
||||
self.manual_tags = [] # List to hold manually entered tags
|
||||
|
||||
# Entry for new tags (with autocompletion)
|
||||
self.entry = AutocompleteEntry(self, callback=self.add_tag, tags_repo=self.tags_repo)
|
||||
self.entry = AutocompleteEntry(
|
||||
self, callback=self.add_tag, tags_repo=self.tags_repo
|
||||
)
|
||||
self.entry.pack(fill=tk.X, padx=5, pady=5)
|
||||
|
||||
# Text widget for displaying already entered tags
|
||||
self.tags_display = tk.Text(self, wrap="word", height=4)
|
||||
self.tags_display = tk.Text(self, wrap=tk.WORD, height=4)
|
||||
self.tags_display.pack(fill=tk.BOTH, expand=True, padx=5, pady=5)
|
||||
self.tags_display.config(state="disabled")
|
||||
self.tags_display.config(state=tk.DISABLED)
|
||||
# (Optional: add a scrollbar if needed)
|
||||
|
||||
def add_tag(self, tag):
|
||||
@@ -229,7 +233,7 @@ class TagManager(tk.Frame):
|
||||
self.tags_display.tag_bind(tag_name, "<Button-1>", self.remove_tag)
|
||||
self.tags_display.tag_bind(tag_name, "<Button-3>", self.open_tag_wiki_url)
|
||||
self.tags_display.insert(tk.INSERT, " ")
|
||||
self.tags_display.config(state="disabled")
|
||||
self.tags_display.config(state=tk.DISABLED)
|
||||
|
||||
def remove_tag(self, event):
|
||||
"""Remove the clicked tag from the list and update the display."""
|
||||
|
Reference in New Issue
Block a user