add conditional footer width workaround
This commit is contained in:
parent
d43dd96fbb
commit
ea9a805483
@ -10,6 +10,8 @@ from src.ez_lan_manager.components.DesktopNavigation import DesktopNavigation
|
|||||||
class BasePage(Component):
|
class BasePage(Component):
|
||||||
color = "secondary"
|
color = "secondary"
|
||||||
corner_radius = (0, 0.5, 0, 0)
|
corner_radius = (0, 0.5, 0, 0)
|
||||||
|
footer_size = 53.1
|
||||||
|
|
||||||
@event.periodic(60)
|
@event.periodic(60)
|
||||||
async def check_db_conn(self) -> None:
|
async def check_db_conn(self) -> None:
|
||||||
is_healthy = await self.session[DatabaseService].is_healthy()
|
is_healthy = await self.session[DatabaseService].is_healthy()
|
||||||
@ -20,6 +22,16 @@ class BasePage(Component):
|
|||||||
async def on_window_size_change(self):
|
async def on_window_size_change(self):
|
||||||
self.force_refresh()
|
self.force_refresh()
|
||||||
|
|
||||||
|
@event.on_page_change
|
||||||
|
def check_needed_size(self):
|
||||||
|
# ToDo: Low-Prio: Change layout, so the footer is always as wide as needed.
|
||||||
|
# This is a workaround, bc the seating page needs more width
|
||||||
|
if "/seating" in self.session.active_page_url.__str__():
|
||||||
|
self.footer_size = 78.2
|
||||||
|
else:
|
||||||
|
self.footer_size = 53.1
|
||||||
|
self.force_refresh()
|
||||||
|
|
||||||
def build(self) -> Component:
|
def build(self) -> Component:
|
||||||
content = Card(
|
content = Card(
|
||||||
PageView(),
|
PageView(),
|
||||||
@ -47,7 +59,7 @@ class BasePage(Component):
|
|||||||
grow_x=False,
|
grow_x=False,
|
||||||
grow_y=False,
|
grow_y=False,
|
||||||
min_height=1.2,
|
min_height=1.2,
|
||||||
min_width=53.1,
|
min_width=self.footer_size,
|
||||||
margin_bottom=3
|
margin_bottom=3
|
||||||
),
|
),
|
||||||
Spacer(grow_x=True, grow_y=False),
|
Spacer(grow_x=True, grow_y=False),
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user