summaryrefslogtreecommitdiffstats
path: root/gui-project
diff options
context:
space:
mode:
authorAndreeaRadoescu <randreea23@gmail.com>2024-10-16 21:48:10 +0200
committerAndreeaRadoescu <randreea23@gmail.com>2024-10-16 21:48:10 +0200
commit2310bd64d6b595709432b50e9e8f9b46f3e7bf8b (patch)
treeb724cdabfbb2201ffcb47f7407e9b04a534970cf /gui-project
parentc3cce425598201845c4fa28c180a11d0a8a61aa9 (diff)
make text on cards be displayed with newlines
Diffstat (limited to 'gui-project')
-rw-r--r--gui-project/cards.py8
-rw-r--r--gui-project/main_ui.py5
2 files changed, 5 insertions, 8 deletions
diff --git a/gui-project/cards.py b/gui-project/cards.py
index ac921b3..ededff9 100644
--- a/gui-project/cards.py
+++ b/gui-project/cards.py
@@ -35,19 +35,19 @@ class CardUI():
def init_front(self):
with self.row_parent:
- with ui.card().classes('bg-frontc w-[600px] h-[200px] mx-auto') as self.front:
+ with ui.card().classes('bg-frontc w-[600px] mx-auto') as self.front:
ui.markdown("**Front**")
ui.separator()
- ui.markdown(self.card.get_front())
+ ui.markdown(self.card.get_front()).style('white-space: pre-wrap')
ui.button("Revert", on_click=lambda: self.revert_card())
self.front.set_visibility(False)
def init_back(self):
with self.row_parent:
- with ui.card().classes('bg-back w-[600px] h-[200px] mx-auto') as self.back:
+ with ui.card().classes('bg-back w-[600px] mx-auto') as self.back:
ui.markdown("_Back_")
ui.separator()
- ui.markdown(self.card.get_back())
+ ui.markdown(self.card.get_back()).style('white-space: pre-wrap')
with ui.button_group():
ui.button("Got it", on_click=lambda: self.user_clicked_correct())
ui.button("Ain't got it", on_click=lambda: self.user_clicked_incorrect())
diff --git a/gui-project/main_ui.py b/gui-project/main_ui.py
index de3d770..fcb1f5a 100644
--- a/gui-project/main_ui.py
+++ b/gui-project/main_ui.py
@@ -1,12 +1,9 @@
-from typing import final
-from warnings import showwarning
-
from nicegui import ui
import os
import random
import sys
from cards import CardUI, CardComponent
-from flashcards import Session, SCHEDULERS
+from flashcards import Session
FLASHCARDS_ROOT="/home/andreear/git/schwiizertuutsch/flashcards"
STATE_FILE="/home/andreear/git/flashcards/state.txt"