push web
This commit is contained in:
@@ -20,7 +20,7 @@ class PollPage(ft.Column):
|
||||
controls=[
|
||||
ft.Row(
|
||||
alignment=ft.MainAxisAlignment.CENTER,
|
||||
controls=[ft.ProgressRing(width=ds.s(40), height=ds.s(40), color=ds.clolors.laer1)],
|
||||
controls=[ft.ProgressRing(width=ds.s(40), height=ds.s(40), color=ds.colors.secondary_light)],
|
||||
)
|
||||
],
|
||||
)
|
||||
@@ -57,46 +57,54 @@ class PollPage(ft.Column):
|
||||
tight=True,
|
||||
spacing=6,
|
||||
controls=[
|
||||
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)),
|
||||
ft.Icon(ft.Icons.STOP_CIRCLE_OUTLINED, color=ds.colors.primary, size=ds.s(16)),
|
||||
ft.Text("Прервать тест", color=ds.colors.primary, size=ds.s(13)),
|
||||
],
|
||||
),
|
||||
style=ft.ButtonStyle(
|
||||
bgcolor=ds.clolors.laer3,
|
||||
color=ds.clolors.ferst,
|
||||
bgcolor=ds.colors.surface_alt,
|
||||
color=ds.colors.primary,
|
||||
),
|
||||
on_click=self._confirm_abort,
|
||||
)
|
||||
|
||||
counter_badge = ft.Container(
|
||||
bgcolor=ds.clolors.laer2,
|
||||
bgcolor=ds.colors.surface_alt,
|
||||
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,
|
||||
color=ds.colors.text_secondary,
|
||||
size=ds.s(14),
|
||||
weight=ft.FontWeight.BOLD,
|
||||
text_align=ft.TextAlign.CENTER,
|
||||
),
|
||||
)
|
||||
|
||||
nav_row = ft.Row(
|
||||
alignment=ft.MainAxisAlignment.SPACE_BETWEEN,
|
||||
vertical_alignment=ft.CrossAxisAlignment.CENTER,
|
||||
controls=[prev_btn, counter_badge, stop_btn],
|
||||
nav_row = ft.Column(
|
||||
spacing=ds.s(6),
|
||||
controls=[
|
||||
ft.Row(
|
||||
alignment=ft.MainAxisAlignment.CENTER,
|
||||
controls=[counter_badge],
|
||||
),
|
||||
ft.Row(
|
||||
wrap=True,
|
||||
spacing=ds.s(8),
|
||||
run_spacing=ds.s(8),
|
||||
controls=[prev_btn, stop_btn],
|
||||
),
|
||||
],
|
||||
)
|
||||
|
||||
# --- Блок вопроса (alignment на Container, не вложенный Column) ---
|
||||
# --- Блок вопроса ---
|
||||
question_box = ft.Container(
|
||||
expand=True,
|
||||
border_radius=ds.s(14),
|
||||
padding=ds.s(24),
|
||||
bgcolor=ds.clolors.laer2,
|
||||
alignment=ft.Alignment(0.0, 0.0),
|
||||
bgcolor=ds.colors.surface,
|
||||
content=ft.Text(
|
||||
value=q.get("text", ""),
|
||||
color=ds.clolors.ferst,
|
||||
color=ds.colors.text_primary,
|
||||
size=ds.s(16),
|
||||
weight=ft.FontWeight.BOLD,
|
||||
text_align=ft.TextAlign.CENTER,
|
||||
@@ -115,19 +123,19 @@ class PollPage(ft.Column):
|
||||
return ft.Container(
|
||||
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,
|
||||
bgcolor=ds.colors.primary_light if is_selected else ds.colors.surface_alt,
|
||||
content=ft.Row(
|
||||
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,
|
||||
color=ds.colors.primary,
|
||||
size=ds.s(20),
|
||||
),
|
||||
ft.Text(
|
||||
value=c["text"],
|
||||
color=ds.clolors.ferst,
|
||||
color=ds.colors.text_primary,
|
||||
size=ds.s(14),
|
||||
expand=True,
|
||||
no_wrap=False,
|
||||
@@ -147,7 +155,7 @@ class PollPage(ft.Column):
|
||||
|
||||
self.controls = [
|
||||
ft.Column(
|
||||
expand=True,
|
||||
scroll=ft.ScrollMode.AUTO,
|
||||
spacing=ds.s(12),
|
||||
controls=[
|
||||
nav_row,
|
||||
@@ -178,14 +186,14 @@ class PollPage(ft.Column):
|
||||
finish_btn = ft.Button(
|
||||
content=ft.Text(
|
||||
"Завершить тест →",
|
||||
color=ds.clolors.ferst,
|
||||
color=ds.colors.text_on_primary,
|
||||
size=ds.s(16),
|
||||
weight=ft.FontWeight.BOLD,
|
||||
),
|
||||
data="__finish__",
|
||||
style=ft.ButtonStyle(
|
||||
bgcolor=ds.clolors.laer1,
|
||||
color=ds.clolors.ferst,
|
||||
bgcolor=ds.colors.primary,
|
||||
color=ds.colors.text_on_primary,
|
||||
),
|
||||
on_click=self._submit,
|
||||
)
|
||||
@@ -227,7 +235,7 @@ class PollPage(ft.Column):
|
||||
),
|
||||
ft.TextButton(
|
||||
content="Прервать",
|
||||
style=ft.ButtonStyle(color=ds.clolors.laer1),
|
||||
style=ft.ButtonStyle(color=ds.colors.secondary_light),
|
||||
on_click=_do_abort,
|
||||
),
|
||||
],
|
||||
@@ -250,7 +258,7 @@ class PollPage(ft.Column):
|
||||
self.controls = [
|
||||
ft.Row(
|
||||
alignment=ft.MainAxisAlignment.CENTER,
|
||||
controls=[ft.ProgressRing(width=ds.s(48), height=ds.s(48), color=ds.clolors.laer1)],
|
||||
controls=[ft.ProgressRing(width=ds.s(48), height=ds.s(48), color=ds.colors.secondary_light)],
|
||||
)
|
||||
]
|
||||
self.update()
|
||||
@@ -272,7 +280,7 @@ class PollPage(ft.Column):
|
||||
alignment=ft.MainAxisAlignment.CENTER,
|
||||
horizontal_alignment=ft.CrossAxisAlignment.CENTER,
|
||||
controls=[
|
||||
ft.Icon(ft.Icons.ERROR_OUTLINE, size=ds.s(48), color=ds.clolors.laer1),
|
||||
ft.Icon(ft.Icons.ERROR_OUTLINE, size=ds.s(48), color=ds.colors.secondary_light),
|
||||
ds.CastomText(text=error, size=14),
|
||||
ds.CastomButton(
|
||||
text="Попробовать снова",
|
||||
@@ -292,7 +300,7 @@ class PollPage(ft.Column):
|
||||
)
|
||||
|
||||
success_controls: list[ft.Control] = [
|
||||
ft.Icon(ft.Icons.CHECK_CIRCLE_OUTLINE, size=ds.s(48), color=ds.clolors.laer1),
|
||||
ft.Icon(ft.Icons.CHECK_CIRCLE_OUTLINE, size=ds.s(48), color=ds.colors.secondary_light),
|
||||
ds.CastomText(text="Тест пройден!", size=20, weight=ft.FontWeight.BOLD),
|
||||
]
|
||||
|
||||
@@ -339,7 +347,7 @@ class PollPage(ft.Column):
|
||||
self.controls = [
|
||||
ft.Container(
|
||||
padding=ds.s(20),
|
||||
bgcolor=ds.clolors.laer3,
|
||||
bgcolor=ds.colors.accent_lime,
|
||||
border_radius=ds.s(16),
|
||||
expand=True,
|
||||
content=ft.Column(
|
||||
|
||||
Reference in New Issue
Block a user