compositor and cache optimizations

This commit is contained in:
Will McGugan
2022-06-08 11:46:53 +01:00
parent 7914ab9c83
commit 0ff8c7e47c
11 changed files with 107 additions and 43 deletions

View File

@@ -76,8 +76,8 @@ App > Screen {
Tweet {
height: 12;
width: 80;
height:12;
width: 100%;
margin: 1 3;
background: $panel;
@@ -94,18 +94,18 @@ Tweet {
.scrollable {
width: 80;
overflow-y: scroll;
max-width:80;
margin: 1 2;
height: 20;
align-horizontal: center;
layout: vertical;
}
.code {
height: 34;
width: 100%;
}
@@ -189,7 +189,7 @@ OptionItem:hover {
}
Error {
width: 80;
width: 100%;
height:3;
background: $error;
color: $text-error;
@@ -202,7 +202,7 @@ Error {
}
Warning {
width: 80;
width: 100%;
height:3;
background: $warning;
color: $text-warning-fade-1;
@@ -214,7 +214,7 @@ Warning {
}
Success {
width: 80;
width: 100%;
height:3;
box-sizing: border-box;
background: $success-lighten-3;

View File

@@ -117,6 +117,11 @@ class BasicApp(App, css_path="basic.css"):
Warning(),
Tweet(TweetBody(), classes="scroll-horizontal"),
Success(),
Tweet(TweetBody(), classes="scroll-horizontal"),
Tweet(TweetBody(), classes="scroll-horizontal"),
Tweet(TweetBody(), classes="scroll-horizontal"),
Tweet(TweetBody(), classes="scroll-horizontal"),
Tweet(TweetBody(), classes="scroll-horizontal"),
),
footer=Widget(),
sidebar=Widget(
@@ -154,3 +159,15 @@ app = BasicApp()
if __name__ == "__main__":
app.run()
from textual.geometry import Region
from textual.color import Color
print(Region.intersection.cache_info())
print(Region.overlaps.cache_info())
print(Region.union.cache_info())
print(Region.split_vertical.cache_info())
print(Region.__contains__.cache_info())
from textual.css.scalar import Scalar
print(Scalar.resolve_dimension.cache_info())