feature: Allow changing ResizablePanel size and content
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 56/100
Hướng nghiên cứu
Start with the Python ResizablePanel and ResizablePanelGroup APIs and trace how changes to content and default_size are sent to the Flutter panel widgets. Reproduce the sample by changing both properties after the group is mounted, then inspect the related update path and tests. Done means direct property updates change panel content and sizes without rebuilding the panel list or losing existing scroll state.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Duplicate Check
- I have searched the opened issues and there are no duplicates
Describe the requested feature
Thanks for the nice ResizablePanel addition. I'm requesting some improvements though:
Currently it does not seem to be possible to change the content, or programmatically change the sizes of the ResizablePanels once they have been added to ResizablePanelGroup.panels.
I'd expect the following sample code to change the panel sizes and content when the button is clicked, but neither are changing:
import flet as ft
import flet_shadcn_ui as shad
def main(page: ft.Page):
panelgroup = shad.ResizablePanelGroup(
width=500,
height=200,
panels=[
shad.ResizablePanel(default_size=0.8, content=ft.Text("One")),
shad.ResizablePanel(default_size=0.2, content=ft.Text("Two")),
],
)
page.add(panelgroup)
def on_click():
panelgroup.panels[0].default_size=0.5
panelgroup.panels[0].content=ft.Text("Three")
panelgroup.panels[1].default_size=0.5
panelgroup.panels[1].content=ft.Text("Four")
panelgroup.update()
print("button clicked")
page.add(
ft.Button(
content="click",
on_click=on_click,
)
)
if __name__ == "__main__":
ft.run(main)
If the ResizablePanelGroup.panels list is fully reassigned, the content does seem to change, however the panel sizes remain unchanged:
def on_click():
panelgroup.panels=[
shad.ResizablePanel(default_size=0.5, content=ft.Text("Three")),
shad.ResizablePanel(default_size=0.5, content=ft.Text("Four")),
]
panelgroup.update()
print("button clicked")
However chaning the content this way has the disadvantage that any existing panel content are re-added on the page, and for example the scroll position of any ScrollableControl will be lost.
Only thing that seems to change the sizes currently is if the number of items in ResizablePanelGroup.panels changes:
def on_click():
panelgroup.panels=[
shad.ResizablePanel(default_size=0.6, content=ft.Text("One")),
shad.ResizablePanel(default_size=0.2, content=ft.Text("Two")),
shad.ResizablePanel(default_size=0.2, content=ft.Text("Three")),
]
panelgroup.update()
print("button clicked")
EDIT: I relized that even in this case the default_size values aren't abided, but each ResizablePanel always will be equal size.
Please allow changing the ResizablePanel size and content directly via the content and default_size properties.
Suggest a solution
No response
Screenshots
No response
Additional details
No response
- Ngôn ngữ chính
- Python
- Star
- 17.6k
- Fork
- 753
- Merge trung bình
- 2 ngày 8 giờ
- Pull request đã merge (30 ngày)
- 64
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của flet-dev/flet
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
flet-dev/flet#7102 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
feature: python 3.15 supportĐang mởfeature request
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
flet-dev/flet#6985 · 3 bình luận · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug: dataclass_transform() uses should include `field_specifiers` argumentCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Desktop 0.86.x: silent callback crashes, ambiguous run_thread/run_task semantics, and focus() no-op via run_taskCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bug: InputFilter number checkingCó thể đã có người làm @ndonkoHenri đã nhận hôm nay. Đang mởbug
flet-dev/flet#7098 · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của flet-dev/flet
Issue tương tự
-
CI flake: test-windows times out spawning Node in tests/test_antigravity_node_hooks.py (develop red)Đang mởarea/ci P2
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Maintainer thường phản hồi trong vòng 2 ngày
-
benchmark
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 79/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 77/100
mozilla-ai/cq#601 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Bump Python to 3.14 or 3.15Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Maintainer thường phản hồi trong vòng 1 ngày