Skip to content
Open
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
18 changes: 12 additions & 6 deletions cmdcompass/gui/global_tag.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,25 @@


class GlobalTagWindow(ctk.CTkToplevel):
def __init__(self, master, data_manager):
def __init__(self, master, data_manager,MainWindow_x,MainWindow_y):
super().__init__(master)
self.title("Create New Tag")

screenSize = getScreenSize()
tag_window_height = 800
tag_window_width = 270

x = (screenSize["SCREEN_WIDTH"]*0.01)
y = (screenSize["SCREEN_HEIGHT"]/2) - (tag_window_height/2)


# Calculate the center position of the window
x = (screenSize["SCREEN_WIDTH"] / 3) - (tag_window_width/2) + MainWindow_x
y = (screenSize["SCREEN_HEIGHT"] / 3) - (tag_window_height/2) + MainWindow_y

self.geometry('%dx%d+%d+%d' % (tag_window_width, tag_window_height, x, y))


self.transient(master)
self.lift()

self.data_manager = data_manager

# Main frame to hold everything
Expand Down Expand Up @@ -137,4 +143,4 @@ def remove_tag(self, tag_uuid):
self.data_manager.remove_tag(tag_uuid)
self.update_tag_list() # Refresh the tag list
except ValueError as e:
CTkMessagebox(title="Error", message=str(e), icon="cancel")
CTkMessagebox(title="Error", message=str(e), icon="cancel")
2 changes: 1 addition & 1 deletion cmdcompass/gui/main_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ def update_tab_button_states(self):
self.comment_tab_button.configure(state="normal", fg_color=DEFAULT_BUTTON_COLOR)

def open_tag_creation_window(self):
tag_creation_window = GlobalTagWindow(self, self.data_manager)
tag_creation_window = GlobalTagWindow(self, self.data_manager,self.winfo_x(),self.winfo_y())
tag_creation_window.grab_set()

def open_add_tag_window(self, command):
Expand Down