summaryrefslogtreecommitdiffstats
path: root/widget/src/pane_grid/title_bar.rs
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2024-01-19 20:41:52 +0100
committerLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2024-01-19 20:41:52 +0100
commit1781068e1c3a65551db1e832fdbaddba99124051 (patch)
tree60e0b3854cc0541712572fbb0e56f14435951ea9 /widget/src/pane_grid/title_bar.rs
parent41dec5bd203ff5b1574a33a17d5f7358ae1beea2 (diff)
parent7ae7fcb89855002519bab752fd3686106ce448db (diff)
downloadiced-1781068e1c3a65551db1e832fdbaddba99124051.tar.gz
iced-1781068e1c3a65551db1e832fdbaddba99124051.tar.bz2
iced-1781068e1c3a65551db1e832fdbaddba99124051.zip
Merge branch 'master' into remove-vertex-indexing
Diffstat (limited to 'widget/src/pane_grid/title_bar.rs')
-rw-r--r--widget/src/pane_grid/title_bar.rs18
1 files changed, 9 insertions, 9 deletions
diff --git a/widget/src/pane_grid/title_bar.rs b/widget/src/pane_grid/title_bar.rs
index f4dbb6b1..eb21b743 100644
--- a/widget/src/pane_grid/title_bar.rs
+++ b/widget/src/pane_grid/title_bar.rs
@@ -217,7 +217,7 @@ where
renderer: &Renderer,
limits: &layout::Limits,
) -> layout::Node {
- let limits = limits.pad(self.padding);
+ let limits = limits.shrink(self.padding);
let max_size = limits.max();
let title_layout = self.content.as_widget().layout(
@@ -228,8 +228,8 @@ where
let title_size = title_layout.size();
- let mut node = if let Some(controls) = &self.controls {
- let mut controls_layout = controls.as_widget().layout(
+ let node = if let Some(controls) = &self.controls {
+ let controls_layout = controls.as_widget().layout(
&mut tree.children[1],
renderer,
&layout::Limits::new(Size::ZERO, max_size),
@@ -240,11 +240,13 @@ where
let height = title_size.height.max(controls_size.height);
- controls_layout.move_to(Point::new(space_before_controls, 0.0));
-
layout::Node::with_children(
Size::new(max_size.width, height),
- vec![title_layout, controls_layout],
+ vec![
+ title_layout,
+ controls_layout
+ .move_to(Point::new(space_before_controls, 0.0)),
+ ],
)
} else {
layout::Node::with_children(
@@ -253,9 +255,7 @@ where
)
};
- node.move_to(Point::new(self.padding.left, self.padding.top));
-
- layout::Node::with_children(node.size().pad(self.padding), vec![node])
+ layout::Node::container(node, self.padding)
}
pub(crate) fn operate(