From 48a8578f7f6a37ca12be439c3ebf30d8c29d5ab6 Mon Sep 17 00:00:00 2001 From: sbkelley Date: Wed, 3 Dec 2025 15:23:34 -0500 Subject: [PATCH] Split CSS up into different files --- src/obs_ctl/app.py | 6 +- src/obs_ctl/data/critical.tcss | 5 ++ src/obs_ctl/data/default_layout.tcss | 64 ++++++++++++++ src/obs_ctl/data/default_style.tcss | 52 ++++++++++++ src/obs_ctl/data/layout.tcss | 119 --------------------------- 5 files changed, 126 insertions(+), 120 deletions(-) create mode 100644 src/obs_ctl/data/critical.tcss create mode 100644 src/obs_ctl/data/default_layout.tcss create mode 100644 src/obs_ctl/data/default_style.tcss delete mode 100644 src/obs_ctl/data/layout.tcss diff --git a/src/obs_ctl/app.py b/src/obs_ctl/app.py index 628f2cc..b20b448 100644 --- a/src/obs_ctl/app.py +++ b/src/obs_ctl/app.py @@ -16,7 +16,11 @@ logger = getLogger(__name__) class OBSCtlApp(App): DEFAULT_CSS = """ """ - CSS_PATH = importlib.resources.files(data).joinpath("layout.tcss") + CSS_PATH = [ + importlib.resources.files(data).joinpath("critical.tcss"), + importlib.resources.files(data).joinpath("default_layout.tcss"), + importlib.resources.files(data).joinpath("default_style.tcss"), + ] def compose(self): yield Header() diff --git a/src/obs_ctl/data/critical.tcss b/src/obs_ctl/data/critical.tcss new file mode 100644 index 0000000..a3cd9c7 --- /dev/null +++ b/src/obs_ctl/data/critical.tcss @@ -0,0 +1,5 @@ +Screen { + .scrollbox { /** ScrollableContainer */ + align:center middle; + } +} \ No newline at end of file diff --git a/src/obs_ctl/data/default_layout.tcss b/src/obs_ctl/data/default_layout.tcss new file mode 100644 index 0000000..5ad4e56 --- /dev/null +++ b/src/obs_ctl/data/default_layout.tcss @@ -0,0 +1,64 @@ +# ------------ +# Color Blocks +# (for arranging) +# ------------ +# Screen { +# background:red; +# .scrollbox { +# background:green; +# .content { +# background:blue; +# } +# } +# } +# ------ +# Layout +# ------ +.content { /** VerticalGroup inside .scrollbox (ScrollableContainer) */ + /** Gets this small before being scrollable */ + min-width:80; + max-width:125; + min-height:19; + max-height:38; + height:auto; + /** --------------------------------------- */ + #top_block { /** HorizontalGroup */ + min-height:11; + height:11fr; + RecordControls { /** Scrollable Container OVERRIDDEN */ + min-width:24; + max-width:40; + width:24fr; + min-height:8; + max-height:13; + scrollbar-gutter:stable; + .record_controls--content { /** Grid */ + min-width:36; + height:10; + } + } + SettingsBlock { /** Container */ + min-width:56; + max-width:85; + width:56fr; + min-height:11; + .obs_settings_pane--content { /** probably belongs as default_css for obssettings */ + grid-size:2 1; + grid-columns:16 1fr; + min-width:36; + } + } + } + #bottom_block{ + min-width:80; + min-height:8; + height:8fr; + StatsDisplay { /** StatsDisplay (ScrollableContainer) OVERRIDDEN */ + min-height:8; + .stats_display--content { /** Grid */ + min-height:8; + max-height:12; + } + } + } +} \ No newline at end of file diff --git a/src/obs_ctl/data/default_style.tcss b/src/obs_ctl/data/default_style.tcss new file mode 100644 index 0000000..9b1a4fe --- /dev/null +++ b/src/obs_ctl/data/default_style.tcss @@ -0,0 +1,52 @@ +# ---------- +# Aesthetics +# ---------- +RecordControls { + border:solid $secondary; + padding:0 1; + .bool_control--light { + background:$panel; + } + + .record_controls--output_control { + background:$surface; + border:blank; + } + + .record_controls--obsws_control { + background:$background; + border:solid $primary; + } +} + +SettingsBlock { + border:solid $secondary; + padding:0 1; + .obs_settings_pane--scrollbox { + background:$surface; + border:solid $primary; + padding:0 1; + } + + .obs_settings_pane--label { + width:1fr; + text-align:right; + padding-right:1; + } + + .obs_settings_pane--input { + background:$panel; + } +} + +StatsDisplay { + border:solid $secondary; + padding:1 2; + TextReadout { + background:$surface; + border:solid $primary; + .text_readout--readout { + background:$panel; + } + } +} diff --git a/src/obs_ctl/data/layout.tcss b/src/obs_ctl/data/layout.tcss deleted file mode 100644 index 74aa147..0000000 --- a/src/obs_ctl/data/layout.tcss +++ /dev/null @@ -1,119 +0,0 @@ -# ------------ -# Color Blocks -# (for arranging) -# ------------ -# Screen { -# background:red; -# .scrollbox { -# background:green; -# .content { -# background:blue; -# } -# } -# } -# ------ -# Layout -# ------ -Screen { - overflow-x:auto; - .scrollbox { /** ScrollableContainer */ - align:center middle; - min-width:52; - min-height:15; - .content { /** VerticalGroup */ - /** Gets this small before being scrollable */ - min-width:74; - max-width:160; - min-height:20; - max-height:43; - /** --------------------------------------- */ - #top_block { /** HorizontalGroup */ - min-height:11; - height:11fr; - RecordControls { /** Scrollable Container OVERRIDDEN */ - min-width:24; - max-width:60; - min-height:6; - .record_controls--content { /** Grid */ - min-width:36; - height:10; - } - } - SettingsBlock { /** Container */ - min-width:50; - .obs_settings_pane--content { - grid-size:2 1; - grid-columns:16 1fr; - min-width:36; - } - } - } - #bottom_block{ - min-width:33; - min-height:9; - height:9fr; - StatsDisplay { /** StatsDisplay (ScrollableContainer) OVERRIDDEN */ - .stats_display--content { /** Grid */ - min-width:75; - min-height:8; - max-height:12; - } - } - } - } - } -} - - -# ---------- -# Aesthetics -# ---------- -RecordControls { - border:solid $secondary; - padding:0 1; - .bool_control--light { - background:$panel; - } - - .record_controls--output_control { - background:$surface; - border:blank; - } - - .record_controls--obsws_control { - background:$background; - border:solid $primary; - } -} - -SettingsBlock { - border:solid $secondary; - padding:0 1; - .obs_settings_pane--scrollbox { - background:$surface; - border:solid $primary; - padding:0 1; - } - - .obs_settings_pane--label { - width:1fr; - text-align:right; - padding-right:1; - } - - .obs_settings_pane--input { - background:$panel; - } -} - -StatsDisplay { - border:solid $secondary; - padding:1 2; - TextReadout { - background:$surface; - border:solid $primary; - .text_readout--readout { - background:$panel; - } - } -} -- 2.47.3