new intarfece
This commit is contained in:
@@ -20,7 +20,7 @@ class PollPage(ft.Column):
|
||||
controls=[
|
||||
ft.Row(
|
||||
alignment=ft.MainAxisAlignment.CENTER,
|
||||
controls=[ft.ProgressRing(width=40, height=40, color=ds.clolors.laer1)],
|
||||
controls=[ft.ProgressRing(width=ds.s(40), height=ds.s(40), color=ds.clolors.laer1)],
|
||||
)
|
||||
],
|
||||
)
|
||||
@@ -57,8 +57,8 @@ class PollPage(ft.Column):
|
||||
tight=True,
|
||||
spacing=6,
|
||||
controls=[
|
||||
ft.Icon(ft.Icons.STOP_CIRCLE_OUTLINED, color=ds.clolors.ferst, size=16),
|
||||
ft.Text("Прервать тест", color=ds.clolors.ferst, size=13),
|
||||
ft.Icon(ft.Icons.STOP_CIRCLE_OUTLINED, color=ds.clolors.ferst, size=ds.s(16)),
|
||||
ft.Text("Прервать тест", color=ds.clolors.ferst, size=ds.s(13)),
|
||||
],
|
||||
),
|
||||
style=ft.ButtonStyle(
|
||||
@@ -70,12 +70,12 @@ class PollPage(ft.Column):
|
||||
|
||||
counter_badge = ft.Container(
|
||||
bgcolor=ds.clolors.laer2,
|
||||
border_radius=10,
|
||||
padding=ft.padding.symmetric(horizontal=20, vertical=10),
|
||||
border_radius=ds.s(10),
|
||||
padding=ft.padding.symmetric(horizontal=ds.s(20), vertical=ds.s(10)),
|
||||
content=ft.Text(
|
||||
f"Вопрос {idx + 1} из {total}",
|
||||
color=ds.clolors.ferst,
|
||||
size=14,
|
||||
size=ds.s(14),
|
||||
weight=ft.FontWeight.BOLD,
|
||||
text_align=ft.TextAlign.CENTER,
|
||||
),
|
||||
@@ -90,14 +90,14 @@ class PollPage(ft.Column):
|
||||
# --- Блок вопроса (alignment на Container, не вложенный Column) ---
|
||||
question_box = ft.Container(
|
||||
expand=True,
|
||||
border_radius=14,
|
||||
padding=24,
|
||||
border_radius=ds.s(14),
|
||||
padding=ds.s(24),
|
||||
bgcolor=ds.clolors.laer2,
|
||||
alignment=ft.Alignment(0.0, 0.0),
|
||||
content=ft.Text(
|
||||
value=q.get("text", ""),
|
||||
color=ds.clolors.ferst,
|
||||
size=16,
|
||||
size=ds.s(16),
|
||||
weight=ft.FontWeight.BOLD,
|
||||
text_align=ft.TextAlign.CENTER,
|
||||
no_wrap=False,
|
||||
@@ -113,22 +113,22 @@ class PollPage(ft.Column):
|
||||
cid = c["id"]
|
||||
is_selected = cid == selected_choice
|
||||
return ft.Container(
|
||||
border_radius=8,
|
||||
padding=ft.padding.symmetric(horizontal=12, vertical=10),
|
||||
border_radius=ds.s(8),
|
||||
padding=ft.padding.symmetric(horizontal=ds.s(12), vertical=ds.s(10)),
|
||||
bgcolor=ds.clolors.laer1 if is_selected else ds.clolors.laer3,
|
||||
content=ft.Row(
|
||||
spacing=10,
|
||||
spacing=ds.s(10),
|
||||
vertical_alignment=ft.CrossAxisAlignment.CENTER,
|
||||
controls=[
|
||||
ft.Icon(
|
||||
ft.Icons.CHECK_CIRCLE if is_selected else ft.Icons.RADIO_BUTTON_UNCHECKED,
|
||||
color=ds.clolors.ferst,
|
||||
size=20,
|
||||
size=ds.s(20),
|
||||
),
|
||||
ft.Text(
|
||||
value=c["text"],
|
||||
color=ds.clolors.ferst,
|
||||
size=14,
|
||||
size=ds.s(14),
|
||||
expand=True,
|
||||
no_wrap=False,
|
||||
),
|
||||
@@ -143,12 +143,12 @@ class PollPage(ft.Column):
|
||||
tile.on_click = lambda e, _qid=q["id"]: self._select_answer(_qid, e.control.data)
|
||||
choice_tiles.append(tile)
|
||||
|
||||
choices_col = ft.Column(controls=choice_tiles, spacing=6)
|
||||
choices_col = ft.Column(controls=choice_tiles, spacing=ds.s(6))
|
||||
|
||||
self.controls = [
|
||||
ft.Column(
|
||||
expand=True,
|
||||
spacing=12,
|
||||
spacing=ds.s(12),
|
||||
controls=[
|
||||
nav_row,
|
||||
question_box,
|
||||
@@ -179,7 +179,7 @@ class PollPage(ft.Column):
|
||||
content=ft.Text(
|
||||
"Завершить тест →",
|
||||
color=ds.clolors.ferst,
|
||||
size=16,
|
||||
size=ds.s(16),
|
||||
weight=ft.FontWeight.BOLD,
|
||||
),
|
||||
data="__finish__",
|
||||
@@ -250,7 +250,7 @@ class PollPage(ft.Column):
|
||||
self.controls = [
|
||||
ft.Row(
|
||||
alignment=ft.MainAxisAlignment.CENTER,
|
||||
controls=[ft.ProgressRing(width=48, height=48, color=ds.clolors.laer1)],
|
||||
controls=[ft.ProgressRing(width=ds.s(48), height=ds.s(48), color=ds.clolors.laer1)],
|
||||
)
|
||||
]
|
||||
self.update()
|
||||
@@ -272,7 +272,7 @@ class PollPage(ft.Column):
|
||||
alignment=ft.MainAxisAlignment.CENTER,
|
||||
horizontal_alignment=ft.CrossAxisAlignment.CENTER,
|
||||
controls=[
|
||||
ft.Icon(ft.Icons.ERROR_OUTLINE, size=48, color=ds.clolors.laer1),
|
||||
ft.Icon(ft.Icons.ERROR_OUTLINE, size=ds.s(48), color=ds.clolors.laer1),
|
||||
ds.CastomText(text=error, size=14),
|
||||
ds.CastomButton(
|
||||
text="Попробовать снова",
|
||||
@@ -292,7 +292,7 @@ class PollPage(ft.Column):
|
||||
)
|
||||
|
||||
success_controls: list[ft.Control] = [
|
||||
ft.Icon(ft.Icons.CHECK_CIRCLE_OUTLINE, size=48, color=ds.clolors.laer1),
|
||||
ft.Icon(ft.Icons.CHECK_CIRCLE_OUTLINE, size=ds.s(48), color=ds.clolors.laer1),
|
||||
ds.CastomText(text="Тест пройден!", size=20, weight=ft.FontWeight.BOLD),
|
||||
]
|
||||
|
||||
@@ -307,7 +307,7 @@ class PollPage(ft.Column):
|
||||
content=ft.Image(
|
||||
src=data_uri,
|
||||
expand=True,
|
||||
height=380,
|
||||
height=ds.s(380),
|
||||
fit=ft.BoxFit.CONTAIN,
|
||||
),
|
||||
)
|
||||
@@ -338,14 +338,14 @@ class PollPage(ft.Column):
|
||||
|
||||
self.controls = [
|
||||
ft.Container(
|
||||
padding=20,
|
||||
padding=ds.s(20),
|
||||
bgcolor=ds.clolors.laer3,
|
||||
border_radius=16,
|
||||
border_radius=ds.s(16),
|
||||
expand=True,
|
||||
content=ft.Column(
|
||||
alignment=ft.MainAxisAlignment.CENTER,
|
||||
horizontal_alignment=ft.CrossAxisAlignment.CENTER,
|
||||
spacing=16,
|
||||
spacing=ds.s(16),
|
||||
controls=success_controls,
|
||||
),
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user