Untitled
unknown
plain_text
5 months ago
1.7 kB
5
Indexable
class SettingsMenu(ctk.CTkFrame): def __init__(self, parent, dark_mode): # Set menu width to 1/3 of the parent width self.menu_width = parent.winfo_screenwidth() // 3 self.menu_height = parent.winfo_screenheight() # Border color same as circle rings self.border_color = '#2c2c2e' if dark_mode else '#e5e5e7' super().__init__( parent, fg_color='#1c1c1e' if dark_mode else '#f5f5f7', width=self.menu_width, height=self.menu_height, corner_radius=0 # Remove corner radius to align with screen edge ) self.parent = parent self.dark_mode = dark_mode self.is_open = False self.animation_running = False self.current_width = 0 self.target_width = self.menu_width # Configure border - only on the left side self.configure(border_width=2) self.configure(border_color=self.border_color) # Place the frame initially off-screen, aligned to right edge # Remove the additional offset that was causing the gap self.place(relx=1, rely=0, x=self.menu_width, y=0, anchor='ne', height=self.menu_height) # Create main container for content self.main_container = ctk.CTkFrame( self, fg_color='transparent', width=self.menu_width, height=self.menu_height ) self.main_container.pack(fill='both', expand=True) # Create settings content self.create_menu_content()
Editor is loading...
Leave a Comment