This is how previously I was supposed to make a widget to take as much space as possible, but be constrained to a specified size before. By placing vertical Adw.Clamp
inside of horizontal Adw.Clamp
and using tighting-threshold
to make a widget to take a full given space of Adw.Clamp
Adw.Dialog quick_edit_dialog {
can-close: true;
Adw.Clamp {
orientation: horizontal;
maximum-size: 500;
tightening-threshold: 500;
Adw.Clamp {
orientation: vertical;
maximum-size: 600;
tightening-threshold: 600;
Adw.ToastOverlay quck_editor_toast_overlay {
Adw.ToolbarView {
margin-bottom: 12;
margin-end: 12;
margin-start: 12;
margin-top: 12;
[top]
Adw.HeaderBar {
Label quick_editor_label {
label: _("Quick Editor");
ellipsize: end;
styles ["title-3"]
}
}
ScrolledWindow {
TextView quick_edit_text_view {
right-margin: 4;
bottom-margin: 4;
top-margin: 4;
left-margin: 4;
styles ["rounded-frame"]
}
}
[bottom]
Box {
orientation: horizontal;
margin-top: 4;
halign: end;
Button quick_edit_copy_button {
label: _("Copy to clipboard");
clicked => $copy_quick_editor_text();
styles ["suggested-action"]
}
}
}
}
}
}
}
In libadwaita 1.7 released in GNOME Platform 48 this behavior was changed
I don’t know any other way how to force widget to take specified size when it is possible and to shrink when there’s not enough size. Maybe you will?