diff --git a/bale/content.py b/bale/content.py index 9a6d224..a6b82c3 100644 --- a/bale/content.py +++ b/bale/content.py @@ -27,6 +27,7 @@ class Content: def build(self): self._header = ui.header(bordered=True).classes("bg-dark q-pt-sm q-pb-xs") + self._header.tailwind.border_color(f"[{el.orange}]").min_width("[920px]") self._header.visible = False with self._header: with ui.row().classes("w-full h-12 justify-between items-center"): @@ -35,7 +36,6 @@ class Content: self._tab["manage"] = ui.tab(name="Manage").classes("text-secondary") self._tab["automation"] = ui.tab(name="Automation").classes("text-secondary") self._tab["history"] = ui.tab(name="History").classes("text-secondary") - self._tab["settings"] = ui.tab(name="Settings").classes("text-secondary") with ui.row().classes("items-center"): self._spinner = el.Spinner() self._host_display = ui.label().classes("text-secondary text-h4") @@ -52,14 +52,12 @@ class Content: def _build_tab_panels(self): with self._tab_panels: - with ui.tab_panel(self._tab["manage"]).style("height: calc(100vh - 131px)"): + with el.ContentTabPanel(self._tab["manage"]): self._manage = Manage(spinner=self._spinner, host=self._host) - with ui.tab_panel(self._tab["automation"]).style("height: calc(100vh - 131px)"): + with el.ContentTabPanel(self._tab["automation"]): self._automation = Automation(spinner=self._spinner, host=self._host) - with ui.tab_panel(self._tab["history"]).style("height: calc(100vh - 131px)"): + with el.ContentTabPanel(self._tab["history"]): self._history = History(spinner=self._spinner, host=self._host) - with ui.tab_panel(self._tab["settings"]).style("height: calc(100vh - 131px)"): - ui.label("settings tab") async def host_selected(self, name): self._host = name diff --git a/bale/elements.py b/bale/elements.py index 7196aee..6c5836d 100644 --- a/bale/elements.py +++ b/bale/elements.py @@ -1,6 +1,7 @@ from typing import Any, Callable, Dict, List, Literal, Optional, Union from nicegui import ui, app, Tailwind from nicegui.elements.spinner import SpinnerTypes +from nicegui.elements.tabs import Tab from nicegui.tailwind_types.height import Height from nicegui.tailwind_types.width import Width from nicegui.elements.mixins.validation_element import ValidationElement @@ -284,3 +285,10 @@ class JsonEditor(ui.json_editor): super().__init__(properties, on_select=on_select, on_change=on_change) self.classes("jse-theme-dark") self.tailwind.height("[360px]").width("full") + + +class ContentTabPanel(ui.tab_panel): + def __init__(self, name: Tab | str) -> None: + super().__init__(name) + self.style("height: calc(100vh - 131px)") + self.tailwind.min_width("[920px]") diff --git a/bale/tabs/settings.py b/bale/tabs/settings.py deleted file mode 100644 index eea436a..0000000 --- a/bale/tabs/settings.py +++ /dev/null @@ -1,3 +0,0 @@ -import logging - -logger = logging.getLogger(__name__)