aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPolesznyák Márk <contact@pml68.dev>2025-10-02 22:56:10 +0200
committerPolesznyák Márk <contact@pml68.dev>2025-10-02 23:01:04 +0200
commitaa44f877d920a7f5eb32f37b5cccc678c19829aa (patch)
treed3393ddc2fd44370dab866fa6828160f494a935a
parentdocs(README): add builds.sr.ht status and docs website status (diff)
downloadiced_dialog-aa44f877d920a7f5eb32f37b5cccc678c19829aa.tar.gz
fix: sizing issues (collapsed dialog without user-defined size)
-rw-r--r--src/dialog.rs12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/dialog.rs b/src/dialog.rs
index 73d7282..3796948 100644
--- a/src/dialog.rs
+++ b/src/dialog.rs
@@ -414,8 +414,16 @@ where
has_buttons.then_some(vertical()),
buttons,
])
- .width(self.width)
- .height(self.height)
+ .width(if self.width == Length::Shrink && has_buttons {
+ Length::Fill
+ } else {
+ self.width
+ })
+ .height(if self.height == Length::Shrink && has_buttons {
+ Length::Fill
+ } else {
+ self.height
+ })
.max_width(max_width)
.max_height(max_height)
.class(self.container_class)