summaryrefslogtreecommitdiffstats
path: root/graphics
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2020-06-04 07:13:38 +0200
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2020-06-04 07:13:38 +0200
commita11bcf5af0be26671ba90097c64021014ab2092d (patch)
tree80cc87df6ddcb7bbe8cdeb36baecb1bf80421e34 /graphics
parent4c494c724435d05d1b46d19bf890a8aaef962b15 (diff)
downloadiced-a11bcf5af0be26671ba90097c64021014ab2092d.tar.gz
iced-a11bcf5af0be26671ba90097c64021014ab2092d.tar.bz2
iced-a11bcf5af0be26671ba90097c64021014ab2092d.zip
Draft first-class `TitleBar` in `pane_grid`
Diffstat (limited to 'graphics')
-rw-r--r--graphics/src/widget/pane_grid.rs17
1 files changed, 14 insertions, 3 deletions
diff --git a/graphics/src/widget/pane_grid.rs b/graphics/src/widget/pane_grid.rs
index 56af683d..7a840689 100644
--- a/graphics/src/widget/pane_grid.rs
+++ b/graphics/src/widget/pane_grid.rs
@@ -14,8 +14,8 @@ use iced_native::pane_grid;
use iced_native::{Element, Layout, Point, Rectangle, Vector};
pub use iced_native::pane_grid::{
- Axis, Direction, DragEvent, Focus, KeyPressEvent, Pane, ResizeEvent, Split,
- State,
+ Axis, Configuration, Content, Direction, DragEvent, Focus, KeyPressEvent,
+ Pane, ResizeEvent, Split, State, TitleBar,
};
/// A collection of panes distributed using either vertical or horizontal splits
@@ -34,7 +34,7 @@ where
fn draw<Message>(
&mut self,
defaults: &Self::Defaults,
- content: &[(Pane, Element<'_, Message, Self>)],
+ content: &[(Pane, Content<'_, Message, Self>)],
dragging: Option<Pane>,
resizing: Option<Axis>,
layout: Layout<'_>,
@@ -115,4 +115,15 @@ where
},
)
}
+
+ fn draw_pane<Message>(
+ &mut self,
+ defaults: &Self::Defaults,
+ _title_bar: Option<&TitleBar<'_, Message, Self>>,
+ body: &Element<'_, Message, Self>,
+ layout: Layout<'_>,
+ cursor_position: Point,
+ ) -> Self::Output {
+ body.draw(self, defaults, layout, cursor_position)
+ }
}