From a27bbb9e28320019e8bee84edef5c66d931dc50e Mon Sep 17 00:00:00 2001 From: Will McGugan Date: Tue, 5 Apr 2022 17:31:17 +0100 Subject: [PATCH] tweaks --- examples/basic.css | 7 +------ src/textual/_compositor.py | 17 ++++++----------- src/textual/app.py | 4 ++-- src/textual/design.py | 4 ++-- 4 files changed, 11 insertions(+), 21 deletions(-) diff --git a/examples/basic.css b/examples/basic.css index 838791d70..165ce1a40 100644 --- a/examples/basic.css +++ b/examples/basic.css @@ -32,7 +32,6 @@ App > Screen { height: 8; background: $primary-darken1; color: $on-primary-darken1; - border-right: outer $primary-darken3; } @@ -46,7 +45,6 @@ App > Screen { color: $on-primary-darken2; background: $primary-darken2; height: 3; - border: hkey $primary-darken3; } @@ -57,9 +55,8 @@ App > Screen { } Tweet { - height: 7; + height: 8; max-width: 80; - margin: 1 2; background: $background; color: $on-background; @@ -81,8 +78,6 @@ TweetBody { #footer { color: $on-accent2; background: $accent2; - height: 1; - border-top: hkey $accent2-darken2; } diff --git a/src/textual/_compositor.py b/src/textual/_compositor.py index 2071ee5f3..88b85e2e6 100644 --- a/src/textual/_compositor.py +++ b/src/textual/_compositor.py @@ -210,10 +210,9 @@ class Compositor: log(" " * indent, widget, region) - # region += layout_offset - # Container region is minus border container_region = region.shrink(widget.styles.gutter) + container_size = container_region.size # Containers (widgets with layout) require adding children if widget.layout is not None: @@ -254,14 +253,14 @@ class Compositor: # Add any scrollbars for chrome_widget, chrome_region in widget._arrange_scrollbars( - container_region.size + container_size ): map[chrome_widget] = RenderRegion( chrome_region + container_region.origin + layout_offset, order, clip, - container_region.size, - container_region.size, + container_size, + container_size, ) # Add the container widget, which will render a background @@ -270,17 +269,13 @@ class Compositor: order, clip, total_region.size, - container_region.size, + container_size, ) else: # Add the widget to the map map[widget] = RenderRegion( - region + layout_offset, - order, - clip, - region.size, - container_region.size, + region + layout_offset, order, clip, region.size, container_size ) indent -= 1 diff --git a/src/textual/app.py b/src/textual/app.py index 179aaff13..6e2a452aa 100644 --- a/src/textual/app.py +++ b/src/textual/app.py @@ -113,8 +113,8 @@ class App(DOMNode): self._refresh_required = False self.design = ColorSystem( - primary="#005EA8", - secondary="#F59402", + primary="#1564bf", + secondary="#ff9800", warning="#ffa000", error="#C62828", success="#558B2F", diff --git a/src/textual/design.py b/src/textual/design.py index 4d69decb1..618478c37 100644 --- a/src/textual/design.py +++ b/src/textual/design.py @@ -164,7 +164,7 @@ class ColorSystem: ("accent2", accent2), ] - # Colors names that have a dark varient + # Colors names that have a dark variant DARK_SHADES = {"primary", "secondary"} for name, color in COLORS: @@ -183,7 +183,7 @@ class ColorSystem: for fade in range(3): text_color = shade_color.get_contrast_text(text_alpha) if fade > 0: - text_color = text_color.blend(shade_color, fade * 0.2 + 0.15) + text_color = text_color.blend(shade_color, fade * 0.1 + 0.15) on_name = f"on-{name}{shade_name}-fade{fade}" else: on_name = f"on-{name}{shade_name}"