]> skyeroc.xyz Git - obs-ctl/commitdiff
Split CSS up into different files
authorsbkelley <sb24kelley@gmail.com>
Wed, 3 Dec 2025 20:23:34 +0000 (15:23 -0500)
committersbkelley <sb24kelley@gmail.com>
Wed, 3 Dec 2025 20:23:34 +0000 (15:23 -0500)
src/obs_ctl/app.py
src/obs_ctl/data/critical.tcss [new file with mode: 0644]
src/obs_ctl/data/default_layout.tcss [new file with mode: 0644]
src/obs_ctl/data/default_style.tcss [new file with mode: 0644]
src/obs_ctl/data/layout.tcss [deleted file]

index 628f2ccade5d59bf0b66bc002981c7daa434210a..b20b448dde870c5994e2e98cfeaaf91e9ca7eada 100644 (file)
@@ -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 (file)
index 0000000..a3cd9c7
--- /dev/null
@@ -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 (file)
index 0000000..5ad4e56
--- /dev/null
@@ -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 (file)
index 0000000..9b1a4fe
--- /dev/null
@@ -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 (file)
index 74aa147..0000000
+++ /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;
-        }
-    }
-}