Skip to content

Commit 6fd1797

Browse files
committed
remove timers
1 parent 87e918d commit 6fd1797

File tree

7 files changed

+5
-18
lines changed

7 files changed

+5
-18
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
1414
### Added
1515

1616
- Added `DOMNode.displayed_and_visible_children` https://github.com/Textualize/textual/pull/6102
17-
- Added `Widget.process_layout`
17+
- Added `Widget.process_layout` https://github.com/Textualize/textual/pull/6105
1818

1919
## [6.1.0] - 2025-08-01
2020

src/textual/_arrange.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ def arrange(
5959
styles = widget.styles
6060

6161
# Widgets which will be displayed
62-
# display_widgets = [child for child in children if get_display(child) != "none"]
6362
display_widgets = list(filter(_get_display, children))
6463
# Widgets organized into layers
6564
layers = _build_layers(display_widgets)

src/textual/layout.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,6 @@ def arrange(
226226
An iterable of widget location
227227
"""
228228

229-
# @timer("get_content_width")
230229
def get_content_width(self, widget: Widget, container: Size, viewport: Size) -> int:
231230
"""Get the optimal content width by arranging children.
232231
@@ -248,7 +247,6 @@ def get_content_width(self, widget: Widget, container: Size, viewport: Size) ->
248247
width = arrangement.total_region.right
249248
return width
250249

251-
# @timer("get_content_height")
252250
def get_content_height(
253251
self, widget: Widget, container: Size, viewport: Size, width: int
254252
) -> int:

src/textual/layouts/grid.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ def arrange(
6060
table_size_columns -= 1
6161

6262
table_size_rows = styles.grid_size_rows
63-
viewport = parent.app.size
63+
viewport = parent.screen.size
6464
keyline_style, _keyline_color = styles.keyline
6565
offset = (0, 0)
6666
gutter_spacing: Spacing | None

src/textual/layouts/horizontal.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def arrange(
2525
parent.pre_layout(self)
2626
placements: list[WidgetPlacement] = []
2727
add_placement = placements.append
28-
viewport = parent.app.size
28+
viewport = parent.screen.size
2929

3030
child_styles = [child.styles for child in children]
3131
box_margins: list[Spacing] = [

src/textual/layouts/stream.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,6 @@
1010
from textual.widget import Widget
1111

1212

13-
from textual._profile import timer
14-
15-
1613
class StreamLayout(Layout):
1714
"""A cut down version of the vertical layout.
1815
@@ -34,15 +31,13 @@ class StreamLayout(Layout):
3431

3532
name = "stream"
3633

37-
@timer("arrange STREAM")
3834
def arrange(
3935
self, parent: Widget, children: list[Widget], size: Size, greedy: bool = True
4036
) -> ArrangeResult:
41-
print(parent)
4237
parent.pre_layout(self)
4338
if not children:
4439
return []
45-
viewport = parent.app.size
40+
viewport = parent.screen.size
4641

4742
_Region = Region
4843
_WidgetPlacement = WidgetPlacement
@@ -87,7 +82,6 @@ def arrange(
8782

8883
return placements
8984

90-
@timer("STREAM.get_content_width")
9185
def get_content_width(self, widget: Widget, container: Size, viewport: Size) -> int:
9286
"""Get the optimal content width by arranging children.
9387
@@ -101,7 +95,6 @@ def get_content_width(self, widget: Widget, container: Size, viewport: Size) ->
10195
"""
10296
return widget.scrollable_content_region.width
10397

104-
@timer("STREAM.get_content_height")
10598
def get_content_height(
10699
self, widget: Widget, container: Size, viewport: Size, width: int
107100
) -> int:

src/textual/layouts/vertical.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,22 +11,19 @@
1111
from textual.geometry import Spacing
1212
from textual.widget import Widget
1313

14-
from textual._profile import timer
15-
1614

1715
class VerticalLayout(Layout):
1816
"""Used to layout Widgets vertically on screen, from top to bottom."""
1917

2018
name = "vertical"
2119

22-
@timer("arrange VERTICAL")
2320
def arrange(
2421
self, parent: Widget, children: list[Widget], size: Size, greedy: bool = True
2522
) -> ArrangeResult:
2623
parent.pre_layout(self)
2724
placements: list[WidgetPlacement] = []
2825
add_placement = placements.append
29-
viewport = parent.app.size
26+
viewport = parent.screen.size
3027

3128
child_styles = [child.styles for child in children]
3229
box_margins: list[Spacing] = [

0 commit comments

Comments
 (0)