improve catering management popup styling (#9)

<img width="562" alt="image" src="attachments/62b290bc-dbb3-4760-8e88-b8d9e6fe1263">

Co-authored-by: David Rodenkirchen <drodenkirchen@linetco.com>
Reviewed-on: Vereins-IT/ez-lan-manager#9
This commit is contained in:
David Rodenkirchen 2025-02-04 08:13:02 +00:00
parent 8971f4b73f
commit 98c2d1570c

View File

@ -27,10 +27,22 @@ class CateringOrderInfoPopup(Component):
min_height=40, min_height=40,
on_press=self.close_cb on_press=self.close_cb
) )
rows = []
is_contrast_line = True
for item, amount in self.order.items.items():
style = TextStyle(fill=self.session.theme.secondary_color if is_contrast_line else self.session.theme.neutral_color)
is_contrast_line = not is_contrast_line
rows.append(
Row(
Text(f"{amount}x", style=style),
Spacer(),
Text(f"{item.name}", style=style)
)
)
return Card( return Card(
content=Column( content=Column(
Text(f"Bestellung {self.order.order_id}", style=TextStyle(font_size=1.2), margin_bottom=1), Text(f"Bestellung {self.order.order_id}", style=TextStyle(font_size=1.2), margin_bottom=1),
*[Row(Text(f"{amount}x"), Spacer(), Text(f"{item.name}")) for item, amount in self.order.items.items()], *rows,
Spacer(), Spacer(),
Row(Text("Gesamtpreis:"), Spacer(), Text(self.session[AccountingService].make_euro_string_from_int(self.order.price))) Row(Text("Gesamtpreis:"), Spacer(), Text(self.session[AccountingService].make_euro_string_from_int(self.order.price)))
), ),
@ -39,7 +51,9 @@ class CateringOrderInfoPopup(Component):
min_width=40, min_width=40,
min_height=40, min_height=40,
on_press=self.close_cb, on_press=self.close_cb,
corner_radius=0.5 corner_radius=0.5,
elevate_on_hover=False,
colorize_on_hover=False
) )
@dataclass @dataclass
@ -105,7 +119,8 @@ class ManageCateringPage(Component):
anchor=header_text, anchor=header_text,
content=CateringOrderInfoPopup(order=self.order_popup_order, close_cb=self.close_cb), content=CateringOrderInfoPopup(order=self.order_popup_order, close_cb=self.close_cb),
is_open=self.order_popup_open, is_open=self.order_popup_open,
position="bottom" position="bottom",
corner_radius=0.5
) )
return Column( return Column(
MainViewContentBox( MainViewContentBox(