From 3cfe6e428be22fdbf715f1f28caec0c802fd069e Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Wed, 10 Jun 2020 16:27:28 +0200 Subject: Lay out title text dynamically in `TitleBar` --- native/src/renderer/null.rs | 48 ++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 45 insertions(+), 3 deletions(-) (limited to 'native/src/renderer') diff --git a/native/src/renderer/null.rs b/native/src/renderer/null.rs index 29df3e14..d6a8e18f 100644 --- a/native/src/renderer/null.rs +++ b/native/src/renderer/null.rs @@ -1,7 +1,8 @@ use crate::{ - button, checkbox, column, container, progress_bar, radio, row, scrollable, - slider, text, text_input, Color, Element, Font, HorizontalAlignment, - Layout, Point, Rectangle, Renderer, Size, VerticalAlignment, + button, checkbox, column, container, pane_grid, progress_bar, radio, row, + scrollable, slider, text, text_input, Color, Element, Font, + HorizontalAlignment, Layout, Point, Rectangle, Renderer, Size, + VerticalAlignment, }; /// A renderer that does nothing. @@ -241,3 +242,44 @@ impl container::Renderer for Null { ) { } } + +impl pane_grid::Renderer for Null { + fn draw( + &mut self, + _defaults: &Self::Defaults, + _content: &[(pane_grid::Pane, pane_grid::Content<'_, Message, Self>)], + _dragging: Option<(pane_grid::Pane, Point)>, + _resizing: Option, + _layout: Layout<'_>, + _cursor_position: Point, + ) { + } + + fn draw_pane( + &mut self, + _defaults: &Self::Defaults, + _bounds: Rectangle, + _style: &Self::Style, + _title_bar: Option<( + &pane_grid::TitleBar<'_, Message, Self>, + Layout<'_>, + )>, + _body: (&Element<'_, Message, Self>, Layout<'_>), + _cursor_position: Point, + ) { + } + + fn draw_title_bar( + &mut self, + _defaults: &Self::Defaults, + _bounds: Rectangle, + _style: &Self::Style, + _title: &str, + _title_size: u16, + _title_font: Self::Font, + _title_bounds: Rectangle, + _controls: Option<(&Element<'_, Message, Self>, Layout<'_>)>, + _cursor_position: Point, + ) { + } +} -- cgit