Compare commits

...

2 Commits

19
main.py
View File

@ -156,9 +156,12 @@ class FlashcardCreator:
# Add file picker to page overlay # Add file picker to page overlay
page.overlay.append(self.file_picker) page.overlay.append(self.file_picker)
# Update the page.add call to include the container instead of table directly # Create a scrollable column for the main content
page.add( main_content = ft.Column(
ft.Row([self.source_dropdown, self.target_dropdown, self.settings_button]), [
ft.Row(
[self.source_dropdown, self.target_dropdown, self.settings_button]
),
ft.Divider(), ft.Divider(),
ft.Text("Input Text", size=16, weight=ft.FontWeight.BOLD), ft.Text("Input Text", size=16, weight=ft.FontWeight.BOLD),
self.input_text, self.input_text,
@ -169,7 +172,7 @@ class FlashcardCreator:
self.stack_description, self.stack_description,
ft.Divider(), ft.Divider(),
ft.Text("Generated Flashcards", size=16, weight=ft.FontWeight.BOLD), 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( ft.Row(
[ [
self.add_to_anki_button, self.add_to_anki_button,
@ -177,8 +180,14 @@ class FlashcardCreator:
self.export_csv_button, 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): def on_source_language_change(self, e):
self.source_language = e.control.value self.source_language = e.control.value
@ -212,7 +221,7 @@ class FlashcardCreator:
f, f,
) )
e.close(dialog) e.page.close(dialog)
e.page.update() e.page.update()
# Load settings if they exist # Load settings if they exist