Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file.
6 changes: 4 additions & 2 deletions sdk/python/examples/controls/vertical_divider/basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
def main(page: ft.Page):
page.add(
ft.Row(
expand=True,
width=180,
height=100,
spacing=0,
controls=[
ft.Container(
Expand Down Expand Up @@ -35,4 +36,5 @@ def main(page: ft.Page):
)


ft.run(main)
if __name__ == "__main__":
ft.run(main)
Binary file not shown.
Empty file.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,5 @@ async def handle_window_close(e: ft.Event[ft.IconButton]):
)


ft.run(main)
if __name__ == "__main__":
ft.run(main)
4 changes: 2 additions & 2 deletions sdk/python/packages/flet/docs/controls/verticaldivider.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
---
class_name: flet.VerticalDivider
examples: ../../examples/controls/vertical_divider
example_images: ../examples/controls/vertical_divider/media
example_images: ../test-images/examples/core/golden/macos/vertical_divider
---

{{ class_summary(class_name) }}
{{ class_summary(class_name, example_images + "/image_for_docs.png", image_caption="Vertical divider") }}

## Examples

Expand Down
4 changes: 2 additions & 2 deletions sdk/python/packages/flet/docs/controls/windowdragarea.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
---
class_name: flet.WindowDragArea
examples: ../../examples/controls/window_drag_area
example_images: ../examples/controls/window_drag_area/media
example_images: ../test-images/examples/core/golden/macos/window_drag_area
---

{{ class_summary(class_name) }}
{{ class_summary(class_name, example_images + "/image_for_docs.png", image_caption="Simple Window Drag Area") }}

## Examples

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import pytest

import flet as ft
import flet.testing as ftt
from examples.controls.vertical_divider import basic


@pytest.mark.asyncio(loop_scope="function")
async def test_image_for_docs(flet_app_function: ftt.FletTestApp, request):
flet_app_function.page.theme_mode = ft.ThemeMode.LIGHT
await flet_app_function.assert_control_screenshot(
request.node.name,
ft.Row(
width=120,
height=60,
expand=True,
spacing=0,
controls=[
ft.Container(
bgcolor=ft.Colors.BLUE_GREY_200,
alignment=ft.Alignment.CENTER,
expand=True,
),
ft.VerticalDivider(),
ft.Container(
bgcolor=ft.Colors.GREY_500,
alignment=ft.Alignment.CENTER,
expand=True,
),
],
),
)


@pytest.mark.parametrize(
"flet_app_function",
[{"flet_app_main": basic.main}],
indirect=True,
)
@pytest.mark.asyncio(loop_scope="function")
async def test_basic(flet_app_function: ftt.FletTestApp):
flet_app_function.assert_screenshot(
"basic",
await flet_app_function.take_page_controls_screenshot(),
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import pytest

import flet as ft
import flet.testing as ftt
from examples.controls.window_drag_area import no_frame_window


@pytest.mark.asyncio(loop_scope="function")
async def test_image_for_docs(flet_app_function: ftt.FletTestApp, request):
flet_app_function.page.theme_mode = ft.ThemeMode.LIGHT
await flet_app_function.assert_control_screenshot(
request.node.name,
ft.Row(
controls=[
ft.WindowDragArea(
expand=True,
content=ft.Container(
bgcolor=ft.Colors.BLUE_GREY_200,
padding=10,
content=ft.Text("Drag area."),
),
),
ft.IconButton(ft.Icons.CLOSE),
]
),
)


@pytest.mark.parametrize(
"flet_app_function",
[{"flet_app_main": no_frame_window.main}],
indirect=True,
)
@pytest.mark.asyncio(loop_scope="function")
async def test_no_frame_window(flet_app_function: ftt.FletTestApp):
flet_app_function.assert_screenshot(
"no_frame_window",
await flet_app_function.take_page_controls_screenshot(),
)
Loading