linebender/druid

It should be possible for a window to get its size from its contents

開放

#1,246 建立於 2020年9月19日

 (7 則留言) (0 個反應) (0 位負責人)Rust (567 個分叉)batch import
D-Hardenhancementhelp wanted

倉庫指標

星標
 (9,091 顆星)
PR 合併指標
 (30 天內沒有已合併 PR)

描述

Currently, it seems that a window determines its size based on the value passed to it by the user and then forces its contents to be laid out within that size.

However, it's often more useful and convenient to do it the other way around: The window should use the usual box layout methods on its content to determine the best size for itself within the usual constraints (which should be user-settable on the window). Whether to do this, of course, should be an option settable on the window.

Furthermore, there should be separate options to control whether this size can grow and/or shrink in response to future layouts. This way, it's possible to have a completely dynamically sized window, where showing/hiding UI (for example) inside the window will automatically grow/shrink the window as well.

(I know druid is WIP, but I like it and I didn't see a way to do this nor an existing issue on it, so I've though to open one)

貢獻者指南