feat: make main window scrollable with auto-scroll column
This commit is contained in:
		
							
								
								
									
										13
									
								
								main.py
									
									
									
									
									
								
							
							
						
						
									
										13
									
								
								main.py
									
									
									
									
									
								
							@ -156,8 +156,9 @@ class FlashcardCreator:
 | 
			
		||||
        # Add file picker to page overlay
 | 
			
		||||
        page.overlay.append(self.file_picker)
 | 
			
		||||
 | 
			
		||||
        # Update the page.add call to include the container instead of table directly
 | 
			
		||||
        page.add(
 | 
			
		||||
        # Create a scrollable column for the main content
 | 
			
		||||
        main_content = ft.Column(
 | 
			
		||||
            [
 | 
			
		||||
                ft.Row([self.source_dropdown, self.target_dropdown, self.settings_button]),
 | 
			
		||||
                ft.Divider(),
 | 
			
		||||
                ft.Text("Input Text", size=16, weight=ft.FontWeight.BOLD),
 | 
			
		||||
@ -169,7 +170,7 @@ class FlashcardCreator:
 | 
			
		||||
                self.stack_description,
 | 
			
		||||
                ft.Divider(),
 | 
			
		||||
                ft.Text("Generated Flashcards", size=16, weight=ft.FontWeight.BOLD),
 | 
			
		||||
            flashcard_table_container,  # Use the container instead of direct table
 | 
			
		||||
                flashcard_table_container,
 | 
			
		||||
                ft.Row(
 | 
			
		||||
                    [
 | 
			
		||||
                        self.add_to_anki_button,
 | 
			
		||||
@ -177,8 +178,14 @@ class FlashcardCreator:
 | 
			
		||||
                        self.export_csv_button,
 | 
			
		||||
                    ]
 | 
			
		||||
                ),
 | 
			
		||||
            ],
 | 
			
		||||
            scroll=ft.ScrollMode.AUTO,
 | 
			
		||||
            expand=True,
 | 
			
		||||
        )
 | 
			
		||||
 | 
			
		||||
        # Add the scrollable content to the page
 | 
			
		||||
        page.add(main_content)
 | 
			
		||||
 | 
			
		||||
    def on_source_language_change(self, e):
 | 
			
		||||
        self.source_language = e.control.value
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user